Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / modules / freetype2 / src / base / ftotval.c
blobb6de6db85d13042da6f56274f379e5144c8cc54f
1 /***************************************************************************/
2 /* */
3 /* ftotval.c */
4 /* */
5 /* FreeType API for validating OpenType tables (body). */
6 /* */
7 /* Copyright 2004, 2006 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 /***************************************************************************/
18 #include <ft2build.h>
19 #include FT_INTERNAL_OBJECTS_H
20 #include FT_SERVICE_OPENTYPE_VALIDATE_H
23 /* documentation is in ftotval.h */
25 FT_EXPORT_DEF( FT_Error )
26 FT_OpenType_Validate( FT_Face face,
27 FT_UInt validation_flags,
28 FT_Bytes *BASE_table,
29 FT_Bytes *GDEF_table,
30 FT_Bytes *GPOS_table,
31 FT_Bytes *GSUB_table,
32 FT_Bytes *JSTF_table )
34 FT_Service_OTvalidate service;
35 FT_Error error;
38 if ( !face )
40 error = FT_Err_Invalid_Face_Handle;
41 goto Exit;
44 if ( !( BASE_table &&
45 GDEF_table &&
46 GPOS_table &&
47 GSUB_table &&
48 JSTF_table ) )
50 error = FT_Err_Invalid_Argument;
51 goto Exit;
54 FT_FACE_FIND_GLOBAL_SERVICE( face, service, OPENTYPE_VALIDATE );
56 if ( service )
57 error = service->validate( face,
58 validation_flags,
59 BASE_table,
60 GDEF_table,
61 GPOS_table,
62 GSUB_table,
63 JSTF_table );
64 else
65 error = FT_Err_Unimplemented_Feature;
67 Exit:
68 return error;
72 FT_EXPORT_DEF( void )
73 FT_OpenType_Free( FT_Face face,
74 FT_Bytes table )
76 FT_Memory memory = FT_FACE_MEMORY( face );
79 FT_FREE( table );
83 /* END */