ReactOS 0.4.16-dev-297-gc569aee
gxvmod.c File Reference
#include <ft2build.h>
#include "gxvmod.h"
#include "gxvalid.h"
#include "gxvcommn.h"
Include dependency graph for gxvmod.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FT_COMPONENT   trace_gxvmodule
 
#define GXV_TABLE_DECL(_sfnt)
 
#define GXV_TABLE_LOAD(_sfnt)
 
#define GXV_TABLE_VALIDATE(_sfnt)
 
#define GXV_TABLE_SET(_sfnt)
 

Functions

static FT_Error gxv_load_table (FT_Face face, FT_Tag tag, FT_Byte *volatile *table, FT_ULong *table_len)
 
static FT_Error gxv_validate (FT_Face face, FT_UInt gx_flags, FT_Bytes tables[FT_VALIDATE_GX_LENGTH], FT_UInt table_count)
 
static FT_Error classic_kern_validate (FT_Face face, FT_UInt ckern_flags, FT_Bytes *ckern_table)
 
static FT_Pointer gxvalid_get_service (FT_Module module, const char *service_id)
 

Variables

static const FT_Service_GXvalidateRec gxvalid_interface
 
static const FT_Service_CKERNvalidateRec ckernvalid_interface
 
static const FT_ServiceDescRec gxvalid_services []
 
FT_CALLBACK_TABLE_DEF const FT_Module_Class gxv_module_class
 

Macro Definition Documentation

◆ FT_COMPONENT

#define FT_COMPONENT   trace_gxvmodule

Definition at line 47 of file gxvmod.c.

◆ GXV_TABLE_DECL

#define GXV_TABLE_DECL (   _sfnt)
Value:
FT_Byte* volatile _sfnt = NULL; \
FT_ULong len_ ## _sfnt = 0
#define NULL
Definition: types.h:112
unsigned long FT_ULong
Definition: fttypes.h:253
unsigned char FT_Byte
Definition: fttypes.h:154

Definition at line 76 of file gxvmod.c.

◆ GXV_TABLE_LOAD

#define GXV_TABLE_LOAD (   _sfnt)
Value:
if ( ( FT_VALIDATE_ ## _sfnt ## _INDEX < table_count ) && \
( gx_flags & FT_VALIDATE_ ## _sfnt ) ) \
{ \
error = gxv_load_table( face, TTAG_ ## _sfnt, \
&_sfnt, &len_ ## _sfnt ); \
if ( error ) \
goto Exit; \
}
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
static FT_Error gxv_load_table(FT_Face face, FT_Tag tag, FT_Byte *volatile *table, FT_ULong *table_len)
Definition: gxvmod.c:51
#define error(str)
Definition: mkdosfs.c:1605
static void Exit(void)
Definition: sock.c:1330

Definition at line 80 of file gxvmod.c.

◆ GXV_TABLE_SET

#define GXV_TABLE_SET (   _sfnt)
Value:
if ( FT_VALIDATE_ ## _sfnt ## _INDEX < table_count ) \
tables[FT_VALIDATE_ ## _sfnt ## _INDEX] = (FT_Bytes)_sfnt
struct nls_table * tables
Definition: nls_base.c:22
const FT_Byte * FT_Bytes
Definition: fttypes.h:165

Definition at line 102 of file gxvmod.c.

◆ GXV_TABLE_VALIDATE

#define GXV_TABLE_VALIDATE (   _sfnt)
Value:
if ( _sfnt ) \
{ \
ft_validator_init( &valid, _sfnt, _sfnt + len_ ## _sfnt, \
if ( ft_setjmp( valid.jump_buffer ) == 0 ) \
gxv_ ## _sfnt ## _validate( _sfnt, face, &valid ); \
error = valid.error; \
if ( error ) \
goto Exit; \
}
#define ft_setjmp(b)
Definition: ftstdlib.h:163
@ FT_VALIDATE_DEFAULT
Definition: ftvalid.h:72
BOOLEAN valid

Definition at line 90 of file gxvmod.c.

Function Documentation

◆ classic_kern_validate()

static FT_Error classic_kern_validate ( FT_Face  face,
FT_UInt  ckern_flags,
FT_Bytes ckern_table 
)
static

Definition at line 191 of file gxvmod.c.

194 {
195 FT_Memory volatile memory = FT_FACE_MEMORY( face );
196
197 FT_Byte* volatile ckern = NULL;
198 FT_ULong len_ckern = 0;
199
200 /* without volatile on `error' GCC 4.1.1. emits: */
201 /* warning: variable 'error' might be clobbered by 'longjmp' or 'vfork' */
202 /* this warning seems spurious but --- */
203 FT_Error volatile error;
204 FT_ValidatorRec volatile valid;
205
206
207 *ckern_table = NULL;
208
209 error = gxv_load_table( face, TTAG_kern, &ckern, &len_ckern );
210 if ( error )
211 goto Exit;
212
213 if ( ckern )
214 {
215 ft_validator_init( &valid, ckern, ckern + len_ckern,
217 if ( ft_setjmp( valid.jump_buffer ) == 0 )
219 ckern_flags & FT_VALIDATE_CKERN, &valid );
220 error = valid.error;
221 if ( error )
222 goto Exit;
223 }
224
225 *ckern_table = ckern;
226
227 Exit:
228 if ( error )
229 FT_FREE( ckern );
230
231 return error;
232 }
#define FT_VALIDATE_CKERN
Definition: ftgxval.h:281
#define FT_FREE(ptr)
Definition: ftmemory.h:329
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
int FT_Error
Definition: fttypes.h:300
ft_validator_init(FT_Validator valid, const FT_Byte *base, const FT_Byte *limit, FT_ValidationLevel level)
Definition: ftobjs.c:122
gxv_kern_validate_classic(FT_Bytes table, FT_Face face, FT_Int dialect_flags, FT_Validator valid)
Definition: gxvkern.c:907
static char memory[1024 *256]
Definition: process.c:116
#define TTAG_kern
Definition: tttags.h:72

◆ gxv_load_table()

static FT_Error gxv_load_table ( FT_Face  face,
FT_Tag  tag,
FT_Byte *volatile table,
FT_ULong table_len 
)
static

Definition at line 51 of file gxvmod.c.

55 {
58
59
60 error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len );
61 if ( FT_ERR_EQ( error, Table_Missing ) )
62 return FT_Err_Ok;
63 if ( error )
64 goto Exit;
65
66 if ( FT_ALLOC( *table, *table_len ) )
67 goto Exit;
68
69 error = FT_Load_Sfnt_Table( face, tag, 0, *table, table_len );
70
71 Exit:
72 return error;
73 }
return FT_Err_Ok
Definition: ftbbox.c:511
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:303
#define FT_ERR_EQ(x, e)
Definition: fttypes.h:591
Definition: ecma_167.h:138
FT_Load_Sfnt_Table(FT_Face face, FT_ULong tag, FT_Long offset, FT_Byte *buffer, FT_ULong *length)
Definition: ftobjs.c:4134

Referenced by classic_kern_validate().

◆ gxv_validate()

static FT_Error gxv_validate ( FT_Face  face,
FT_UInt  gx_flags,
FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],
FT_UInt  table_count 
)
static

Definition at line 108 of file gxvmod.c.

112 {
113 FT_Memory volatile memory = FT_FACE_MEMORY( face );
114
116 FT_ValidatorRec volatile valid;
117
118 FT_UInt i;
119
120
121 GXV_TABLE_DECL( feat );
122 GXV_TABLE_DECL( bsln );
123 GXV_TABLE_DECL( trak );
124 GXV_TABLE_DECL( just );
125 GXV_TABLE_DECL( mort );
126 GXV_TABLE_DECL( morx );
127 GXV_TABLE_DECL( kern );
128 GXV_TABLE_DECL( opbd );
129 GXV_TABLE_DECL( prop );
130 GXV_TABLE_DECL( lcar );
131
132 for ( i = 0; i < table_count; i++ )
133 tables[i] = 0;
134
135 /* load tables */
136 GXV_TABLE_LOAD( feat );
137 GXV_TABLE_LOAD( bsln );
138 GXV_TABLE_LOAD( trak );
139 GXV_TABLE_LOAD( just );
140 GXV_TABLE_LOAD( mort );
141 GXV_TABLE_LOAD( morx );
142 GXV_TABLE_LOAD( kern );
143 GXV_TABLE_LOAD( opbd );
144 GXV_TABLE_LOAD( prop );
145 GXV_TABLE_LOAD( lcar );
146
147 /* validate tables */
148 GXV_TABLE_VALIDATE( feat );
149 GXV_TABLE_VALIDATE( bsln );
150 GXV_TABLE_VALIDATE( trak );
151 GXV_TABLE_VALIDATE( just );
152 GXV_TABLE_VALIDATE( mort );
153 GXV_TABLE_VALIDATE( morx );
154 GXV_TABLE_VALIDATE( kern );
155 GXV_TABLE_VALIDATE( opbd );
156 GXV_TABLE_VALIDATE( prop );
157 GXV_TABLE_VALIDATE( lcar );
158
159 /* Set results */
160 GXV_TABLE_SET( feat );
161 GXV_TABLE_SET( mort );
162 GXV_TABLE_SET( morx );
163 GXV_TABLE_SET( bsln );
164 GXV_TABLE_SET( just );
165 GXV_TABLE_SET( kern );
166 GXV_TABLE_SET( opbd );
167 GXV_TABLE_SET( trak );
168 GXV_TABLE_SET( prop );
169 GXV_TABLE_SET( lcar );
170
171 Exit:
172 if ( error )
173 {
174 FT_FREE( feat );
175 FT_FREE( bsln );
176 FT_FREE( trak );
177 FT_FREE( just );
178 FT_FREE( mort );
179 FT_FREE( morx );
180 FT_FREE( kern );
181 FT_FREE( opbd );
182 FT_FREE( prop );
183 FT_FREE( lcar );
184 }
185
186 return error;
187 }
unsigned int FT_UInt
Definition: fttypes.h:231
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define GXV_TABLE_LOAD(_sfnt)
Definition: gxvmod.c:80
#define GXV_TABLE_SET(_sfnt)
Definition: gxvmod.c:102
#define GXV_TABLE_DECL(_sfnt)
Definition: gxvmod.c:76
#define GXV_TABLE_VALIDATE(_sfnt)
Definition: gxvmod.c:90

◆ gxvalid_get_service()

static FT_Pointer gxvalid_get_service ( FT_Module  module,
const char service_id 
)
static

Definition at line 259 of file gxvmod.c.

261 {
262 FT_UNUSED( module );
263
264 return ft_service_list_lookup( gxvalid_services, service_id );
265 }
#define FT_UNUSED(arg)
Definition: ftconfig.h:101
ft_service_list_lookup(FT_ServiceDesc service_descriptors, const char *service_id)
Definition: ftobjs.c:98
static const FT_ServiceDescRec gxvalid_services[]
Definition: gxvmod.c:250

Variable Documentation

◆ ckernvalid_interface

const FT_Service_CKERNvalidateRec ckernvalid_interface
static
Initial value:
=
{
}
static FT_Error classic_kern_validate(FT_Face face, FT_UInt ckern_flags, FT_Bytes *ckern_table)
Definition: gxvmod.c:191

Definition at line 243 of file gxvmod.c.

◆ gxv_module_class

Initial value:
=
{
0,
sizeof ( FT_ModuleRec ),
"gxvalid",
0x10000L,
0x20000L,
NULL,
}
void(* FT_Module_Destructor)(FT_Module module)
Definition: ftmodapi.h:167
FT_Error(* FT_Module_Constructor)(FT_Module module)
Definition: ftmodapi.h:152
FT_Module_Interface(* FT_Module_Requester)(FT_Module module, const char *name)
Definition: ftmodapi.h:184
struct FT_ModuleRec_ FT_ModuleRec
static FT_Pointer gxvalid_get_service(FT_Module module, const char *service_id)
Definition: gxvmod.c:259

Definition at line 269 of file gxvmod.c.

◆ gxvalid_interface

const FT_Service_GXvalidateRec gxvalid_interface
static
Initial value:
=
{
}
static FT_Error gxv_validate(FT_Face face, FT_UInt gx_flags, FT_Bytes tables[FT_VALIDATE_GX_LENGTH], FT_UInt table_count)
Definition: gxvmod.c:108

Definition at line 236 of file gxvmod.c.

◆ gxvalid_services

const FT_ServiceDescRec gxvalid_services[]
static
Initial value:
=
{
{ NULL, NULL }
}
static const FT_Service_GXvalidateRec gxvalid_interface
Definition: gxvmod.c:236
static const FT_Service_CKERNvalidateRec ckernvalid_interface
Definition: gxvmod.c:243
#define FT_SERVICE_ID_CLASSICKERN_VALIDATE
Definition: svgxval.h:38
#define FT_SERVICE_ID_GX_VALIDATE
Definition: svgxval.h:37

Definition at line 250 of file gxvmod.c.

Referenced by gxvalid_get_service().