/src/compiler/android-ndk/jni/freetype/src/pshinter/pshpic.c

http://ftk.googlecode.com/ · C · 67 lines · 34 code · 12 blank · 21 comment · 3 complexity · 04e98a40fa0de3bce8fff3972a0e4ea8 MD5 · raw file

  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. /***************************************************************************/
  17. #include <ft2build.h>
  18. #include FT_FREETYPE_H
  19. #include FT_INTERNAL_OBJECTS_H
  20. #include "pshpic.h"
  21. #ifdef FT_CONFIG_OPTION_PIC
  22. /* forward declaration of PIC init functions from pshmod.c */
  23. void FT_Init_Class_pshinter_interface( FT_Library, PSHinter_Interface*);
  24. void
  25. pshinter_module_class_pic_free( FT_Library library )
  26. {
  27. FT_PIC_Container* pic_container = &library->pic_container;
  28. FT_Memory memory = library->memory;
  29. if ( pic_container->pshinter )
  30. {
  31. FT_FREE( pic_container->pshinter );
  32. pic_container->pshinter = NULL;
  33. }
  34. }
  35. FT_Error
  36. pshinter_module_class_pic_init( FT_Library library )
  37. {
  38. FT_PIC_Container* pic_container = &library->pic_container;
  39. FT_Error error = FT_Err_Ok;
  40. PSHinterPIC* container;
  41. FT_Memory memory = library->memory;
  42. /* allocate pointer, clear and set global container pointer */
  43. if ( FT_ALLOC ( container, sizeof ( *container ) ) )
  44. return error;
  45. FT_MEM_SET( container, 0, sizeof(*container) );
  46. pic_container->pshinter = container;
  47. /* add call to initialization function when you add new scripts */
  48. FT_Init_Class_pshinter_interface(library, &container->pshinter_interface);
  49. /*Exit:*/
  50. if(error)
  51. pshinter_module_class_pic_free(library);
  52. return error;
  53. }
  54. #endif /* FT_CONFIG_OPTION_PIC */
  55. /* END */