pshpic.c

Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  pshpic.c                                                               */
00004 /*                                                                         */
00005 /*    The FreeType position independent code services for pshinter module. */
00006 /*                                                                         */
00007 /*  Copyright 2009 by                                                      */
00008 /*  Oran Agra and Mickey Gabel.                                            */
00009 /*                                                                         */
00010 /*  This file is part of the FreeType project, and may only be used,       */
00011 /*  modified, and distributed under the terms of the FreeType project      */
00012 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
00013 /*  this file you indicate that you have read the license and              */
00014 /*  understand and accept it fully.                                        */
00015 /*                                                                         */
00016 /***************************************************************************/
00017 
00018 
00019 #include <ft2build.h>
00020 #include FT_FREETYPE_H
00021 #include FT_INTERNAL_OBJECTS_H
00022 #include "pshpic.h"
00023 
00024 #ifdef FT_CONFIG_OPTION_PIC
00025 
00026   /* forward declaration of PIC init functions from pshmod.c */
00027   void FT_Init_Class_pshinter_interface( FT_Library, PSHinter_Interface*);
00028 
00029   void
00030   pshinter_module_class_pic_free( FT_Library library )
00031   {
00032     FT_PIC_Container* pic_container = &library->pic_container;
00033     FT_Memory memory = library->memory;
00034     if ( pic_container->pshinter )
00035     {
00036       FT_FREE( pic_container->pshinter );
00037       pic_container->pshinter = NULL;
00038     }
00039   }
00040 
00041   FT_Error
00042   pshinter_module_class_pic_init( FT_Library library )
00043   {
00044     FT_PIC_Container* pic_container = &library->pic_container;
00045     FT_Error        error = FT_Err_Ok;
00046     PSHinterPIC*  container;
00047     FT_Memory memory = library->memory;
00048 
00049     /* allocate pointer, clear and set global container pointer */
00050     if ( FT_ALLOC ( container, sizeof ( *container ) ) )
00051       return error;
00052     FT_MEM_SET( container, 0, sizeof(*container) );
00053     pic_container->pshinter = container;
00054     
00055     /* add call to initialization function when you add new scripts */
00056     FT_Init_Class_pshinter_interface(library, &container->pshinter_interface);
00057 
00058 /*Exit:*/
00059     if(error)
00060       pshinter_module_class_pic_free(library);
00061     return error;
00062   }
00063 
00064 
00065 #endif /* FT_CONFIG_OPTION_PIC */
00066 
00067 /* END */

Generated on Tue Jul 5 14:13:50 2011 for ROOT_528-00b_version by  doxygen 1.5.1