2000-07-19 04:59:31 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ftstream.h */
|
|
|
|
/* */
|
2002-03-30 00:23:28 +01:00
|
|
|
/* Stream handling (specification). */
|
2000-07-19 04:59:31 +02:00
|
|
|
/* */
|
2016-01-13 11:54:10 +01:00
|
|
|
/* Copyright 1996-2016 by */
|
2000-07-19 04:59:31 +02:00
|
|
|
/* 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. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#ifndef FTSTREAM_H_
|
|
|
|
#define FTSTREAM_H_
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-12-09 01:45:38 +01:00
|
|
|
|
|
|
|
#include <ft2build.h>
|
2002-10-31 23:19:27 +01:00
|
|
|
#include FT_SYSTEM_H
|
2000-12-09 01:45:38 +01:00
|
|
|
#include FT_INTERNAL_OBJECTS_H
|
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
|
|
|
|
FT_BEGIN_HEADER
|
2000-07-05 06:32:02 +02:00
|
|
|
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* format of an 8-bit frame_op value: */
|
|
|
|
/* */
|
|
|
|
/* bit 76543210 */
|
|
|
|
/* xxxxxxes */
|
|
|
|
/* */
|
|
|
|
/* s is set to 1 if the value is signed. */
|
|
|
|
/* e is set to 1 if the value is little-endian. */
|
|
|
|
/* xxx is a command. */
|
2000-02-13 14:36:53 +01:00
|
|
|
|
2000-07-19 04:59:31 +02:00
|
|
|
#define FT_FRAME_OP_SHIFT 2
|
|
|
|
#define FT_FRAME_OP_SIGNED 1
|
|
|
|
#define FT_FRAME_OP_LITTLE 2
|
|
|
|
#define FT_FRAME_OP_COMMAND( x ) ( x >> FT_FRAME_OP_SHIFT )
|
2000-02-13 14:36:53 +01:00
|
|
|
|
2000-07-19 04:59:31 +02:00
|
|
|
#define FT_MAKE_FRAME_OP( command, little, sign ) \
|
|
|
|
( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )
|
2000-02-13 14:36:53 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_FRAME_OP_END 0
|
|
|
|
#define FT_FRAME_OP_START 1 /* start a new frame */
|
|
|
|
#define FT_FRAME_OP_BYTE 2 /* read 1-byte value */
|
|
|
|
#define FT_FRAME_OP_SHORT 3 /* read 2-byte value */
|
|
|
|
#define FT_FRAME_OP_LONG 4 /* read 4-byte value */
|
|
|
|
#define FT_FRAME_OP_OFF3 5 /* read 3-byte value */
|
|
|
|
#define FT_FRAME_OP_BYTES 6 /* read a bytes sequence */
|
2000-02-13 14:36:53 +01:00
|
|
|
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2000-07-19 04:59:31 +02:00
|
|
|
typedef enum FT_Frame_Op_
|
|
|
|
{
|
|
|
|
ft_frame_end = 0,
|
|
|
|
ft_frame_start = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2000-07-19 04:59:31 +02:00
|
|
|
ft_frame_byte = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 0 ),
|
|
|
|
ft_frame_schar = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 1 ),
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2000-07-19 04:59:31 +02:00
|
|
|
ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),
|
|
|
|
ft_frame_short_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),
|
|
|
|
ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),
|
|
|
|
ft_frame_short_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),
|
2000-02-13 14:36:53 +01:00
|
|
|
|
2000-07-19 04:59:31 +02:00
|
|
|
ft_frame_ulong_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),
|
2000-12-13 20:55:11 +01:00
|
|
|
ft_frame_long_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),
|
|
|
|
ft_frame_ulong_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),
|
2000-07-19 04:59:31 +02:00
|
|
|
ft_frame_long_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),
|
|
|
|
|
|
|
|
ft_frame_uoff3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),
|
2000-12-13 20:55:11 +01:00
|
|
|
ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),
|
|
|
|
ft_frame_uoff3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),
|
2000-07-19 04:59:31 +02:00
|
|
|
ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2000-07-19 04:59:31 +02:00
|
|
|
ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),
|
|
|
|
ft_frame_skip = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )
|
|
|
|
|
|
|
|
} FT_Frame_Op;
|
2000-02-13 14:36:53 +01:00
|
|
|
|
|
|
|
|
2000-07-19 04:59:31 +02:00
|
|
|
typedef struct FT_Frame_Field_
|
|
|
|
{
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Byte value;
|
|
|
|
FT_Byte size;
|
|
|
|
FT_UShort offset;
|
2000-02-13 14:36:53 +01:00
|
|
|
|
2000-07-19 04:59:31 +02:00
|
|
|
} FT_Frame_Field;
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2000-02-13 14:36:53 +01:00
|
|
|
|
2000-07-31 20:59:02 +02:00
|
|
|
/* Construct an FT_Frame_Field out of a structure type and a field name. */
|
|
|
|
/* The structure type must be set in the FT_STRUCTURE macro before */
|
|
|
|
/* calling the FT_FRAME_START() macro. */
|
2002-03-30 00:23:28 +01:00
|
|
|
/* */
|
2000-07-31 20:59:02 +02:00
|
|
|
#define FT_FIELD_SIZE( f ) \
|
|
|
|
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2000-07-31 20:59:02 +02:00
|
|
|
#define FT_FIELD_SIZE_DELTA( f ) \
|
|
|
|
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2000-07-31 20:59:02 +02:00
|
|
|
#define FT_FIELD_OFFSET( f ) \
|
2000-08-01 03:34:18 +02:00
|
|
|
(FT_UShort)( offsetof( FT_STRUCTURE, f ) )
|
2000-07-31 20:59:02 +02:00
|
|
|
|
|
|
|
#define FT_FRAME_FIELD( frame_op, field ) \
|
|
|
|
{ \
|
|
|
|
frame_op, \
|
|
|
|
FT_FIELD_SIZE( field ), \
|
|
|
|
FT_FIELD_OFFSET( field ) \
|
2000-07-19 04:59:31 +02:00
|
|
|
}
|
2000-02-13 14:36:53 +01:00
|
|
|
|
|
|
|
#define FT_MAKE_EMPTY_FIELD( frame_op ) { frame_op, 0, 0 }
|
|
|
|
|
2000-07-31 20:59:02 +02:00
|
|
|
#define FT_FRAME_START( size ) { ft_frame_start, 0, size }
|
|
|
|
#define FT_FRAME_END { ft_frame_end, 0, 0 }
|
|
|
|
|
|
|
|
#define FT_FRAME_LONG( f ) FT_FRAME_FIELD( ft_frame_long_be, f )
|
|
|
|
#define FT_FRAME_ULONG( f ) FT_FRAME_FIELD( ft_frame_ulong_be, f )
|
|
|
|
#define FT_FRAME_SHORT( f ) FT_FRAME_FIELD( ft_frame_short_be, f )
|
|
|
|
#define FT_FRAME_USHORT( f ) FT_FRAME_FIELD( ft_frame_ushort_be, f )
|
2002-04-19 17:13:47 +02:00
|
|
|
#define FT_FRAME_OFF3( f ) FT_FRAME_FIELD( ft_frame_off3_be, f )
|
|
|
|
#define FT_FRAME_UOFF3( f ) FT_FRAME_FIELD( ft_frame_uoff3_be, f )
|
2000-07-31 20:59:02 +02:00
|
|
|
#define FT_FRAME_BYTE( f ) FT_FRAME_FIELD( ft_frame_byte, f )
|
|
|
|
#define FT_FRAME_CHAR( f ) FT_FRAME_FIELD( ft_frame_schar, f )
|
|
|
|
|
|
|
|
#define FT_FRAME_LONG_LE( f ) FT_FRAME_FIELD( ft_frame_long_le, f )
|
|
|
|
#define FT_FRAME_ULONG_LE( f ) FT_FRAME_FIELD( ft_frame_ulong_le, f )
|
|
|
|
#define FT_FRAME_SHORT_LE( f ) FT_FRAME_FIELD( ft_frame_short_le, f )
|
|
|
|
#define FT_FRAME_USHORT_LE( f ) FT_FRAME_FIELD( ft_frame_ushort_le, f )
|
2002-04-19 17:13:47 +02:00
|
|
|
#define FT_FRAME_OFF3_LE( f ) FT_FRAME_FIELD( ft_frame_off3_le, f )
|
|
|
|
#define FT_FRAME_UOFF3_LE( f ) FT_FRAME_FIELD( ft_frame_uoff3_le, f )
|
2000-07-31 20:59:02 +02:00
|
|
|
|
|
|
|
#define FT_FRAME_SKIP_LONG { ft_frame_long_be, 0, 0 }
|
|
|
|
#define FT_FRAME_SKIP_SHORT { ft_frame_short_be, 0, 0 }
|
|
|
|
#define FT_FRAME_SKIP_BYTE { ft_frame_byte, 0, 0 }
|
|
|
|
|
|
|
|
#define FT_FRAME_BYTES( field, count ) \
|
|
|
|
{ \
|
|
|
|
ft_frame_bytes, \
|
|
|
|
count, \
|
|
|
|
FT_FIELD_OFFSET( field ) \
|
2000-07-19 04:59:31 +02:00
|
|
|
}
|
2000-12-13 20:55:11 +01:00
|
|
|
|
2000-07-19 04:59:31 +02:00
|
|
|
#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2000-07-03 17:00:49 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
2002-03-30 00:23:28 +01:00
|
|
|
/* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* type `char*' or equivalent (1-byte elements). */
|
|
|
|
/* */
|
2001-06-19 10:28:24 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_BYTE_( p, i ) ( ((const FT_Byte*)(p))[(i)] )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_INT16( x ) ( (FT_Int16)(x) )
|
|
|
|
#define FT_UINT16( x ) ( (FT_UInt16)(x) )
|
|
|
|
#define FT_INT32( x ) ( (FT_Int32)(x) )
|
|
|
|
#define FT_UINT32( x ) ( (FT_UInt32)(x) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
Fix errors reported by clang's `sanitize' feature.
* include/freetype/internal/ftstream.h: Simplify and fix integer
extraction macros.
(FT_INT8_, FT_BYTE_I16, FT_BYTE_I32, FT_INT8_I16, FT_INT8_I32,
FT_INT8_I32, FT_INT8_U32): Removed.
(FT_PEEK_SHORT, FT_PEEK_LONG, FT_PEEK_OFF3, FT_PEEK_SHORT_LE,
FT_PEEK_LONG_LE, FT_PEEK_OFF3_LE): Use unsigned values for
computations and convert to signed as the last step.
* src/cff/cf2fixed.h (cf2_intToFixed, cf2_fixedToInt,
cf2_fracToFixed): Avoid shifts of negative values.
(cf2_intToFrac, cf2_fixedToFrac, cf2_fixedTo26Dot6): Removed,
unused.
* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdEXTENDEDNMBR,
default>: Use unsigned values for computations and convert to signed
as the last step.
Use proper types in tracing messages.
* src/cff/cffgload.c (cff_decoder_parse_charstrings): Use unsigned
values for computation of operands and convert to signed as the last
step.
Use proper type in tracing message.
2013-05-04 14:05:24 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_BYTE_U16( p, i, s ) ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )
|
|
|
|
#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
|
|
|
|
Fix errors reported by clang's `sanitize' feature.
* include/freetype/internal/ftstream.h: Simplify and fix integer
extraction macros.
(FT_INT8_, FT_BYTE_I16, FT_BYTE_I32, FT_INT8_I16, FT_INT8_I32,
FT_INT8_I32, FT_INT8_U32): Removed.
(FT_PEEK_SHORT, FT_PEEK_LONG, FT_PEEK_OFF3, FT_PEEK_SHORT_LE,
FT_PEEK_LONG_LE, FT_PEEK_OFF3_LE): Use unsigned values for
computations and convert to signed as the last step.
* src/cff/cf2fixed.h (cf2_intToFixed, cf2_fixedToInt,
cf2_fracToFixed): Avoid shifts of negative values.
(cf2_intToFrac, cf2_fixedToFrac, cf2_fixedTo26Dot6): Removed,
unused.
* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdEXTENDEDNMBR,
default>: Use unsigned values for computations and convert to signed
as the last step.
Use proper types in tracing messages.
* src/cff/cffgload.c (cff_decoder_parse_charstrings): Use unsigned
values for computation of operands and convert to signed as the last
step.
Use proper type in tracing message.
2013-05-04 14:05:24 +02:00
|
|
|
#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8) | \
|
|
|
|
FT_BYTE_U16( p, 1, 0) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_PEEK_USHORT( p ) FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \
|
|
|
|
FT_BYTE_U16( p, 1, 0 ) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
Fix errors reported by clang's `sanitize' feature.
* include/freetype/internal/ftstream.h: Simplify and fix integer
extraction macros.
(FT_INT8_, FT_BYTE_I16, FT_BYTE_I32, FT_INT8_I16, FT_INT8_I32,
FT_INT8_I32, FT_INT8_U32): Removed.
(FT_PEEK_SHORT, FT_PEEK_LONG, FT_PEEK_OFF3, FT_PEEK_SHORT_LE,
FT_PEEK_LONG_LE, FT_PEEK_OFF3_LE): Use unsigned values for
computations and convert to signed as the last step.
* src/cff/cf2fixed.h (cf2_intToFixed, cf2_fixedToInt,
cf2_fracToFixed): Avoid shifts of negative values.
(cf2_intToFrac, cf2_fixedToFrac, cf2_fixedTo26Dot6): Removed,
unused.
* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdEXTENDEDNMBR,
default>: Use unsigned values for computations and convert to signed
as the last step.
Use proper types in tracing messages.
* src/cff/cffgload.c (cff_decoder_parse_charstrings): Use unsigned
values for computation of operands and convert to signed as the last
step.
Use proper type in tracing message.
2013-05-04 14:05:24 +02:00
|
|
|
#define FT_PEEK_LONG( p ) FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \
|
|
|
|
FT_BYTE_U32( p, 1, 16 ) | \
|
|
|
|
FT_BYTE_U32( p, 2, 8 ) | \
|
|
|
|
FT_BYTE_U32( p, 3, 0 ) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_PEEK_ULONG( p ) FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \
|
|
|
|
FT_BYTE_U32( p, 1, 16 ) | \
|
|
|
|
FT_BYTE_U32( p, 2, 8 ) | \
|
|
|
|
FT_BYTE_U32( p, 3, 0 ) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
Fix errors reported by clang's `sanitize' feature.
* include/freetype/internal/ftstream.h: Simplify and fix integer
extraction macros.
(FT_INT8_, FT_BYTE_I16, FT_BYTE_I32, FT_INT8_I16, FT_INT8_I32,
FT_INT8_I32, FT_INT8_U32): Removed.
(FT_PEEK_SHORT, FT_PEEK_LONG, FT_PEEK_OFF3, FT_PEEK_SHORT_LE,
FT_PEEK_LONG_LE, FT_PEEK_OFF3_LE): Use unsigned values for
computations and convert to signed as the last step.
* src/cff/cf2fixed.h (cf2_intToFixed, cf2_fixedToInt,
cf2_fracToFixed): Avoid shifts of negative values.
(cf2_intToFrac, cf2_fixedToFrac, cf2_fixedTo26Dot6): Removed,
unused.
* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdEXTENDEDNMBR,
default>: Use unsigned values for computations and convert to signed
as the last step.
Use proper types in tracing messages.
* src/cff/cffgload.c (cff_decoder_parse_charstrings): Use unsigned
values for computation of operands and convert to signed as the last
step.
Use proper type in tracing message.
2013-05-04 14:05:24 +02:00
|
|
|
#define FT_PEEK_OFF3( p ) FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \
|
|
|
|
FT_BYTE_U32( p, 1, 8 ) | \
|
|
|
|
FT_BYTE_U32( p, 2, 0 ) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_PEEK_UOFF3( p ) FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
|
|
|
|
FT_BYTE_U32( p, 1, 8 ) | \
|
|
|
|
FT_BYTE_U32( p, 2, 0 ) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
Fix errors reported by clang's `sanitize' feature.
* include/freetype/internal/ftstream.h: Simplify and fix integer
extraction macros.
(FT_INT8_, FT_BYTE_I16, FT_BYTE_I32, FT_INT8_I16, FT_INT8_I32,
FT_INT8_I32, FT_INT8_U32): Removed.
(FT_PEEK_SHORT, FT_PEEK_LONG, FT_PEEK_OFF3, FT_PEEK_SHORT_LE,
FT_PEEK_LONG_LE, FT_PEEK_OFF3_LE): Use unsigned values for
computations and convert to signed as the last step.
* src/cff/cf2fixed.h (cf2_intToFixed, cf2_fixedToInt,
cf2_fracToFixed): Avoid shifts of negative values.
(cf2_intToFrac, cf2_fixedToFrac, cf2_fixedTo26Dot6): Removed,
unused.
* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdEXTENDEDNMBR,
default>: Use unsigned values for computations and convert to signed
as the last step.
Use proper types in tracing messages.
* src/cff/cffgload.c (cff_decoder_parse_charstrings): Use unsigned
values for computation of operands and convert to signed as the last
step.
Use proper type in tracing message.
2013-05-04 14:05:24 +02:00
|
|
|
#define FT_PEEK_SHORT_LE( p ) FT_INT16( FT_BYTE_U16( p, 1, 8 ) | \
|
|
|
|
FT_BYTE_U16( p, 0, 0 ) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_PEEK_USHORT_LE( p ) FT_UINT16( FT_BYTE_U16( p, 1, 8 ) | \
|
|
|
|
FT_BYTE_U16( p, 0, 0 ) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
Fix errors reported by clang's `sanitize' feature.
* include/freetype/internal/ftstream.h: Simplify and fix integer
extraction macros.
(FT_INT8_, FT_BYTE_I16, FT_BYTE_I32, FT_INT8_I16, FT_INT8_I32,
FT_INT8_I32, FT_INT8_U32): Removed.
(FT_PEEK_SHORT, FT_PEEK_LONG, FT_PEEK_OFF3, FT_PEEK_SHORT_LE,
FT_PEEK_LONG_LE, FT_PEEK_OFF3_LE): Use unsigned values for
computations and convert to signed as the last step.
* src/cff/cf2fixed.h (cf2_intToFixed, cf2_fixedToInt,
cf2_fracToFixed): Avoid shifts of negative values.
(cf2_intToFrac, cf2_fixedToFrac, cf2_fixedTo26Dot6): Removed,
unused.
* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdEXTENDEDNMBR,
default>: Use unsigned values for computations and convert to signed
as the last step.
Use proper types in tracing messages.
* src/cff/cffgload.c (cff_decoder_parse_charstrings): Use unsigned
values for computation of operands and convert to signed as the last
step.
Use proper type in tracing message.
2013-05-04 14:05:24 +02:00
|
|
|
#define FT_PEEK_LONG_LE( p ) FT_INT32( FT_BYTE_U32( p, 3, 24 ) | \
|
|
|
|
FT_BYTE_U32( p, 2, 16 ) | \
|
|
|
|
FT_BYTE_U32( p, 1, 8 ) | \
|
|
|
|
FT_BYTE_U32( p, 0, 0 ) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_PEEK_ULONG_LE( p ) FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \
|
|
|
|
FT_BYTE_U32( p, 2, 16 ) | \
|
|
|
|
FT_BYTE_U32( p, 1, 8 ) | \
|
|
|
|
FT_BYTE_U32( p, 0, 0 ) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
Fix errors reported by clang's `sanitize' feature.
* include/freetype/internal/ftstream.h: Simplify and fix integer
extraction macros.
(FT_INT8_, FT_BYTE_I16, FT_BYTE_I32, FT_INT8_I16, FT_INT8_I32,
FT_INT8_I32, FT_INT8_U32): Removed.
(FT_PEEK_SHORT, FT_PEEK_LONG, FT_PEEK_OFF3, FT_PEEK_SHORT_LE,
FT_PEEK_LONG_LE, FT_PEEK_OFF3_LE): Use unsigned values for
computations and convert to signed as the last step.
* src/cff/cf2fixed.h (cf2_intToFixed, cf2_fixedToInt,
cf2_fracToFixed): Avoid shifts of negative values.
(cf2_intToFrac, cf2_fixedToFrac, cf2_fixedTo26Dot6): Removed,
unused.
* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdEXTENDEDNMBR,
default>: Use unsigned values for computations and convert to signed
as the last step.
Use proper types in tracing messages.
* src/cff/cffgload.c (cff_decoder_parse_charstrings): Use unsigned
values for computation of operands and convert to signed as the last
step.
Use proper type in tracing message.
2013-05-04 14:05:24 +02:00
|
|
|
#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \
|
|
|
|
FT_BYTE_U32( p, 1, 8 ) | \
|
|
|
|
FT_BYTE_U32( p, 0, 0 ) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_PEEK_UOFF3_LE( p ) FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
|
|
|
|
FT_BYTE_U32( p, 1, 8 ) | \
|
|
|
|
FT_BYTE_U32( p, 0, 0 ) )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_NEXT_CHAR( buffer ) \
|
2000-07-19 04:59:31 +02:00
|
|
|
( (signed char)*buffer++ )
|
2001-06-19 10:28:24 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_NEXT_BYTE( buffer ) \
|
2000-07-19 04:59:31 +02:00
|
|
|
( (unsigned char)*buffer++ )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_NEXT_SHORT( buffer ) \
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
#define FT_NEXT_USHORT( buffer ) \
|
|
|
|
( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_NEXT_OFF3( buffer ) \
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_NEXT_UOFF3( buffer ) \
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_NEXT_LONG( buffer ) \
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_NEXT_ULONG( buffer ) \
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_NEXT_SHORT_LE( buffer ) \
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )
|
2000-05-02 12:50:18 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_NEXT_USHORT_LE( buffer ) \
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )
|
2000-05-02 12:50:18 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_NEXT_OFF3_LE( buffer ) \
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )
|
2000-05-02 12:50:18 +02:00
|
|
|
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
#define FT_NEXT_UOFF3_LE( buffer ) \
|
|
|
|
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )
|
2000-05-02 12:50:18 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_NEXT_LONG_LE( buffer ) \
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )
|
2000-07-19 04:59:31 +02:00
|
|
|
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
#define FT_NEXT_ULONG_LE( buffer ) \
|
|
|
|
( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )
|
2000-05-02 12:50:18 +02:00
|
|
|
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Each GET_xxxx() macro uses an implicit `stream' variable. */
|
|
|
|
/* */
|
2004-06-23 17:44:03 +02:00
|
|
|
#if 0
|
|
|
|
#define FT_GET_MACRO( type ) FT_NEXT_ ## type ( stream->cursor )
|
|
|
|
|
|
|
|
#define FT_GET_CHAR() FT_GET_MACRO( CHAR )
|
|
|
|
#define FT_GET_BYTE() FT_GET_MACRO( BYTE )
|
|
|
|
#define FT_GET_SHORT() FT_GET_MACRO( SHORT )
|
|
|
|
#define FT_GET_USHORT() FT_GET_MACRO( USHORT )
|
|
|
|
#define FT_GET_OFF3() FT_GET_MACRO( OFF3 )
|
|
|
|
#define FT_GET_UOFF3() FT_GET_MACRO( UOFF3 )
|
|
|
|
#define FT_GET_LONG() FT_GET_MACRO( LONG )
|
|
|
|
#define FT_GET_ULONG() FT_GET_MACRO( ULONG )
|
|
|
|
#define FT_GET_TAG4() FT_GET_MACRO( ULONG )
|
|
|
|
|
|
|
|
#define FT_GET_SHORT_LE() FT_GET_MACRO( SHORT_LE )
|
|
|
|
#define FT_GET_USHORT_LE() FT_GET_MACRO( USHORT_LE )
|
|
|
|
#define FT_GET_LONG_LE() FT_GET_MACRO( LONG_LE )
|
|
|
|
#define FT_GET_ULONG_LE() FT_GET_MACRO( ULONG_LE )
|
|
|
|
|
|
|
|
#else
|
2000-07-19 04:59:31 +02:00
|
|
|
#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
|
|
|
|
#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
|
2011-04-12 09:26:43 +02:00
|
|
|
#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )
|
|
|
|
#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )
|
|
|
|
#define FT_GET_OFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )
|
|
|
|
#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )
|
|
|
|
#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Long )
|
|
|
|
#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
|
|
|
|
#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
|
|
|
|
|
|
|
|
#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )
|
|
|
|
#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )
|
|
|
|
#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )
|
|
|
|
#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
|
2004-06-23 17:44:03 +02:00
|
|
|
#endif
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
#define FT_READ_MACRO( func, type, var ) \
|
|
|
|
( var = (type)func( stream, &error ), \
|
|
|
|
error != FT_Err_Ok )
|
|
|
|
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
|
|
|
|
#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
|
2011-04-12 09:26:43 +02:00
|
|
|
#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )
|
|
|
|
#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )
|
|
|
|
#define FT_READ_OFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )
|
|
|
|
#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )
|
|
|
|
#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )
|
|
|
|
#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )
|
* include/freetype/internal/ftstream.h,
src/base/ftstream.c, src/cff/cffload.c, src/pcf/pcfread.c,
src/sfnt/ttcmap.c, src/sfnt/ttcmap0.c, src/sfnt/ttload.c,
src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
src/truetype/ttgload.c, src/truetype/ttpload.c,
src/winfonts/winfnt.c:
changed the definitions of stream macros. Examples:
NEXT_Byte => FT_NEXT_BYTE
NEXT_Short => FT_NEXT_SHORT
NEXT_UShortLE => FT_NEXT_USHORT_LE
READ_Short => FT_READ_SHORT
GET_Long => FT_GET_LONG
etc..
also introduced the FT_PEEK_XXXX functions..
2002-03-22 13:55:23 +01:00
|
|
|
|
2011-04-12 09:26:43 +02:00
|
|
|
#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )
|
|
|
|
#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )
|
|
|
|
#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )
|
|
|
|
#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )
|
2002-02-24 06:26:57 +01:00
|
|
|
|
2000-07-19 04:59:31 +02:00
|
|
|
|
2002-02-24 06:26:57 +01:00
|
|
|
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* initialize a stream for reading a regular system stream */
|
* src/base/ftcalc.c (FT_MulTo64): Commented out.
* include/freetype/internal/ftcalc.h (FT_SqrtFixed), src/base/ftcalc.c
(FT_SqrtFixed), include/freetype/internal/ftdebug.h
(FT_Trace_Get_Count, FT_Trace_Get_Name, FT_Message, FT_Panic),
src/base/ftdebug.c (FT_Trace_Get_Count, FT_Trace_Get_Name, FT_Message,
FT_Panic), include/freetype/internal/ftobjs.h (FT_New_Memory,
FT_Done_Memory), include/freetype/internal/ftstream.h
(FT_Stream_Open), src/base/ftsystem.c (FT_New_Memory, FT_Done_Memory,
FT_Stream_Open): s/FT_EXPORT/FT_BASE/.
* builds/exports.mk: Manually add TT_New_Context to EXPORTS_LIST too.
2005-11-17 02:53:07 +01:00
|
|
|
FT_BASE( FT_Error )
|
2002-02-24 06:26:57 +01:00
|
|
|
FT_Stream_Open( FT_Stream stream,
|
|
|
|
const char* filepathname );
|
|
|
|
|
|
|
|
#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
|
|
|
|
|
|
|
|
|
2004-02-25 13:58:54 +01:00
|
|
|
/* create a new (input) stream from an FT_Open_Args structure */
|
|
|
|
FT_BASE( FT_Error )
|
|
|
|
FT_Stream_New( FT_Library library,
|
|
|
|
const FT_Open_Args* args,
|
|
|
|
FT_Stream *astream );
|
|
|
|
|
|
|
|
/* free a stream */
|
|
|
|
FT_BASE( void )
|
2005-03-15 19:18:57 +01:00
|
|
|
FT_Stream_Free( FT_Stream stream,
|
2004-02-25 13:58:54 +01:00
|
|
|
FT_Int external );
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* initialize a stream for reading in-memory data */
|
2002-02-24 06:26:57 +01:00
|
|
|
FT_BASE( void )
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_Stream_OpenMemory( FT_Stream stream,
|
|
|
|
const FT_Byte* base,
|
|
|
|
FT_ULong size );
|
2002-02-24 06:26:57 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* close a stream (does not destroy the stream structure) */
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_BASE( void )
|
2002-02-24 06:26:57 +01:00
|
|
|
FT_Stream_Close( FT_Stream stream );
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* seek within a stream. position is relative to start of stream */
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_BASE( FT_Error )
|
2002-02-24 06:26:57 +01:00
|
|
|
FT_Stream_Seek( FT_Stream stream,
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_ULong pos );
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* skip bytes in a stream */
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_BASE( FT_Error )
|
2002-02-24 06:26:57 +01:00
|
|
|
FT_Stream_Skip( FT_Stream stream,
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_Long distance );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* return current stream position */
|
2015-02-16 19:35:16 +01:00
|
|
|
FT_BASE( FT_ULong )
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_Stream_Pos( FT_Stream stream );
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* read bytes from a stream into a user-allocated buffer, returns an */
|
|
|
|
/* error if not all bytes could be read. */
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_BASE( FT_Error )
|
2002-02-24 06:26:57 +01:00
|
|
|
FT_Stream_Read( FT_Stream stream,
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_Byte* buffer,
|
|
|
|
FT_ULong count );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* read bytes from a stream at a given position */
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_BASE( FT_Error )
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_Stream_ReadAt( FT_Stream stream,
|
|
|
|
FT_ULong pos,
|
|
|
|
FT_Byte* buffer,
|
|
|
|
FT_ULong count );
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2005-03-16 02:49:54 +01:00
|
|
|
/* try to read bytes at the end of a stream; return number of bytes */
|
|
|
|
/* really available */
|
2005-03-15 19:18:57 +01:00
|
|
|
FT_BASE( FT_ULong )
|
|
|
|
FT_Stream_TryRead( FT_Stream stream,
|
|
|
|
FT_Byte* buffer,
|
|
|
|
FT_ULong count );
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* Enter a frame of `count' consecutive bytes in a stream. Returns an */
|
|
|
|
/* error if the frame could not be read/accessed. The caller can use */
|
|
|
|
/* the FT_Stream_Get_XXX functions to retrieve frame data without */
|
|
|
|
/* error checks. */
|
|
|
|
/* */
|
|
|
|
/* You must _always_ call FT_Stream_ExitFrame() once you have entered */
|
|
|
|
/* a stream frame! */
|
|
|
|
/* */
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_BASE( FT_Error )
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_Stream_EnterFrame( FT_Stream stream,
|
|
|
|
FT_ULong count );
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* exit a stream frame */
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_BASE( void )
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_Stream_ExitFrame( FT_Stream stream );
|
2002-02-24 06:26:57 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* Extract a stream frame. If the stream is disk-based, a heap block */
|
|
|
|
/* is allocated and the frame bytes are read into it. If the stream */
|
|
|
|
/* is memory-based, this function simply set a pointer to the data. */
|
|
|
|
/* */
|
|
|
|
/* Useful to optimize access to memory-based streams transparently. */
|
|
|
|
/* */
|
2006-12-09 09:20:37 +01:00
|
|
|
/* All extracted frames must be `freed' with a call to the function */
|
2002-03-30 00:23:28 +01:00
|
|
|
/* FT_Stream_ReleaseFrame(). */
|
|
|
|
/* */
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_BASE( FT_Error )
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_Stream_ExtractFrame( FT_Stream stream,
|
|
|
|
FT_ULong count,
|
|
|
|
FT_Byte** pbytes );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* release an extract frame (see FT_Stream_ExtractFrame) */
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_BASE( void )
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_Stream_ReleaseFrame( FT_Stream stream,
|
|
|
|
FT_Byte** pbytes );
|
2002-10-31 23:19:27 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* read a byte from an entered frame */
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_BASE( FT_Char )
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_Stream_GetChar( FT_Stream stream );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2011-04-12 09:26:43 +02:00
|
|
|
/* read a 16-bit big-endian unsigned integer from an entered frame */
|
|
|
|
FT_BASE( FT_UShort )
|
|
|
|
FT_Stream_GetUShort( FT_Stream stream );
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2011-04-12 09:26:43 +02:00
|
|
|
/* read a 24-bit big-endian unsigned integer from an entered frame */
|
|
|
|
FT_BASE( FT_ULong )
|
|
|
|
FT_Stream_GetUOffset( FT_Stream stream );
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2011-04-12 09:26:43 +02:00
|
|
|
/* read a 32-bit big-endian unsigned integer from an entered frame */
|
|
|
|
FT_BASE( FT_ULong )
|
|
|
|
FT_Stream_GetULong( FT_Stream stream );
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2011-04-12 09:26:43 +02:00
|
|
|
/* read a 16-bit little-endian unsigned integer from an entered frame */
|
|
|
|
FT_BASE( FT_UShort )
|
|
|
|
FT_Stream_GetUShortLE( FT_Stream stream );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2011-04-12 09:26:43 +02:00
|
|
|
/* read a 32-bit little-endian unsigned integer from an entered frame */
|
|
|
|
FT_BASE( FT_ULong )
|
|
|
|
FT_Stream_GetULongLE( FT_Stream stream );
|
2000-07-07 21:47:34 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* read a byte from a stream */
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_BASE( FT_Char )
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_Stream_ReadChar( FT_Stream stream,
|
|
|
|
FT_Error* error );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2011-04-12 09:26:43 +02:00
|
|
|
/* read a 16-bit big-endian unsigned integer from a stream */
|
|
|
|
FT_BASE( FT_UShort )
|
|
|
|
FT_Stream_ReadUShort( FT_Stream stream,
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_Error* error );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2011-04-12 09:26:43 +02:00
|
|
|
/* read a 24-bit big-endian unsigned integer from a stream */
|
|
|
|
FT_BASE( FT_ULong )
|
|
|
|
FT_Stream_ReadUOffset( FT_Stream stream,
|
|
|
|
FT_Error* error );
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* read a 32-bit big-endian integer from a stream */
|
2011-04-12 09:26:43 +02:00
|
|
|
FT_BASE( FT_ULong )
|
|
|
|
FT_Stream_ReadULong( FT_Stream stream,
|
|
|
|
FT_Error* error );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2011-04-12 09:26:43 +02:00
|
|
|
/* read a 16-bit little-endian unsigned integer from a stream */
|
|
|
|
FT_BASE( FT_UShort )
|
|
|
|
FT_Stream_ReadUShortLE( FT_Stream stream,
|
|
|
|
FT_Error* error );
|
2000-02-13 14:36:53 +01:00
|
|
|
|
2011-04-12 09:26:43 +02:00
|
|
|
/* read a 32-bit little-endian unsigned integer from a stream */
|
|
|
|
FT_BASE( FT_ULong )
|
|
|
|
FT_Stream_ReadULongLE( FT_Stream stream,
|
|
|
|
FT_Error* error );
|
2000-07-07 21:47:34 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* Read a structure from a stream. The structure must be described */
|
|
|
|
/* by an array of FT_Frame_Field records. */
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_BASE( FT_Error )
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_Stream_ReadFields( FT_Stream stream,
|
|
|
|
const FT_Frame_Field* fields,
|
|
|
|
void* structure );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_STREAM_POS() \
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_Stream_Pos( stream )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2013-06-06 09:16:38 +02:00
|
|
|
#define FT_STREAM_SEEK( position ) \
|
|
|
|
FT_SET_ERROR( FT_Stream_Seek( stream, \
|
|
|
|
(FT_ULong)(position) ) )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2013-06-06 09:16:38 +02:00
|
|
|
#define FT_STREAM_SKIP( distance ) \
|
|
|
|
FT_SET_ERROR( FT_Stream_Skip( stream, \
|
|
|
|
(FT_Long)(distance) ) )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2013-06-06 09:16:38 +02:00
|
|
|
#define FT_STREAM_READ( buffer, count ) \
|
|
|
|
FT_SET_ERROR( FT_Stream_Read( stream, \
|
|
|
|
(FT_Byte*)(buffer), \
|
|
|
|
(FT_ULong)(count) ) )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2013-06-06 09:16:38 +02:00
|
|
|
#define FT_STREAM_READ_AT( position, buffer, count ) \
|
|
|
|
FT_SET_ERROR( FT_Stream_ReadAt( stream, \
|
|
|
|
(FT_ULong)(position), \
|
|
|
|
(FT_Byte*)buffer, \
|
|
|
|
(FT_ULong)(count) ) )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#define FT_STREAM_READ_FIELDS( fields, object ) \
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
|
|
|
|
|
|
|
|
|
2013-06-06 09:16:38 +02:00
|
|
|
#define FT_FRAME_ENTER( size ) \
|
|
|
|
FT_SET_ERROR( \
|
|
|
|
FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, \
|
|
|
|
(FT_ULong)(size) ) ) )
|
2002-03-20 11:49:31 +01:00
|
|
|
|
2013-06-06 09:16:38 +02:00
|
|
|
#define FT_FRAME_EXIT() \
|
2006-05-02 12:21:28 +02:00
|
|
|
FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )
|
2002-03-20 11:49:31 +01:00
|
|
|
|
2006-05-03 00:22:16 +02:00
|
|
|
#define FT_FRAME_EXTRACT( size, bytes ) \
|
|
|
|
FT_SET_ERROR( \
|
2013-06-06 09:16:38 +02:00
|
|
|
FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, \
|
|
|
|
(FT_ULong)(size), \
|
2006-05-03 00:22:16 +02:00
|
|
|
(FT_Byte**)&(bytes) ) ) )
|
2002-03-20 11:49:31 +01:00
|
|
|
|
2006-05-03 00:22:16 +02:00
|
|
|
#define FT_FRAME_RELEASE( bytes ) \
|
|
|
|
FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream, \
|
|
|
|
(FT_Byte**)&(bytes) ) )
|
2002-03-20 11:49:31 +01:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
FT_END_HEADER
|
2000-07-05 06:32:02 +02:00
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#endif /* FTSTREAM_H_ */
|
2000-07-19 04:59:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|