Suggestion from "mgh".
[open-ps2-loader.git] / thirdparty / freetype-2.3.12 / src / pshinter / pshpic.c
blob51a08798883b4351bb28d7c05a2999b423c4f6a7
1 /***************************************************************************/
2 /* */
3 /* pshpic.c */
4 /* */
5 /* The FreeType position independent code services for pshinter module. */
6 /* */
7 /* Copyright 2009 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 /***************************************************************************/
19 #include <ft2build.h>
20 #include FT_FREETYPE_H
21 #include FT_INTERNAL_OBJECTS_H
22 #include "pshpic.h"
24 #ifdef FT_CONFIG_OPTION_PIC
26 /* forward declaration of PIC init functions from pshmod.c */
27 void FT_Init_Class_pshinter_interface( FT_Library, PSHinter_Interface*);
29 void
30 pshinter_module_class_pic_free( FT_Library library )
32 FT_PIC_Container* pic_container = &library->pic_container;
33 FT_Memory memory = library->memory;
34 if ( pic_container->pshinter )
36 FT_FREE( pic_container->pshinter );
37 pic_container->pshinter = NULL;
41 FT_Error
42 pshinter_module_class_pic_init( FT_Library library )
44 FT_PIC_Container* pic_container = &library->pic_container;
45 FT_Error error = FT_Err_Ok;
46 PSHinterPIC* container;
47 FT_Memory memory = library->memory;
49 /* allocate pointer, clear and set global container pointer */
50 if ( FT_ALLOC ( container, sizeof ( *container ) ) )
51 return error;
52 FT_MEM_SET( container, 0, sizeof(*container) );
53 pic_container->pshinter = container;
55 /* add call to initialization function when you add new scripts */
56 FT_Init_Class_pshinter_interface(library, &container->pshinter_interface);
58 /*Exit:*/
59 if(error)
60 pshinter_module_class_pic_free(library);
61 return error;
65 #endif /* FT_CONFIG_OPTION_PIC */
67 /* END */