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

Go to the source code of this file.

Classes

struct  GXV_bsln_DataRec_
 

Macros

#define FT_COMPONENT   trace_gxvbsln
 
#define GXV_BSLN_VALUE_COUNT   32
 
#define GXV_BSLN_VALUE_EMPTY   0xFFFFU
 
#define GXV_BSLN_DATA(field)   GXV_TABLE_DATA( bsln, field )
 

Typedefs

typedef struct GXV_bsln_DataRec_ GXV_bsln_DataRec
 
typedef struct GXV_bsln_DataRec_GXV_bsln_Data
 

Functions

static void gxv_bsln_LookupValue_validate (FT_UShort glyph, GXV_LookupValueCPtr value_p, GXV_Validator gxvalid)
 
static GXV_LookupValueDesc gxv_bsln_LookupFmt4_transit (FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, GXV_Validator gxvalid)
 
static void gxv_bsln_parts_fmt0_validate (FT_Bytes tables, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_bsln_parts_fmt1_validate (FT_Bytes tables, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_bsln_parts_fmt2_validate (FT_Bytes tables, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_bsln_parts_fmt3_validate (FT_Bytes tables, FT_Bytes limit, GXV_Validator gxvalid)
 
 gxv_bsln_validate (FT_Bytes table, FT_Face face, FT_Validator ftvalid)
 

Macro Definition Documentation

◆ FT_COMPONENT

#define FT_COMPONENT   trace_gxvbsln

Definition at line 39 of file gxvbsln.c.

◆ GXV_BSLN_DATA

#define GXV_BSLN_DATA (   field)    GXV_TABLE_DATA( bsln, field )

Definition at line 62 of file gxvbsln.c.

◆ GXV_BSLN_VALUE_COUNT

#define GXV_BSLN_VALUE_COUNT   32

Definition at line 50 of file gxvbsln.c.

◆ GXV_BSLN_VALUE_EMPTY

#define GXV_BSLN_VALUE_EMPTY   0xFFFFU

Definition at line 51 of file gxvbsln.c.

Typedef Documentation

◆ GXV_bsln_Data

◆ GXV_bsln_DataRec

Function Documentation

◆ gxv_bsln_LookupFmt4_transit()

static GXV_LookupValueDesc gxv_bsln_LookupFmt4_transit ( FT_UShort  relative_gindex,
GXV_LookupValueCPtr  base_value_p,
FT_Bytes  lookuptbl_limit,
GXV_Validator  gxvalid 
)
static

Definition at line 125 of file gxvbsln.c.

129 {
130 FT_Bytes p;
134
135 /* XXX: check range ? */
136 offset = (FT_UShort)( base_value_p->u +
137 ( relative_gindex * sizeof ( FT_UShort ) ) );
138
139 p = gxvalid->lookuptbl_head + offset;
140 limit = lookuptbl_limit;
141 GXV_LIMIT_CHECK( 2 );
142
143 value.u = FT_NEXT_USHORT( p );
144
145 return value;
146 }
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned short FT_UShort
Definition: fttypes.h:209
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
GLint limit
Definition: glext.h:10326
GLfloat GLfloat p
Definition: glext.h:8902
GLintptr offset
Definition: glext.h:5920
#define GXV_LIMIT_CHECK(_count)
Definition: gxvcommn.h:272
FT_Bytes lookuptbl_head
Definition: gxvcommn.h:249
Definition: pdh_main.c:94
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by gxv_bsln_parts_fmt1_validate(), and gxv_bsln_parts_fmt3_validate().

◆ gxv_bsln_LookupValue_validate()

static void gxv_bsln_LookupValue_validate ( FT_UShort  glyph,
GXV_LookupValueCPtr  value_p,
GXV_Validator  gxvalid 
)
static

Definition at line 74 of file gxvbsln.c.

77 {
78 FT_UShort v = value_p->u;
79 FT_UShort* ctlPoints;
80
81 FT_UNUSED( glyph );
82
83
84 GXV_NAME_ENTER( "lookup value" );
85
86 if ( v >= GXV_BSLN_VALUE_COUNT )
88
89 ctlPoints = (FT_UShort*)GXV_BSLN_DATA( ctlPoints_p );
90 if ( ctlPoints && ctlPoints[v] == GXV_BSLN_VALUE_EMPTY )
92
94 }
#define FT_UNUSED(arg)
Definition: ftconfig.h:101
#define FT_INVALID_DATA
Definition: ftvalid.h:150
const GLdouble * v
Definition: gl.h:2040
#define GXV_BSLN_VALUE_EMPTY
Definition: gxvbsln.c:51
#define GXV_BSLN_DATA(field)
Definition: gxvbsln.c:62
#define GXV_BSLN_VALUE_COUNT
Definition: gxvbsln.c:50
#define GXV_NAME_ENTER(name)
Definition: gxvcommn.h:301
#define GXV_EXIT
Definition: gxvcommn.h:302

Referenced by gxv_bsln_parts_fmt1_validate(), and gxv_bsln_parts_fmt3_validate().

◆ gxv_bsln_parts_fmt0_validate()

static void gxv_bsln_parts_fmt0_validate ( FT_Bytes  tables,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 150 of file gxvbsln.c.

153 {
154 FT_Bytes p = tables;
155
156
157 GXV_NAME_ENTER( "parts format 0" );
158
159 /* deltas */
161
162 gxvalid->table_data = NULL; /* No ctlPoints here. */
163
164 GXV_EXIT;
165 }
#define NULL
Definition: types.h:112
struct nls_table * tables
Definition: nls_base.c:22
void * table_data
Definition: gxvcommn.h:242

Referenced by gxv_bsln_parts_fmt1_validate(), and gxv_bsln_validate().

◆ gxv_bsln_parts_fmt1_validate()

static void gxv_bsln_parts_fmt1_validate ( FT_Bytes  tables,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 169 of file gxvbsln.c.

172 {
173 FT_Bytes p = tables;
174
175
176 GXV_NAME_ENTER( "parts format 1" );
177
178 /* deltas */
180
181 /* mappingData */
186 limit,
187 gxvalid );
188
189 GXV_EXIT;
190 }
static GXV_LookupValueDesc gxv_bsln_LookupFmt4_transit(FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, GXV_Validator gxvalid)
Definition: gxvbsln.c:125
static void gxv_bsln_parts_fmt0_validate(FT_Bytes tables, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvbsln.c:150
static void gxv_bsln_LookupValue_validate(FT_UShort glyph, GXV_LookupValueCPtr value_p, GXV_Validator gxvalid)
Definition: gxvbsln.c:74
gxv_LookupTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvcommn.c:755
@ GXV_LOOKUPVALUE_UNSIGNED
Definition: gxvcommn.h:100
GXV_Lookup_Fmt4_Transit_Func lookupfmt4_trans
Definition: gxvcommn.h:248
GXV_Lookup_Value_Validate_Func lookupval_func
Definition: gxvcommn.h:247
GXV_LookupValue_SignSpec lookupval_sign
Definition: gxvcommn.h:246

Referenced by gxv_bsln_validate().

◆ gxv_bsln_parts_fmt2_validate()

static void gxv_bsln_parts_fmt2_validate ( FT_Bytes  tables,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 194 of file gxvbsln.c.

197 {
198 FT_Bytes p = tables;
199
200 FT_UShort stdGlyph;
201 FT_UShort ctlPoint;
202 FT_Int i;
203
204 FT_UShort defaultBaseline = GXV_BSLN_DATA( defaultBaseline );
205
206
207 GXV_NAME_ENTER( "parts format 2" );
208
210
211 /* stdGlyph */
212 stdGlyph = FT_NEXT_USHORT( p );
213 GXV_TRACE(( " (stdGlyph = %u)\n", stdGlyph ));
214
215 gxv_glyphid_validate( stdGlyph, gxvalid );
216
217 /* Record the position of ctlPoints */
218 GXV_BSLN_DATA( ctlPoints_p ) = p;
219
220 /* ctlPoints */
221 for ( i = 0; i < GXV_BSLN_VALUE_COUNT; i++ )
222 {
223 ctlPoint = FT_NEXT_USHORT( p );
224 if ( ctlPoint == GXV_BSLN_VALUE_EMPTY )
225 {
226 if ( i == defaultBaseline )
228 }
229 else
230 gxv_ctlPoint_validate( stdGlyph, ctlPoint, gxvalid );
231 }
232
233 GXV_EXIT;
234 }
signed int FT_Int
Definition: fttypes.h:220
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
gxv_ctlPoint_validate(FT_UShort gid, FT_UShort ctl_point, GXV_Validator gxvalid)
Definition: gxvcommn.c:846
gxv_glyphid_validate(FT_UShort gid, GXV_Validator gxvalid)
Definition: gxvcommn.c:813
#define GXV_TRACE(s)
Definition: gxvcommn.h:304

Referenced by gxv_bsln_parts_fmt3_validate(), and gxv_bsln_validate().

◆ gxv_bsln_parts_fmt3_validate()

static void gxv_bsln_parts_fmt3_validate ( FT_Bytes  tables,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 238 of file gxvbsln.c.

241 {
242 FT_Bytes p = tables;
243
244
245 GXV_NAME_ENTER( "parts format 3" );
246
247 /* stdGlyph + ctlPoints */
249
250 /* mappingData */
255 limit,
256 gxvalid );
257
258 GXV_EXIT;
259 }
static void gxv_bsln_parts_fmt2_validate(FT_Bytes tables, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvbsln.c:194

Referenced by gxv_bsln_validate().

◆ gxv_bsln_validate()

gxv_bsln_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  ftvalid 
)

Definition at line 271 of file gxvbsln.c.

274 {
275 GXV_ValidatorRec gxvalidrec;
276 GXV_Validator gxvalid = &gxvalidrec;
277
278 GXV_bsln_DataRec bslnrec;
279 GXV_bsln_Data bsln = &bslnrec;
280
281 FT_Bytes p = table;
282 FT_Bytes limit = 0;
283
286 FT_UShort defaultBaseline;
287
288 GXV_Validate_Func fmt_funcs_table [] =
289 {
294 };
295
296
297 gxvalid->root = ftvalid;
298 gxvalid->table_data = bsln;
299 gxvalid->face = face;
300
301 FT_TRACE3(( "validating `bsln' table\n" ));
302 GXV_INIT;
303
304
305 GXV_LIMIT_CHECK( 4 + 2 + 2 );
308 defaultBaseline = FT_NEXT_USHORT( p );
309
310 /* only version 1.0 is defined (1996) */
311 if ( version != 0x00010000UL )
313
314 /* only format 1, 2, 3 are defined (1996) */
315 GXV_TRACE(( " (format = %d)\n", format ));
316 if ( format > 3 )
318
319 if ( defaultBaseline > 31 )
321
322 bsln->defaultBaseline = defaultBaseline;
323
324 fmt_funcs_table[format]( p, limit, gxvalid );
325
326 FT_TRACE4(( "\n" ));
327 }
WORD face[3]
Definition: mesh.c:4747
static const WCHAR version[]
Definition: asmname.c:66
#define FT_TRACE3(varformat)
Definition: ftdebug.h:160
#define FT_TRACE4(varformat)
Definition: ftdebug.h:161
#define FT_NEXT_ULONG(buffer)
Definition: ftstream.h:238
unsigned long FT_ULong
Definition: fttypes.h:253
#define FT_INVALID_FORMAT
Definition: ftvalid.h:142
static void gxv_bsln_parts_fmt1_validate(FT_Bytes tables, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvbsln.c:169
static void gxv_bsln_parts_fmt3_validate(FT_Bytes tables, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvbsln.c:238
void(* GXV_Validate_Func)(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvcommn.h:82
#define GXV_INIT
Definition: gxvcommn.h:300
FT_Validator root
Definition: gxvcommn.h:239
FT_UShort defaultBaseline
Definition: gxvbsln.c:57
Definition: format.c:58