42 #ifndef __GXVCOMMN_H__ 43 #define __GXVCOMMN_H__ 48 #include FT_INTERNAL_DEBUG_H 49 #include FT_SFNT_NAMES_H 57 #ifdef FT_DEBUG_LEVEL_TRACE 58 #define GXV_LOAD_TRACE_VARS 60 #undef GXV_LOAD_TRACE_VARS 63 #undef GXV_LOAD_UNUSED_VARS 65 #define IS_PARANOID_VALIDATION ( valid->root->level >= FT_VALIDATE_PARANOID ) 66 #define GXV_SET_ERR_IF_PARANOID( err ) { if ( IS_PARANOID_VALIDATION ) ( err ); } 84 GXV_Validator valid );
108 GXV_LookupValueCPtr value_p,
109 GXV_Validator valid );
113 GXV_LookupValueCPtr base_value_p,
115 GXV_Validator valid );
133 #define GXV_GLYPHOFFSET_FMT( table ) \ 134 ( valid->table.entry_glyphoffset_fmt ) 136 #define GXV_GLYPHOFFSET_SIZE( table ) \ 137 ( valid->table.entry_glyphoffset_fmt / 2 ) 163 GXV_Validator valid );
169 GXV_StateTable_GlyphOffsetCPtr glyphOffset_p,
172 GXV_Validator valid );
177 GXV_Validator valid );
205 GXV_Validator valid );
211 GXV_StateTable_GlyphOffsetCPtr glyphOffset_p,
214 GXV_Validator valid );
257 #ifdef FT_DEBUG_LEVEL_TRACE 265 #define GXV_TABLE_DATA( tag, field ) \ 266 ( ( (GXV_ ## tag ## _Data)valid->table_data )->field ) 269 #define FT_INVALID_( _prefix, _error ) \ 270 ft_validator_error( valid->root, _prefix ## _error ) 272 #define GXV_LIMIT_CHECK( _count ) \ 274 if ( p + _count > ( limit? limit : valid->root->limit ) ) \ 275 FT_INVALID_TOO_SHORT; \ 279 #ifdef FT_DEBUG_LEVEL_TRACE 281 #define GXV_INIT valid->debug_indent = 0 283 #define GXV_NAME_ENTER( name ) \ 285 valid->debug_indent += 2; \ 286 FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ 287 FT_TRACE4(( "%s table\n", name )); \ 290 #define GXV_EXIT valid->debug_indent -= 2 292 #define GXV_TRACE( s ) \ 294 FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ 300 #define GXV_INIT do { } while ( 0 ) 301 #define GXV_NAME_ENTER( name ) do { } while ( 0 ) 302 #define GXV_EXIT do { } while ( 0 ) 304 #define GXV_TRACE( s ) do { } while ( 0 ) 317 #define GXV_32BIT_ALIGNMENT_VALIDATE( a ) \ 321 FT_INVALID_OFFSET ; \ 334 #define GXV_TRACE_HEXDUMP( p, len ) \ 340 for ( b = p; b < (FT_Bytes)p + len; b++ ) \ 341 FT_TRACE1(("\\x%02x", *b)) ; \ 345 #define GXV_TRACE_HEXDUMP_C( p, len ) \ 351 for ( b = p; b < (FT_Bytes)p + len; b++ ) \ 352 if ( 0x40 < *b && *b < 0x7e ) \ 353 FT_TRACE1(("%c", *b)) ; \ 355 FT_TRACE1(("\\x%02x", *b)) ; \ 359 #define GXV_TRACE_HEXDUMP_SFNTNAME( n ) \ 360 GXV_TRACE_HEXDUMP( n.string, n.string_len ) 376 GXV_Validator valid );
381 GXV_Validator valid );
394 GXV_Validator valid );
408 GXV_Validator valid );
423 GXV_Validator valid );
442 GXV_Validator valid );
452 GXV_Validator valid );
457 GXV_Validator valid );
462 GXV_Validator valid );
478 GXV_Validator valid );
485 GXV_Validator valid );
493 GXV_Validator valid );
501 GXV_Validator valid);
504 #define GXV_SUBTABLE_OFFSET_CHECK( _offset ) \ 506 if ( (_offset) > valid->subtable_length ) \ 510 #define GXV_SUBTABLE_LIMIT_CHECK( _count ) \ 512 if ( ( p + (_count) - valid->subtable_start ) > \ 513 valid->subtable_length ) \ 514 FT_INVALID_TOO_SHORT; \ 517 #define GXV_USHORT_TO_SHORT( _us ) \ 518 ( ( 0x8000U < ( _us ) ) ? ( ( _us ) - 0x8000U ) : ( _us ) ) 520 #define GXV_STATETABLE_HEADER_SIZE ( 2 + 2 + 2 + 2 ) 521 #define GXV_STATEHEADER_SIZE GXV_STATETABLE_HEADER_SIZE 523 #define GXV_XSTATETABLE_HEADER_SIZE ( 4 + 4 + 4 + 4 ) 524 #define GXV_XSTATEHEADER_SIZE GXV_XSTATETABLE_HEADER_SIZE 555 GXV_odtect_Range odtect );
559 GXV_Validator valid );
562 #define GXV_ODTECT( n, odtect ) \ 563 GXV_odtect_DataRec odtect ## _range[n]; \ 564 GXV_odtect_RangeRec odtect ## _rec = { 0, NULL }; \ 565 GXV_odtect_Range odtect = NULL 567 #define GXV_ODTECT_INIT( odtect ) \ 569 odtect ## _rec.nRanges = 0; \ 570 odtect ## _rec.range = odtect ## _range; \ 571 odtect = & odtect ## _rec; \ GLenum GLuint GLenum GLsizei length
union GXV_StateTable_GlyphOffsetDesc_ GXV_StateTable_GlyphOffsetDesc
gxv_LookupTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
GXV_StateTable_GlyphOffsetDesc GXV_XStateTable_GlyphOffsetDesc
GXV_StateTable_Subtable_Setup_Func subtable_setup_func
struct GXV_ValidatorRec_ * GXV_Validator
struct GXV_ValidatorRec_ GXV_ValidatorRec
struct GXV_odtect_RangeRec_ * GXV_odtect_Range
struct GXV_odtect_DataRec_ * GXV_odtect_Data
gxv_set_length_by_ushort_offset(FT_UShort *offset, FT_UShort **length, FT_UShort *buff, FT_UInt nmemb, FT_UShort limit, GXV_Validator valid)
gxv_set_length_by_ulong_offset(FT_ULong *offset, FT_ULong **length, FT_ULong *buff, FT_UInt nmemb, FT_ULong limit, GXV_Validator valid)
struct GXV_XStateTable_ValidatorRec_ GXV_XStateTable_ValidatorRec
gxv_BinSrchHeader_validate(FT_Bytes p, FT_Bytes limit, FT_UShort *unitSize_p, FT_UShort *nUnits_p, GXV_Validator valid)
union GXV_LookupValueDesc_ GXV_LookupValueDesc
GXV_LookupValue_SignSpec_
struct GXV_odtect_RangeRec_ GXV_odtect_RangeRec
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
GXV_XStateTable_Entry_Validate_Func entry_validate_func
GXV_StateTable_Entry_Validate_Func entry_validate_func
gxv_ctlPoint_validate(FT_UShort gid, FT_Short ctl_point, GXV_Validator valid)
gxv_glyphid_validate(FT_UShort gid, GXV_Validator valid)
struct GXV_odtect_DataRec_ GXV_odtect_DataRec
gxv_array_getlimits_byte(FT_Bytes table, FT_Bytes limit, FT_Byte *min, FT_Byte *max, GXV_Validator valid)
struct GXV_StateTable_ValidatorRec_ * GXV_StateTable_ValidatorRecData
GXV_StateTable_ValidatorRec statetable
gxv_odtect_validate(GXV_odtect_Range odtect, GXV_Validator valid)
GXV_GlyphOffset_Format entry_glyphoffset_fmt
GXV_LookupValueDesc(* GXV_Lookup_Fmt4_Transit_Func)(FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, GXV_Validator valid)
gxv_XStateTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
const GXV_LookupValueDesc * GXV_LookupValueCPtr
GXV_StateTable_OptData_Load_Func optdata_load_func
struct GXV_XStateTable_ValidatorRec_ * GXV_XStateTable_ValidatorRecData
gxv_odtect_add_range(FT_Bytes start, FT_ULong length, const FT_String *name, GXV_odtect_Range odtect)
float min(float a, float b)
int entry_glyphoffset_fmt
gxv_StateTable_subtable_setup(FT_UShort table_size, FT_UShort classTable, FT_UShort stateArray, FT_UShort entryTable, FT_UShort *classTable_length_p, FT_UShort *stateArray_length_p, FT_UShort *entryTable_length_p, GXV_Validator valid)
gxv_array_getlimits_ushort(FT_Bytes table, FT_Bytes limit, FT_UShort *min, FT_UShort *max, GXV_Validator valid)
typedefFT_BEGIN_HEADER struct FT_ValidatorRec_ volatile * FT_Validator
GXV_XStateTable_Subtable_Setup_Func subtable_setup_func
GXV_XStateTable_ValidatorRec xstatetable
void(* GXV_StateTable_Entry_Validate_Func)(FT_Byte state, FT_UShort flags, GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes statetable_table, FT_Bytes statetable_limit, GXV_Validator valid)
GXV_StateTable_OptData_Load_Func GXV_XStateTable_OptData_Load_Func
gxv_XStateTable_subtable_setup(FT_ULong table_size, FT_ULong classTable, FT_ULong stateArray, FT_ULong entryTable, FT_ULong *classTable_length_p, FT_ULong *stateArray_length_p, FT_ULong *entryTable_length_p, GXV_Validator valid)
GLuint const GLchar * name
struct GXV_StateTable_ValidatorRec_ GXV_StateTable_ValidatorRec
GXV_XStateTable_OptData_Load_Func optdata_load_func
gxv_StateTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
void(* GXV_XStateTable_Subtable_Setup_Func)(FT_ULong table_size, FT_ULong classTable, FT_ULong stateArray, FT_ULong entryTable, FT_ULong *classTable_length_p, FT_ULong *stateArray_length_p, FT_ULong *entryTable_length_p, GXV_Validator valid)
GXV_Lookup_Fmt4_Transit_Func lookupfmt4_trans
void(* GXV_Lookup_Value_Validate_Func)(FT_UShort glyph, GXV_LookupValueCPtr value_p, GXV_Validator valid)
enum GXV_LookupValue_SignSpec_ GXV_LookupValue_SignSpec
void(* GXV_Validate_Func)(FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
const GXV_StateTable_GlyphOffsetDesc * GXV_StateTable_GlyphOffsetCPtr
GXV_Lookup_Value_Validate_Func lookupval_func
GXV_LookupValue_SignSpec lookupval_sign
GLenum GLsizei GLenum GLenum const GLvoid * table
gxv_sfntName_validate(FT_UShort name_index, FT_UShort min_index, FT_UShort max_index, GXV_Validator valid)
enum GXV_GlyphOffset_Format_ GXV_GlyphOffset_Format
const GXV_XStateTable_GlyphOffsetDesc * GXV_XStateTable_GlyphOffsetCPtr
void(* GXV_StateTable_Subtable_Setup_Func)(FT_UShort table_size, FT_UShort classTable, FT_UShort stateArray, FT_UShort entryTable, FT_UShort *classTable_length_p, FT_UShort *stateArray_length_p, FT_UShort *entryTable_length_p, GXV_Validator valid)
void(* GXV_StateTable_OptData_Load_Func)(FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
void(* GXV_XStateTable_Entry_Validate_Func)(FT_UShort state, FT_UShort flags, GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes xstatetable_table, FT_Bytes xstatetable_limit, GXV_Validator valid)