ReactOS 0.4.15-dev-7918-g2a2556c
pshpic.c
Go to the documentation of this file.
1/***************************************************************************/
2/* */
3/* pshpic.c */
4/* */
5/* The FreeType position independent code services for pshinter module. */
6/* */
7/* Copyright 2009-2018 by */
8/* Oran Agra and Mickey Gabel. */
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
19#include <ft2build.h>
20#include FT_FREETYPE_H
21#include FT_INTERNAL_OBJECTS_H
22#include "pshpic.h"
23#include "pshnterr.h"
24
25
26#ifdef FT_CONFIG_OPTION_PIC
27
28 /* forward declaration of PIC init functions from pshmod.c */
29 void
30 FT_Init_Class_pshinter_interface( FT_Library library,
31 PSHinter_Interface* clazz );
32
33 void
34 pshinter_module_class_pic_free( FT_Library library )
35 {
36 FT_PIC_Container* pic_container = &library->pic_container;
38
39
40 if ( pic_container->pshinter )
41 {
42 FT_FREE( pic_container->pshinter );
43 pic_container->pshinter = NULL;
44 }
45 }
46
47
49 pshinter_module_class_pic_init( FT_Library library )
50 {
51 FT_PIC_Container* pic_container = &library->pic_container;
53 PSHinterPIC* container = NULL;
55
56
57 /* allocate pointer, clear and set global container pointer */
58 if ( FT_ALLOC( container, sizeof ( *container ) ) )
59 return error;
60 FT_MEM_SET( container, 0, sizeof ( *container ) );
61 pic_container->pshinter = container;
62
63 /* add call to initialization function when you add new scripts */
64 FT_Init_Class_pshinter_interface(
65 library, &container->pshinter_interface );
66
67 if ( error )
68 pshinter_module_class_pic_free( library );
69
70 return error;
71 }
72
73#endif /* FT_CONFIG_OPTION_PIC */
74
75
76/* END */
FT_Library library
Definition: cffdrivr.c:654
#define NULL
Definition: types.h:112
return FT_Err_Ok
Definition: ftbbox.c:511
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:303
#define FT_FREE(ptr)
Definition: ftmemory.h:329
#define FT_MEM_SET(dest, byte, count)
Definition: ftmemory.h:225
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
int FT_Error
Definition: fttypes.h:300
#define error(str)
Definition: mkdosfs.c:1605
static char memory[1024 *256]
Definition: process.c:116
FT_Memory memory
Definition: ftobjs.h:918