1 /***************************************************************************/
5 /* The FreeType position independent code services for pshinter module. */
7 /* Copyright 2009, 2010 by */
8 /* Oran Agra and Mickey Gabel. */
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. */
16 /***************************************************************************/
20 #include FT_FREETYPE_H
21 #include FT_INTERNAL_OBJECTS_H
25 #ifdef FT_CONFIG_OPTION_PIC
27 /* forward declaration of PIC init functions from pshmod.c */
29 FT_Init_Class_pshinter_interface( FT_Library library,
30 PSHinter_Interface* clazz );
33 pshinter_module_class_pic_free( FT_Library library )
35 FT_PIC_Container* pic_container = &library->pic_container;
36 FT_Memory memory = library->memory;
39 if ( pic_container->pshinter )
41 FT_FREE( pic_container->pshinter );
42 pic_container->pshinter = NULL;
48 pshinter_module_class_pic_init( FT_Library library )
50 FT_PIC_Container* pic_container = &library->pic_container;
51 FT_Error error = PSH_Err_Ok;
52 PSHinterPIC* container;
53 FT_Memory memory = library->memory;
56 /* allocate pointer, clear and set global container pointer */
57 if ( FT_ALLOC ( container, sizeof ( *container ) ) )
59 FT_MEM_SET( container, 0, sizeof ( *container ) );
60 pic_container->pshinter = container;
62 /* add call to initialization function when you add new scripts */
63 FT_Init_Class_pshinter_interface(
64 library, &container->pshinter_interface );
68 pshinter_module_class_pic_free( library );
73 #endif /* FT_CONFIG_OPTION_PIC */