From d9bf44a430339bc40285eb96b0b700eb4ce9d6c3 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 27 Aug 2012 08:41:43 +0200 Subject: [PATCH] [autofit, cff, pshinter, psnames] More renamings for orthogonality. * src/autofit/afmodule.c, src/autofit/afpic.h: s/AF_AUTOFITTER_/AF_/. * src/cff/cffdrivr.c, src/cff/cffobjs.c, src/cff/cffparse.c, src/cff/cffpic.h: s/FT_CFF_/CFF_/. * src/pshinter/pshmod.c, src/pshinter/pshpic.h: s/FT_PSHINTER_/PSHINTER_/. * src/psnames/psmodule.c, src/psnames/pspic.h: s/FT_PSCMAPS/PSCMAPS_/. --- ChangeLog | 16 +++++++++ src/autofit/afmodule.c | 2 +- src/autofit/afpic.h | 12 +++---- src/cff/cffdrivr.c | 26 +++++++-------- src/cff/cffobjs.c | 8 ++--- src/cff/cffparse.c | 2 +- src/cff/cffpic.h | 76 +++++++++++++++++++++++++----------------- src/pshinter/pshmod.c | 2 +- src/pshinter/pshpic.h | 4 +-- src/psnames/psmodule.c | 8 ++--- src/psnames/pspic.h | 8 ++--- 11 files changed, 98 insertions(+), 66 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7931c1a5e..64ab2ca72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2012-08-27 Werner Lemberg + + [autofit, cff, pshinter, psnames] More renamings for orthogonality. + + * src/autofit/afmodule.c, src/autofit/afpic.h: + s/AF_AUTOFITTER_/AF_/. + + * src/cff/cffdrivr.c, src/cff/cffobjs.c, src/cff/cffparse.c, + src/cff/cffpic.h: s/FT_CFF_/CFF_/. + + * src/pshinter/pshmod.c, src/pshinter/pshpic.h: + s/FT_PSHINTER_/PSHINTER_/. + + * src/psnames/psmodule.c, src/psnames/pspic.h: + s/FT_PSCMAPS/PSCMAPS_/. + 2012-08-27 Werner Lemberg [sfnt, truetype] More renamings for orthogonality. diff --git a/src/autofit/afmodule.c b/src/autofit/afmodule.c index 4ea7a31dc..04cd8945d 100644 --- a/src/autofit/afmodule.c +++ b/src/autofit/afmodule.c @@ -84,7 +84,7 @@ 0x10000L, /* version 1.0 of the autofitter */ 0x20000L, /* requires FreeType 2.0 or above */ - (const void*)&AF_AUTOFITTER_INTERFACE_GET, + (const void*)&AF_INTERFACE_GET, (FT_Module_Constructor)af_autofitter_init, (FT_Module_Destructor) af_autofitter_done, diff --git a/src/autofit/afpic.h b/src/autofit/afpic.h index 0ae5bfcb3..41c832abb 100644 --- a/src/autofit/afpic.h +++ b/src/autofit/afpic.h @@ -27,8 +27,8 @@ FT_BEGIN_HEADER #ifndef FT_CONFIG_OPTION_PIC -#define AF_SCRIPT_CLASSES_GET af_script_classes -#define AF_AUTOFITTER_INTERFACE_GET af_autofitter_interface +#define AF_SCRIPT_CLASSES_GET af_script_classes +#define AF_INTERFACE_GET af_autofitter_interface #else /* FT_CONFIG_OPTION_PIC */ @@ -54,12 +54,12 @@ FT_BEGIN_HEADER } AFModulePIC; -#define GET_PIC( lib ) \ +#define GET_PIC( lib ) \ ( (AFModulePIC*)((lib)->pic_container.autofit) ) -#define AF_SCRIPT_CLASSES_GET \ - ( GET_PIC( FT_FACE_LIBRARY(globals->face) )->af_script_classes ) -#define AF_AUTOFITTER_INTERFACE_GET \ +#define AF_SCRIPT_CLASSES_GET \ + ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_script_classes ) +#define AF_INTERFACE_GET \ ( GET_PIC( library )->af_autofitter_interface ) diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c index eb4c14ee5..b5fda95d7 100644 --- a/src/cff/cffdrivr.c +++ b/src/cff/cffdrivr.c @@ -412,8 +412,8 @@ cmap_info->language = 0; cmap_info->format = 0; - if ( cmap->clazz != &FT_CFF_CMAP_ENCODING_CLASS_REC_GET && - cmap->clazz != &FT_CFF_CMAP_UNICODE_CLASS_REC_GET ) + if ( cmap->clazz != &CFF_CMAP_ENCODING_CLASS_REC_GET && + cmap->clazz != &CFF_CMAP_UNICODE_CLASS_REC_GET ) { FT_Module sfnt = FT_Get_Module( library, "sfnt" ); FT_Service_TTCMaps service = @@ -579,19 +579,19 @@ #ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES FT_DEFINE_SERVICEDESCREC6(cff_services, FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_CFF, - FT_SERVICE_ID_POSTSCRIPT_INFO, &FT_CFF_SERVICE_PS_INFO_GET, - FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_CFF_SERVICE_PS_NAME_GET, - FT_SERVICE_ID_GLYPH_DICT, &FT_CFF_SERVICE_GLYPH_DICT_GET, - FT_SERVICE_ID_TT_CMAP, &FT_CFF_SERVICE_GET_CMAP_INFO_GET, - FT_SERVICE_ID_CID, &FT_CFF_SERVICE_CID_INFO_GET + FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET, + FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET, + FT_SERVICE_ID_GLYPH_DICT, &CFF_SERVICE_GLYPH_DICT_GET, + FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET, + FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET ) #else FT_DEFINE_SERVICEDESCREC5(cff_services, FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_CFF, - FT_SERVICE_ID_POSTSCRIPT_INFO, &FT_CFF_SERVICE_PS_INFO_GET, - FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_CFF_SERVICE_PS_NAME_GET, - FT_SERVICE_ID_TT_CMAP, &FT_CFF_SERVICE_GET_CMAP_INFO_GET, - FT_SERVICE_ID_CID, &FT_CFF_SERVICE_CID_INFO_GET + FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET, + FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET, + FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET, + FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET ) #endif @@ -604,7 +604,7 @@ FT_Module_Interface result; - /* FT_CFF_SERVICES_GET derefers `library' in PIC mode */ + /* CFF_SERVICES_GET derefers `library' in PIC mode */ #ifdef FT_CONFIG_OPTION_PIC if ( !driver ) return NULL; @@ -613,7 +613,7 @@ return NULL; #endif - result = ft_service_list_lookup( FT_CFF_SERVICES_GET, module_interface ); + result = ft_service_list_lookup( CFF_SERVICES_GET, module_interface ); if ( result != NULL ) return result; diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c index 6ad0e5089..aa3e9d353 100644 --- a/src/cff/cffobjs.c +++ b/src/cff/cffobjs.c @@ -968,7 +968,7 @@ nn = (FT_UInt)cffface->num_charmaps; - error = FT_CMap_New( &FT_CFF_CMAP_UNICODE_CLASS_REC_GET, NULL, + error = FT_CMap_New( &CFF_CMAP_UNICODE_CLASS_REC_GET, NULL, &cmaprec, NULL ); if ( error && FT_Err_No_Unicode_Glyph_Name != error ) goto Exit; @@ -1000,19 +1000,19 @@ { cmaprec.encoding_id = TT_ADOBE_ID_STANDARD; cmaprec.encoding = FT_ENCODING_ADOBE_STANDARD; - clazz = &FT_CFF_CMAP_ENCODING_CLASS_REC_GET; + clazz = &CFF_CMAP_ENCODING_CLASS_REC_GET; } else if ( encoding->offset == 1 ) { cmaprec.encoding_id = TT_ADOBE_ID_EXPERT; cmaprec.encoding = FT_ENCODING_ADOBE_EXPERT; - clazz = &FT_CFF_CMAP_ENCODING_CLASS_REC_GET; + clazz = &CFF_CMAP_ENCODING_CLASS_REC_GET; } else { cmaprec.encoding_id = TT_ADOBE_ID_CUSTOM; cmaprec.encoding = FT_ENCODING_ADOBE_CUSTOM; - clazz = &FT_CFF_CMAP_ENCODING_CLASS_REC_GET; + clazz = &CFF_CMAP_ENCODING_CLASS_REC_GET; } error = FT_CMap_New( clazz, NULL, &cmaprec, NULL ); diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c index ef0504377..3d5f8bfc7 100644 --- a/src/cff/cffparse.c +++ b/src/cff/cffparse.c @@ -949,7 +949,7 @@ } code = code | parser->object_code; - for ( field = FT_CFF_FIELD_HANDLERS_GET; field->kind; field++ ) + for ( field = CFF_FIELD_HANDLERS_GET; field->kind; field++ ) { if ( field->code == (FT_Int)code ) { diff --git a/src/cff/cffpic.h b/src/cff/cffpic.h index 342edd845..b27f093db 100644 --- a/src/cff/cffpic.h +++ b/src/cff/cffpic.h @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for cff module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2012 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -24,16 +24,18 @@ FT_BEGIN_HEADER #include FT_INTERNAL_PIC_H + #ifndef FT_CONFIG_OPTION_PIC -#define FT_CFF_SERVICE_PS_INFO_GET cff_service_ps_info -#define FT_CFF_SERVICE_GLYPH_DICT_GET cff_service_glyph_dict -#define FT_CFF_SERVICE_PS_NAME_GET cff_service_ps_name -#define FT_CFF_SERVICE_GET_CMAP_INFO_GET cff_service_get_cmap_info -#define FT_CFF_SERVICE_CID_INFO_GET cff_service_cid_info -#define FT_CFF_SERVICES_GET cff_services -#define FT_CFF_CMAP_ENCODING_CLASS_REC_GET cff_cmap_encoding_class_rec -#define FT_CFF_CMAP_UNICODE_CLASS_REC_GET cff_cmap_unicode_class_rec -#define FT_CFF_FIELD_HANDLERS_GET cff_field_handlers + +#define CFF_SERVICE_PS_INFO_GET cff_service_ps_info +#define CFF_SERVICE_GLYPH_DICT_GET cff_service_glyph_dict +#define CFF_SERVICE_PS_NAME_GET cff_service_ps_name +#define CFF_SERVICE_GET_CMAP_INFO_GET cff_service_get_cmap_info +#define CFF_SERVICE_CID_INFO_GET cff_service_cid_info +#define CFF_SERVICES_GET cff_services +#define CFF_CMAP_ENCODING_CLASS_REC_GET cff_cmap_encoding_class_rec +#define CFF_CMAP_UNICODE_CLASS_REC_GET cff_cmap_unicode_class_rec +#define CFF_FIELD_HANDLERS_GET cff_field_handlers #else /* FT_CONFIG_OPTION_PIC */ @@ -44,29 +46,43 @@ FT_BEGIN_HEADER #include FT_SERVICE_TT_CMAP_H #include FT_SERVICE_CID_H - typedef struct CffModulePIC_ + + typedef struct CffModulePIC_ { - FT_ServiceDescRec* cff_services; - CFF_Field_Handler* cff_field_handlers; - FT_Service_PsInfoRec cff_service_ps_info; - FT_Service_GlyphDictRec cff_service_glyph_dict; - FT_Service_PsFontNameRec cff_service_ps_name; - FT_Service_TTCMapsRec cff_service_get_cmap_info; - FT_Service_CIDRec cff_service_cid_info; - FT_CMap_ClassRec cff_cmap_encoding_class_rec; - FT_CMap_ClassRec cff_cmap_unicode_class_rec; + FT_ServiceDescRec* cff_services; + CFF_Field_Handler* cff_field_handlers; + FT_Service_PsInfoRec cff_service_ps_info; + FT_Service_GlyphDictRec cff_service_glyph_dict; + FT_Service_PsFontNameRec cff_service_ps_name; + FT_Service_TTCMapsRec cff_service_get_cmap_info; + FT_Service_CIDRec cff_service_cid_info; + FT_CMap_ClassRec cff_cmap_encoding_class_rec; + FT_CMap_ClassRec cff_cmap_unicode_class_rec; + } CffModulePIC; -#define GET_PIC(lib) ((CffModulePIC*)((lib)->pic_container.cff)) -#define FT_CFF_SERVICE_PS_INFO_GET (GET_PIC(library)->cff_service_ps_info) -#define FT_CFF_SERVICE_GLYPH_DICT_GET (GET_PIC(library)->cff_service_glyph_dict) -#define FT_CFF_SERVICE_PS_NAME_GET (GET_PIC(library)->cff_service_ps_name) -#define FT_CFF_SERVICE_GET_CMAP_INFO_GET (GET_PIC(library)->cff_service_get_cmap_info) -#define FT_CFF_SERVICE_CID_INFO_GET (GET_PIC(library)->cff_service_cid_info) -#define FT_CFF_SERVICES_GET (GET_PIC(library)->cff_services) -#define FT_CFF_CMAP_ENCODING_CLASS_REC_GET (GET_PIC(library)->cff_cmap_encoding_class_rec) -#define FT_CFF_CMAP_UNICODE_CLASS_REC_GET (GET_PIC(library)->cff_cmap_unicode_class_rec) -#define FT_CFF_FIELD_HANDLERS_GET (GET_PIC(library)->cff_field_handlers) + +#define GET_PIC( lib ) \ + ( (CffModulePIC*)((lib)->pic_container.cff) ) + +#define CFF_SERVICE_PS_INFO_GET \ + ( GET_PIC( library )->cff_service_ps_info ) +#define CFF_SERVICE_GLYPH_DICT_GET \ + ( GET_PIC( library )->cff_service_glyph_dict ) +#define CFF_SERVICE_PS_NAME_GET \ + ( GET_PIC( library )->cff_service_ps_name ) +#define CFF_SERVICE_GET_CMAP_INFO_GET \ + ( GET_PIC( library )->cff_service_get_cmap_info ) +#define CFF_SERVICE_CID_INFO_GET \ + ( GET_PIC( library )->cff_service_cid_info ) +#define CFF_SERVICES_GET \ + ( GET_PIC( library )->cff_services ) +#define CFF_CMAP_ENCODING_CLASS_REC_GET \ + ( GET_PIC( library )->cff_cmap_encoding_class_rec ) +#define CFF_CMAP_UNICODE_CLASS_REC_GET \ + ( GET_PIC( library )->cff_cmap_unicode_class_rec ) +#define CFF_FIELD_HANDLERS_GET \ + ( GET_PIC( library )->cff_field_handlers ) /* see cffpic.c for the implementation */ void diff --git a/src/pshinter/pshmod.c b/src/pshinter/pshmod.c index 3b83b7716..cdeaca18c 100644 --- a/src/pshinter/pshmod.c +++ b/src/pshinter/pshmod.c @@ -109,7 +109,7 @@ 0x10000L, 0x20000L, - &FT_PSHINTER_INTERFACE_GET, /* module-specific interface */ + &PSHINTER_INTERFACE_GET, /* module-specific interface */ (FT_Module_Constructor)ps_hinter_init, (FT_Module_Destructor) ps_hinter_done, diff --git a/src/pshinter/pshpic.h b/src/pshinter/pshpic.h index e01533b27..62abf322c 100644 --- a/src/pshinter/pshpic.h +++ b/src/pshinter/pshpic.h @@ -27,7 +27,7 @@ FT_BEGIN_HEADER #ifndef FT_CONFIG_OPTION_PIC -#define FT_PSHINTER_INTERFACE_GET pshinter_interface +#define PSHINTER_INTERFACE_GET pshinter_interface #else /* FT_CONFIG_OPTION_PIC */ @@ -42,7 +42,7 @@ FT_BEGIN_HEADER #define GET_PIC( lib ) ( (PSHinterPIC*)((lib)->pic_container.autofit) ) -#define FT_PSHINTER_INTERFACE_GET ( GET_PIC( library )->pshinter_interface ) +#define PSHINTER_INTERFACE_GET ( GET_PIC( library )->pshinter_interface ) /* see pshpic.c for the implementation */ void diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c index 23f0d558f..cae60ef47 100644 --- a/src/psnames/psmodule.c +++ b/src/psnames/psmodule.c @@ -555,14 +555,14 @@ FT_DEFINE_SERVICEDESCREC1( pscmaps_services, - FT_SERVICE_ID_POSTSCRIPT_CMAPS, &FT_PSCMAPS_INTERFACE_GET ) + FT_SERVICE_ID_POSTSCRIPT_CMAPS, &PSCMAPS_INTERFACE_GET ) static FT_Pointer psnames_get_service( FT_Module module, const char* service_id ) { - /* FT_PSCMAPS_SERVICES_GET derefers `library' in PIC mode */ + /* PSCMAPS_SERVICES_GET derefers `library' in PIC mode */ #ifdef FT_CONFIG_OPTION_PIC FT_Library library; @@ -576,7 +576,7 @@ FT_UNUSED( module ); #endif - return ft_service_list_lookup( FT_PSCMAPS_SERVICES_GET, service_id ); + return ft_service_list_lookup( PSCMAPS_SERVICES_GET, service_id ); } #endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */ @@ -599,7 +599,7 @@ 0x20000L, /* driver requires FreeType 2 or above */ PUT_PS_NAMES_SERVICE( - (void*)&FT_PSCMAPS_INTERFACE_GET ), /* module specific interface */ + (void*)&PSCMAPS_INTERFACE_GET ), /* module specific interface */ (FT_Module_Constructor)NULL, (FT_Module_Destructor) NULL, (FT_Module_Requester) PUT_PS_NAMES_SERVICE( psnames_get_service ) ) diff --git a/src/psnames/pspic.h b/src/psnames/pspic.h index 6abad6658..6ff002c60 100644 --- a/src/psnames/pspic.h +++ b/src/psnames/pspic.h @@ -26,8 +26,8 @@ FT_BEGIN_HEADER #ifndef FT_CONFIG_OPTION_PIC -#define FT_PSCMAPS_SERVICES_GET pscmaps_services -#define FT_PSCMAPS_INTERFACE_GET pscmaps_interface +#define PSCMAPS_SERVICES_GET pscmaps_services +#define PSCMAPS_INTERFACE_GET pscmaps_interface #else /* FT_CONFIG_OPTION_PIC */ @@ -43,8 +43,8 @@ FT_BEGIN_HEADER #define GET_PIC( lib ) \ ( (PSModulePIC*)((lib)->pic_container.psnames) ) -#define FT_PSCMAPS_SERVICES_GET ( GET_PIC( library )->pscmaps_services ) -#define FT_PSCMAPS_INTERFACE_GET ( GET_PIC( library )->pscmaps_interface ) +#define PSCMAPS_SERVICES_GET ( GET_PIC( library )->pscmaps_services ) +#define PSCMAPS_INTERFACE_GET ( GET_PIC( library )->pscmaps_interface ) /* see pspic.c for the implementation */