ReactOS  0.4.15-dev-2776-g4130f0b
ftotval.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* ftotval.c */
4 /* */
5 /* FreeType API for validating OpenType tables (body). */
6 /* */
7 /* Copyright 2004-2018 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 /* */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
15 /* */
16 /***************************************************************************/
17 
18 #include <ft2build.h>
19 #include FT_INTERNAL_DEBUG_H
20 
21 #include FT_INTERNAL_OBJECTS_H
22 #include FT_SERVICE_OPENTYPE_VALIDATE_H
23 #include FT_OPENTYPE_VALIDATE_H
24 
25 
26  /* documentation is in ftotval.h */
27 
30  FT_UInt validation_flags,
31  FT_Bytes *BASE_table,
32  FT_Bytes *GDEF_table,
33  FT_Bytes *GPOS_table,
34  FT_Bytes *GSUB_table,
35  FT_Bytes *JSTF_table )
36  {
37  FT_Service_OTvalidate service;
39 
40 
41  if ( !face )
42  {
43  error = FT_THROW( Invalid_Face_Handle );
44  goto Exit;
45  }
46 
47  if ( !( BASE_table &&
48  GDEF_table &&
49  GPOS_table &&
50  GSUB_table &&
51  JSTF_table ) )
52  {
53  error = FT_THROW( Invalid_Argument );
54  goto Exit;
55  }
56 
57  FT_FACE_FIND_GLOBAL_SERVICE( face, service, OPENTYPE_VALIDATE );
58 
59  if ( service )
60  error = service->validate( face,
61  validation_flags,
62  BASE_table,
63  GDEF_table,
64  GPOS_table,
65  GSUB_table,
66  JSTF_table );
67  else
68  error = FT_THROW( Unimplemented_Feature );
69 
70  Exit:
71  return error;
72  }
73 
74 
75  FT_EXPORT_DEF( void )
77  FT_Bytes table )
78  {
80 
81 
82  if ( !face )
83  return;
84 
86 
87  FT_FREE( table );
88  }
89 
90 
91 /* END */
int FT_Error
Definition: fttypes.h:300
FT_OpenType_Free(FT_Face face, FT_Bytes table)
Definition: ftotval.c:76
#define error(str)
Definition: mkdosfs.c:1605
FT_OpenType_Validate(FT_Face face, FT_UInt validation_flags, FT_Bytes *BASE_table, FT_Bytes *GDEF_table, FT_Bytes *GPOS_table, FT_Bytes *GSUB_table, FT_Bytes *JSTF_table)
Definition: ftotval.c:29
#define FT_FACE_FIND_GLOBAL_SERVICE(face, ptr, id)
Definition: ftserv.h:125
static char memory[1024 *256]
Definition: process.c:116
#define FT_THROW(e)
Definition: ftdebug.h:213
#define FT_FREE(ptr)
Definition: ftmemory.h:329
static void Exit(void)
Definition: sock.c:1331
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:636
#define FT_EXPORT_DEF(x)
Definition: ftconfig.h:483
unsigned int FT_UInt
Definition: fttypes.h:231
GLenum GLuint GLint GLenum face
Definition: glext.h:7025