zenilib: zenilib/jni/external/freetype2/src/gxvalid/gxvkern.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Typedefs | Enumerations | Functions
gxvkern.c File Reference
`#include "gxvalid.h"`
`#include "gxvcommn.h"`
`#include <FT_SFNT_NAMES_H>`
`#include <FT_SERVICE_GX_VALIDATE_H>`

Go to the source code of this file.

## Macros

#define | FT_COMPONENT trace_gxvkern
#define | GXV_KERN_DATA(field) GXV_TABLE_DATA( kern, field )
#define | GXV_KERN_FMT2_DATA(field)
#define | GXV_KERN_HEADER_SIZE ( KERN_IS_NEW( valid ) ? 8 : 4 )
#define | GXV_KERN_SUBTABLE_HEADER_SIZE ( KERN_IS_NEW( valid ) ? 8 : 6 )
#define | KERN_ALLOWS_APPLE(valid) ( KERN_DIALECT( valid ) & KERN_DIALECT_APPLE )
#define | KERN_ALLOWS_MS(valid) ( KERN_DIALECT( valid ) & KERN_DIALECT_MS )
#define | KERN_DIALECT(valid) GXV_KERN_DATA( dialect_request )
#define | KERN_IS_CLASSIC(valid) ( KERN_VERSION_CLASSIC == GXV_KERN_DATA( version ) )
#define | KERN_IS_NEW(valid) ( KERN_VERSION_NEW == GXV_KERN_DATA( version ) )

## Typedefs

typedef enum GXV_kern_ClassSpec_ | GXV_kern_ClassSpec
typedef struct GXV_kern_DataRec_ * | GXV_kern_Data
typedef struct GXV_kern_DataRec_ | GXV_kern_DataRec
typedef enum GXV_kern_Dialect_ | GXV_kern_Dialect
typedef struct GXV_kern_fmt1_StateOptRec_ | GXV_kern_fmt1_StateOptRec
typedef struct GXV_kern_fmt1_StateOptRec_ * | GXV_kern_fmt1_StateOptRecData
typedef struct GXV_kern_subtable_fmt2_DataRec_ * | GXV_kern_subtable_fmt2_Data
typedef struct GXV_kern_subtable_fmt2_DataRec_ | GXV_kern_subtable_fmt2_DataRec
typedef enum GXV_kern_Version_ | GXV_kern_Version

## Enumerations

enum | GXV_kern_ClassSpec_ { GXV_KERN_CLS_L = 0, GXV_KERN_CLS_R }
enum | GXV_kern_Dialect_ { KERN_DIALECT_UNKNOWN = 0, KERN_DIALECT_MS = FT_VALIDATE_MS, KERN_DIALECT_APPLE = FT_VALIDATE_APPLE, KERN_DIALECT_ANY = FT_VALIDATE_CKERN }
enum | GXV_kern_Version_ { KERN_VERSION_CLASSIC = 0x0000, KERN_VERSION_NEW = 0x0001 }

## Functions

static FT_Bool | gxv_kern_coverage_classic_apple_validate (FT_UShort coverage, FT_UShort *format, GXV_Validator valid)
static FT_Bool | gxv_kern_coverage_classic_microsoft_validate (FT_UShort coverage, FT_UShort *format, GXV_Validator valid)
static FT_Bool | gxv_kern_coverage_new_apple_validate (FT_UShort coverage, FT_UShort *format, GXV_Validator valid)
static GXV_kern_Dialect | gxv_kern_coverage_validate (FT_UShort coverage, FT_UShort *format, GXV_Validator valid)
static void | gxv_kern_subtable_fmt0_pairs_validate (FT_Bytes table, FT_Bytes limit, FT_UShort nPairs, GXV_Validator valid)
static void | gxv_kern_subtable_fmt0_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
static void | gxv_kern_subtable_fmt1_entry_validate (FT_Byte state, FT_UShort flags, GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
static void | gxv_kern_subtable_fmt1_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)
static void | gxv_kern_subtable_fmt1_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
static void | gxv_kern_subtable_fmt1_valueTable_load (FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
static void | gxv_kern_subtable_fmt2_clstbl_validate (FT_Bytes table, FT_Bytes limit, GXV_kern_ClassSpec spec, GXV_Validator valid)
static void | gxv_kern_subtable_fmt2_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
static void | gxv_kern_subtable_fmt3_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
static void | gxv_kern_subtable_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
| gxv_kern_validate (FT_Bytes table, FT_Face face, FT_Validator ftvalid)
| gxv_kern_validate_classic (FT_Bytes table, FT_Face face, FT_Int dialect_flags, FT_Validator ftvalid)
static void | gxv_kern_validate_generic (FT_Bytes table, FT_Face face, FT_Bool classic_only, GXV_kern_Dialect dialect_request, FT_Validator ftvalid)

## Macro Definition Documentation

#define FT_COMPONENT trace_gxvkern

Definition at line 42 of file gxvkern.c.

#define GXV_KERN_DATA | ( |  | field | ) | GXV_TABLE_DATA( kern, field )

Definition at line 80 of file gxvkern.c.

Referenced by gxv_kern_subtable_fmt2_validate(), and gxv_kern_validate_generic().

#define GXV_KERN_FMT2_DATA | ( |  | field | ) |

Value:
( ( (GXV_kern_subtable_fmt2_DataRec *) \
( GXV_KERN_DATA( subtable_data ) ) )->field )
GXV_KERN_DATA
#define GXV_KERN_DATA(field)
Definition: gxvkern.c:80
GXV_kern_subtable_fmt2_DataRec
struct GXV_kern_subtable_fmt2_DataRec_ GXV_kern_subtable_fmt2_DataRec

Definition at line 367 of file gxvkern.c.

Referenced by gxv_kern_subtable_fmt2_clstbl_validate(), and gxv_kern_subtable_fmt2_validate().

#define GXV_KERN_HEADER_SIZE ( KERN_IS_NEW( valid ) ? 8 : 4 )

Definition at line 94 of file gxvkern.c.

#define GXV_KERN_SUBTABLE_HEADER_SIZE ( KERN_IS_NEW( valid ) ? 8 : 6 )

Definition at line 95 of file gxvkern.c.

Referenced by gxv_kern_subtable_fmt0_validate(), gxv_kern_subtable_fmt2_validate(), and gxv_kern_subtable_fmt3_validate().

#define KERN_ALLOWS_APPLE | ( |  | valid | ) | ( KERN_DIALECT( valid ) & KERN_DIALECT_APPLE )

Definition at line 91 of file gxvkern.c.

Referenced by gxv_kern_coverage_validate().

#define KERN_ALLOWS_MS | ( |  | valid | ) | ( KERN_DIALECT( valid ) & KERN_DIALECT_MS )

Definition at line 89 of file gxvkern.c.

Referenced by gxv_kern_coverage_classic_apple_validate(), and gxv_kern_coverage_validate().

#define KERN_DIALECT | ( |  | valid | ) | GXV_KERN_DATA( dialect_request )

Definition at line 87 of file gxvkern.c.

Referenced by gxv_kern_validate_generic().

#define KERN_IS_CLASSIC | ( |  | valid | ) | ( KERN_VERSION_CLASSIC == GXV_KERN_DATA( version ) )

Definition at line 82 of file gxvkern.c.

Referenced by gxv_kern_coverage_validate(), and gxv_kern_validate_generic().

#define KERN_IS_NEW | ( |  | valid | ) | ( KERN_VERSION_NEW == GXV_KERN_DATA( version ) )

Definition at line 84 of file gxvkern.c.

Referenced by gxv_kern_coverage_validate(), gxv_kern_subtable_validate(), and gxv_kern_validate_generic().

## Typedef Documentation

typedef enum GXV_kern_ClassSpec_ GXV_kern_ClassSpec

typedef struct GXV_kern_DataRec_ * GXV_kern_Data

typedef struct GXV_kern_DataRec_ GXV_kern_DataRec

typedef enum GXV_kern_Dialect_ GXV_kern_Dialect

typedef struct GXV_kern_fmt1_StateOptRec_ GXV_kern_fmt1_StateOptRec

typedef struct GXV_kern_fmt1_StateOptRec_ * GXV_kern_fmt1_StateOptRecData

typedef struct GXV_kern_subtable_fmt2_DataRec_ * GXV_kern_subtable_fmt2_Data

typedef struct GXV_kern_subtable_fmt2_DataRec_ GXV_kern_subtable_fmt2_DataRec

typedef enum GXV_kern_Version_ GXV_kern_Version

## Enumeration Type Documentation

enum GXV_kern_ClassSpec_

Enumerator
GXV_KERN_CLS_L |
GXV_KERN_CLS_R |

Definition at line 343 of file gxvkern.c.

enum GXV_kern_Dialect_

Enumerator
KERN_DIALECT_UNKNOWN |
KERN_DIALECT_MS |
KERN_DIALECT_APPLE |
KERN_DIALECT_ANY |

Definition at line 61 of file gxvkern.c.

enum GXV_kern_Version_

Enumerator
KERN_VERSION_CLASSIC |
KERN_VERSION_NEW |

Definition at line 53 of file gxvkern.c.

## Function Documentation

static FT_Bool gxv_kern_coverage_classic_apple_validate | ( | FT_UShort | coverage,
|  | FT_UShort * | format,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 598 of file gxvkern.c.

References FALSE, FT_Bool, FT_BOOL, GXV_TRACE, KERN_ALLOWS_MS, and TRUE.

Referenced by gxv_kern_coverage_validate().

static FT_Bool gxv_kern_coverage_classic_microsoft_validate | ( | FT_UShort | coverage,
|  | FT_UShort * | format,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 639 of file gxvkern.c.

References FALSE, FT_Bool, FT_BOOL, FT_UNUSED, GXV_TRACE, and TRUE.

Referenced by gxv_kern_coverage_validate().

static FT_Bool gxv_kern_coverage_new_apple_validate | ( | FT_UShort | coverage,
|  | FT_UShort * | format,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 561 of file gxvkern.c.

References FALSE, FT_Bool, FT_BOOL, FT_UNUSED, GXV_TRACE, and TRUE.

Referenced by gxv_kern_coverage_validate().

static GXV_kern_Dialect gxv_kern_coverage_validate | ( | FT_UShort | coverage,
|  | FT_UShort * | format,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 689 of file gxvkern.c.

References GXV_EXIT, gxv_kern_coverage_classic_apple_validate(), gxv_kern_coverage_classic_microsoft_validate(), gxv_kern_coverage_new_apple_validate(), GXV_NAME_ENTER, GXV_TRACE, KERN_ALLOWS_APPLE, KERN_ALLOWS_MS, KERN_DIALECT_APPLE, KERN_DIALECT_MS, KERN_DIALECT_UNKNOWN, KERN_IS_CLASSIC, and KERN_IS_NEW.

Referenced by gxv_kern_subtable_validate().

static void gxv_kern_subtable_fmt0_pairs_validate | ( | FT_Bytes | table,
|  | FT_Bytes | limit,
|  | FT_UShort | nPairs,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 110 of file gxvkern.c.

References FT_INVALID_DATA, FT_NEXT_SHORT, FT_NEXT_USHORT, FT_UNUSED, GXV_EXIT, gxv_glyphid_validate(), GXV_NAME_ENTER, GXV_TRACE, and i.

Referenced by gxv_kern_subtable_fmt0_validate().

static void gxv_kern_subtable_fmt0_validate | ( | FT_Bytes | table,
|  | FT_Bytes | limit,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 172 of file gxvkern.c.

References gxv_BinSrchHeader_validate(), GXV_EXIT, gxv_kern_subtable_fmt0_pairs_validate(), GXV_KERN_SUBTABLE_HEADER_SIZE, GXV_LIMIT_CHECK, and GXV_NAME_ENTER.

Referenced by gxv_kern_subtable_validate().

static void gxv_kern_subtable_fmt1_entry_validate | ( | FT_Byte | state,
|  | FT_UShort | flags,
|  | GXV_StateTable_GlyphOffsetCPtr | glyphOffset_p,
|  | FT_Bytes | table,
|  | FT_Bytes | limit,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 262 of file gxvkern.c.

References FT_INVALID_OFFSET, FT_NEXT_USHORT, FT_UNUSED, GXV_LIMIT_CHECK, if(), GXV_StateTable_ValidatorRec_::optdata, and GXV_ValidatorRec_::statetable.

Referenced by gxv_kern_subtable_fmt1_validate().

static void gxv_kern_subtable_fmt1_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
| ) |  |

static

Definition at line 228 of file gxvkern.c.

References gxv_set_length_by_ushort_offset(), GXV_StateTable_ValidatorRec_::optdata, and GXV_ValidatorRec_::statetable.

Referenced by gxv_kern_subtable_fmt1_validate().

static void gxv_kern_subtable_fmt1_validate | ( | FT_Bytes | table,
|  | FT_Bytes | limit,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 314 of file gxvkern.c.

References GXV_StateTable_ValidatorRec_::entry_glyphoffset_fmt, GXV_StateTable_ValidatorRec_::entry_validate_func, GXV_EXIT, GXV_GLYPHOFFSET_NONE, gxv_kern_subtable_fmt1_entry_validate(), gxv_kern_subtable_fmt1_subtable_setup(), gxv_kern_subtable_fmt1_valueTable_load(), GXV_NAME_ENTER, gxv_StateTable_validate(), GXV_StateTable_ValidatorRec_::optdata, GXV_StateTable_ValidatorRec_::optdata_load_func, GXV_ValidatorRec_::statetable, and GXV_StateTable_ValidatorRec_::subtable_setup_func.

Referenced by gxv_kern_subtable_validate().

static void gxv_kern_subtable_fmt1_valueTable_load | ( | FT_Bytes | table,
|  | FT_Bytes | limit,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 210 of file gxvkern.c.

References FT_NEXT_USHORT, GXV_LIMIT_CHECK, GXV_StateTable_ValidatorRec_::optdata, and GXV_ValidatorRec_::statetable.

Referenced by gxv_kern_subtable_fmt1_validate().

static void gxv_kern_subtable_fmt2_clstbl_validate | ( | FT_Bytes | table,
|  | FT_Bytes | limit,
|  | GXV_kern_ClassSpec | spec,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 375 of file gxvkern.c.

References FT_NEXT_USHORT, gxv_array_getlimits_ushort(), GXV_EXIT, gxv_glyphid_validate(), GXV_KERN_FMT2_DATA, GXV_LIMIT_CHECK, GXV_NAME_ENTER, gxv_odtect_add_range(), and GXV_TRACE.

Referenced by gxv_kern_subtable_fmt2_validate().

static void gxv_kern_subtable_fmt2_validate | ( | FT_Bytes | table,
|  | FT_Bytes | limit,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 411 of file gxvkern.c.

References FT_INVALID_OFFSET, FT_NEXT_USHORT, GXV_EXIT, GXV_KERN_CLS_L, GXV_KERN_CLS_R, GXV_KERN_DATA, GXV_KERN_FMT2_DATA, gxv_kern_subtable_fmt2_clstbl_validate(), GXV_KERN_SUBTABLE_HEADER_SIZE, GXV_LIMIT_CHECK, GXV_NAME_ENTER, GXV_ODTECT, gxv_odtect_add_range(), GXV_ODTECT_INIT, gxv_odtect_validate(), GXV_TRACE, and NULL.

Referenced by gxv_kern_subtable_validate().

static void gxv_kern_subtable_fmt3_validate | ( | FT_Bytes | table,
|  | FT_Bytes | limit,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 469 of file gxvkern.c.

References GXV_ValidatorRec_::face, FT_INVALID_DATA, FT_INVALID_GLYPH_ID, FT_INVALID_OFFSET, FT_NEXT_BYTE, FT_NEXT_USHORT, gxv_array_getlimits_byte(), GXV_EXIT, GXV_KERN_SUBTABLE_HEADER_SIZE, GXV_LIMIT_CHECK, GXV_NAME_ENTER, GXV_SET_ERR_IF_PARANOID, GXV_TRACE, i, j, max, min, FT_FaceRec_::num_glyphs, and GXV_ValidatorRec_::subtable_length.

Referenced by gxv_kern_subtable_validate().

static void gxv_kern_subtable_validate | ( | FT_Bytes | table,
|  | FT_Bytes | limit,
|  | GXV_Validator | valid
| ) |  |

static

Definition at line 742 of file gxvkern.c.

References FT_INVALID_DATA, FT_NEXT_USHORT, GXV_EXIT, gxv_kern_coverage_validate(), gxv_kern_subtable_fmt0_validate(), gxv_kern_subtable_fmt1_validate(), gxv_kern_subtable_fmt2_validate(), gxv_kern_subtable_fmt3_validate(), GXV_LIMIT_CHECK, GXV_NAME_ENTER, GXV_TRACE, KERN_DIALECT_APPLE, KERN_DIALECT_MS, KERN_IS_NEW, GXV_ValidatorRec_::subtable_length, and version.

Referenced by gxv_kern_validate_generic().

gxv_kern_validate | ( | FT_Bytes | table,
|  | FT_Face | face,
|  | FT_Validator | ftvalid
| ) |  |

Definition at line 900 of file gxvkern.c.

References gxv_kern_validate_generic(), and KERN_DIALECT_ANY.

gxv_kern_validate_classic | ( | FT_Bytes | table,
|  | FT_Face | face,
|  | FT_Int | dialect_flags,
|  | FT_Validator | ftvalid
| ) |  |

Definition at line 909 of file gxvkern.c.

References gxv_kern_validate_generic().

Referenced by classic_kern_validate().

static void gxv_kern_validate_generic | ( | FT_Bytes | table,
|  | FT_Face | face,
|  | FT_Bool | classic_only,
|  | GXV_kern_Dialect | dialect_request,
|  | FT_Validator | ftvalid
| ) |  |

static

Definition at line 836 of file gxvkern.c.

References GXV_ValidatorRec_::face, FT_INVALID_FORMAT, FT_NEXT_ULONG, FT_NEXT_USHORT, FT_TRACE3, FT_TRACE4, GXV_INIT, GXV_KERN_DATA, gxv_kern_subtable_validate(), GXV_LIMIT_CHECK, GXV_TRACE, i, KERN_DIALECT, KERN_IS_CLASSIC, KERN_IS_NEW, GXV_ValidatorRec_::root, GXV_ValidatorRec_::subtable_length, GXV_ValidatorRec_::table_data, and version.

Referenced by gxv_kern_validate(), and gxv_kern_validate_classic().