Fix callback functions in cache module.

* src/cache/ftccback.h: New file for callback declarations.

* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Use FT_CALLBACK_DEF.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class):
Use FT_CALLBACK_TABLE_DEF and local wrapper functions.

* src/cache/ftccache.c: Include ftccback.h.
(ftc_cache_init, ftc_cache_done): New wrapper functions which use
FT_LOCAL_DEF.

* src/cache/ftccmap.c: Include ftccback.h.
(ftc_cmap_cache_class): Use local wrapper functions.

* src/cache/ftcglyph.c: Include ftccback.h.
(ftc_gnode_compare, ftc_gcache_init, ftc_gcache_done): New wrapper
functions which use FT_LOCAL_DEF.

* src/cache/ftcimage.c: Include ftccback.h.
(ftc_inode_free, ftc_inode_new, ftc_inode_weight): New wrapper
functions which use FT_LOCAL_DEF.

* src/cache/ftcmanag.c (ftc_size_list_class, ftc_face_list_class):
Use FT_CALLBACK_TABLE_DEF.

* src/cache;/ftcsbits.c: Include ftccback.h.
(ftc_snode_free, ftc_snode_new, ftc_snode_weight,
ftc_snode_compare): New wrapper functions which use FT_LOCAL_DEF.

* src/cache/rules.mk (CACHE_DRV_H): Add ftccback.h.
This commit is contained in:
Werner Lemberg 2004-02-17 18:41:58 +00:00
parent bb75417ad5
commit 09370c8ce0
10 changed files with 257 additions and 31 deletions

View File

@ -1,3 +1,41 @@
2004-02-17 Werner Lemberg <wl@gnu.org>
Fix callback functions in cache module.
* src/cache/ftccback.h: New file for callback declarations.
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Use FT_CALLBACK_DEF.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class):
Use FT_CALLBACK_TABLE_DEF and local wrapper functions.
* src/cache/ftccache.c: Include ftccback.h.
(ftc_cache_init, ftc_cache_done): New wrapper functions which use
FT_LOCAL_DEF.
* src/cache/ftccmap.c: Include ftccback.h.
(ftc_cmap_cache_class): Use local wrapper functions.
* src/cache/ftcglyph.c: Include ftccback.h.
(ftc_gnode_compare, ftc_gcache_init, ftc_gcache_done): New wrapper
functions which use FT_LOCAL_DEF.
* src/cache/ftcimage.c: Include ftccback.h.
(ftc_inode_free, ftc_inode_new, ftc_inode_weight): New wrapper
functions which use FT_LOCAL_DEF.
* src/cache/ftcmanag.c (ftc_size_list_class, ftc_face_list_class):
Use FT_CALLBACK_TABLE_DEF.
* src/cache;/ftcsbits.c: Include ftccback.h.
(ftc_snode_free, ftc_snode_new, ftc_snode_weight,
ftc_snode_compare): New wrapper functions which use FT_LOCAL_DEF.
* src/cache/rules.mk (CACHE_DRV_H): Add ftccback.h.
2004-02-17 Masatake YAMATO <jet@gyve.org>
* include/freetype/ftmac.h (FT_GetFile_From_Mac_Name): Fix a typo

49
src/cache/ftcbasic.c vendored
View File

@ -23,6 +23,7 @@
#include FT_CACHE_INTERNAL_SBITS_H
#include FT_INTERNAL_MEMORY_H
#include "ftccback.h"
#include "ftcerror.h"
@ -61,7 +62,7 @@
} FTC_BasicFamilyRec, *FTC_BasicFamily;
static FT_Bool
FT_CALLBACK_DEF( FT_Bool )
ftc_basic_family_compare( FTC_BasicFamily family,
FTC_BasicQuery query )
{
@ -69,7 +70,7 @@
}
static FT_Error
FT_CALLBACK_DEF( FT_Error )
ftc_basic_family_init( FTC_BasicFamily family,
FTC_BasicQuery query,
FTC_Cache cache )
@ -80,7 +81,7 @@
}
static FT_UInt
FT_CALLBACK_DEF( FT_UInt )
ftc_basic_family_get_count( FTC_BasicFamily family,
FTC_Manager manager )
{
@ -98,7 +99,7 @@
}
static FT_Error
FT_CALLBACK_DEF( FT_Error )
ftc_basic_family_load_bitmap( FTC_BasicFamily family,
FT_UInt gindex,
FTC_Manager manager,
@ -124,7 +125,7 @@
}
static FT_Error
FT_CALLBACK_DEF( FT_Error )
ftc_basic_family_load_glyph( FTC_BasicFamily family,
FT_UInt gindex,
FTC_Cache cache,
@ -171,7 +172,7 @@
}
static FT_Bool
FT_CALLBACK_DEF( FT_Bool )
ftc_basic_gnode_compare_faceid( FTC_GNode gnode,
FTC_FaceID face_id,
FTC_Cache cache )
@ -198,7 +199,8 @@
*
*/
static const FTC_IFamilyClassRec ftc_basic_image_family_class =
FT_CALLBACK_TABLE_DEF
const FTC_IFamilyClassRec ftc_basic_image_family_class =
{
{
sizeof( FTC_BasicFamilyRec ),
@ -211,18 +213,19 @@
};
static const FTC_GCacheClassRec ftc_basic_image_cache_class =
FT_CALLBACK_TABLE_DEF
const FTC_GCacheClassRec ftc_basic_image_cache_class =
{
{
(FTC_Node_NewFunc) FTC_INode_New,
(FTC_Node_WeightFunc) FTC_INode_Weight,
(FTC_Node_CompareFunc)FTC_GNode_Compare,
(FTC_Node_NewFunc) ftc_inode_new,
(FTC_Node_WeightFunc) ftc_inode_weight,
(FTC_Node_CompareFunc)ftc_gnode_compare,
(FTC_Node_CompareFunc)ftc_basic_gnode_compare_faceid,
(FTC_Node_FreeFunc) FTC_INode_Free,
(FTC_Node_FreeFunc) ftc_inode_free,
sizeof( FTC_GCacheRec ),
(FTC_Cache_InitFunc) FTC_GCache_Init,
(FTC_Cache_DoneFunc) FTC_GCache_Done
(FTC_Cache_InitFunc) ftc_gcache_init,
(FTC_Cache_DoneFunc) ftc_gcache_done
},
(FTC_MruListClass)&ftc_basic_image_family_class
};
@ -311,7 +314,8 @@
*/
static const FTC_SFamilyClassRec ftc_basic_sbit_family_class =
FT_CALLBACK_TABLE_DEF
const FTC_SFamilyClassRec ftc_basic_sbit_family_class =
{
{
sizeof( FTC_BasicFamilyRec ),
@ -325,18 +329,19 @@
};
static const FTC_GCacheClassRec ftc_basic_sbit_cache_class =
FT_CALLBACK_TABLE_DEF
const FTC_GCacheClassRec ftc_basic_sbit_cache_class =
{
{
(FTC_Node_NewFunc) FTC_SNode_New,
(FTC_Node_WeightFunc) FTC_SNode_Weight,
(FTC_Node_CompareFunc)FTC_SNode_Compare,
(FTC_Node_NewFunc) ftc_snode_new,
(FTC_Node_WeightFunc) ftc_snode_weight,
(FTC_Node_CompareFunc)ftc_snode_compare,
(FTC_Node_CompareFunc)ftc_basic_gnode_compare_faceid,
(FTC_Node_FreeFunc) FTC_SNode_Free,
(FTC_Node_FreeFunc) ftc_snode_free,
sizeof( FTC_GCacheRec ),
(FTC_Cache_InitFunc) FTC_GCache_Init,
(FTC_Cache_DoneFunc) FTC_GCache_Done
(FTC_Cache_InitFunc) ftc_gcache_init,
(FTC_Cache_DoneFunc) ftc_gcache_done
},
(FTC_MruListClass)&ftc_basic_sbit_family_class
};

17
src/cache/ftccache.c vendored
View File

@ -4,7 +4,7 @@
/* */
/* The FreeType internal cache interface (body). */
/* */
/* Copyright 2000-2001, 2002, 2003 by */
/* Copyright 2000-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -21,6 +21,7 @@
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H
#include "ftccback.h"
#include "ftcerror.h"
@ -314,6 +315,13 @@
}
FT_LOCAL_DEF( FT_Error )
ftc_cache_init( FTC_Cache cache )
{
return FTC_Cache_Init( cache );
}
FT_EXPORT_DEF( void )
FTC_Cache_Clear( FTC_Cache cache )
{
@ -372,6 +380,13 @@
}
FT_LOCAL_DEF( void )
ftc_cache_done( FTC_Cache cache )
{
FTC_Cache_Done( cache );
}
static void
ftc_cache_add( FTC_Cache cache,
FT_UInt32 hash,

82
src/cache/ftccback.h vendored Normal file
View File

@ -0,0 +1,82 @@
/***************************************************************************/
/* */
/* ftccback.h */
/* */
/* Callback functions of the caching sub-system (specification only). */
/* */
/* Copyright 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTCCBACK_H__
#define __FTCCBACK_H__
#include <ft2build.h>
#include FT_CACHE_H
#include FT_CACHE_INTERNAL_MRU_H
#include FT_CACHE_INTERNAL_IMAGE_H
#include FT_CACHE_INTERNAL_MANAGER_H
#include FT_CACHE_INTERNAL_GLYPH_H
#include FT_CACHE_INTERNAL_SBITS_H
FT_LOCAL( void )
ftc_inode_free( FTC_INode inode,
FTC_Cache cache );
FT_LOCAL( FT_Error )
ftc_inode_new( FTC_INode *pinode,
FTC_GQuery gquery,
FTC_Cache cache );
FT_LOCAL( FT_ULong )
ftc_inode_weight( FTC_INode inode );
FT_LOCAL( void )
ftc_snode_free( FTC_SNode snode,
FTC_Cache cache );
FT_LOCAL( FT_Error )
ftc_snode_new( FTC_SNode *psnode,
FTC_GQuery gquery,
FTC_Cache cache );
FT_LOCAL( FT_ULong )
ftc_snode_weight( FTC_SNode snode );
FT_LOCAL( FT_Bool )
ftc_snode_compare( FTC_SNode snode,
FTC_GQuery gquery,
FTC_Cache cache );
FT_LOCAL( FT_Bool )
ftc_gnode_compare( FTC_GNode gnode,
FTC_GQuery gquery );
FT_LOCAL( FT_Error )
ftc_gcache_init( FTC_GCache cache );
FT_LOCAL( void )
ftc_gcache_done( FTC_GCache cache );
FT_LOCAL( FT_Error )
ftc_cache_init( FTC_Cache cache );
FT_LOCAL( void )
ftc_cache_done( FTC_Cache cache );
#endif /* __FTCCBACK_H__ */
/* END */

5
src/cache/ftccmap.c vendored
View File

@ -24,6 +24,7 @@
#include FT_INTERNAL_DEBUG_H
#include FT_TRUETYPE_IDS_H
#include "ftccback.h"
#include "ftcerror.h"
#undef FT_COMPONENT
@ -190,8 +191,8 @@
(FTC_Node_FreeFunc) ftc_cmap_node_free,
sizeof ( FTC_CacheRec ),
(FTC_Cache_InitFunc) FTC_Cache_Init,
(FTC_Cache_DoneFunc) FTC_Cache_Done,
(FTC_Cache_InitFunc) ftc_cache_init,
(FTC_Cache_DoneFunc) ftc_cache_done,
};

25
src/cache/ftcglyph.c vendored
View File

@ -4,7 +4,7 @@
/* */
/* FreeType Glyph Image (FT_Glyph) cache (body). */
/* */
/* Copyright 2000-2001, 2003 by */
/* Copyright 2000-2001, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -23,6 +23,7 @@
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H
#include "ftccback.h"
#include "ftcerror.h"
@ -72,6 +73,14 @@
}
FT_LOCAL_DEF( FT_Bool )
ftc_gnode_compare( FTC_GNode gnode,
FTC_GQuery gquery )
{
return FTC_GNode_Compare( gnode, gquery );
}
/*************************************************************************/
/*************************************************************************/
/***** *****/
@ -114,6 +123,13 @@
}
FT_LOCAL_DEF( FT_Error )
ftc_gcache_init( FTC_GCache cache )
{
return FTC_GCache_Init( cache );
}
FT_EXPORT_DEF( void )
FTC_GCache_Done( FTC_GCache cache )
{
@ -122,6 +138,13 @@
}
FT_LOCAL_DEF( void )
ftc_gcache_done( FTC_GCache cache )
{
FTC_GCache_Done( cache );
}
FT_EXPORT_DEF( FT_Error )
FTC_GCache_New( FTC_Manager manager,
FTC_GCacheClass clazz,

27
src/cache/ftcimage.c vendored
View File

@ -4,7 +4,7 @@
/* */
/* FreeType Image cache (body). */
/* */
/* Copyright 2000-2001, 2003 by */
/* Copyright 2000-2001, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -21,6 +21,7 @@
#include FT_CACHE_INTERNAL_IMAGE_H
#include FT_INTERNAL_MEMORY_H
#include "ftccback.h"
#include "ftcerror.h"
@ -43,6 +44,14 @@
}
FT_LOCAL_DEF( void )
ftc_inode_free( FTC_INode inode,
FTC_Cache cache )
{
FTC_INode_Free( inode, cache );
}
/* initialize a new glyph image node */
FT_EXPORT_DEF( FT_Error )
FTC_INode_New( FTC_INode *pinode,
@ -75,6 +84,15 @@
}
FT_LOCAL_DEF( FT_Error )
ftc_inode_new( FTC_INode *pinode,
FTC_GQuery gquery,
FTC_Cache cache )
{
return FTC_INode_New( pinode, gquery, cache );
}
FT_EXPORT_DEF( FT_ULong )
FTC_INode_Weight( FTC_INode inode )
{
@ -117,4 +135,11 @@
}
FT_LOCAL_DEF( FT_ULong )
ftc_inode_weight( FTC_INode inode )
{
return FTC_INode_Weight( inode );
}
/* END */

View File

@ -129,7 +129,8 @@
}
static const FTC_MruListClassRec ftc_size_list_class =
FT_CALLBACK_TABLE_DEF
const FTC_MruListClassRec ftc_size_list_class =
{
sizeof( FTC_SizeNodeRec ),
(FTC_MruNode_CompareFunc)ftc_size_node_compare,
@ -249,7 +250,8 @@
}
static const FTC_MruListClassRec ftc_face_list_class =
FT_CALLBACK_TABLE_DEF
const FTC_MruListClassRec ftc_face_list_class =
{
sizeof( FTC_FaceNodeRec),

34
src/cache/ftcsbits.c vendored
View File

@ -23,6 +23,7 @@
#include FT_INTERNAL_DEBUG_H
#include FT_ERRORS_H
#include "ftccback.h"
#include "ftcerror.h"
@ -75,6 +76,14 @@
}
FT_LOCAL_DEF( void )
ftc_snode_free( FTC_SNode snode,
FTC_Cache cache )
{
FTC_SNode_Free( snode, cache );
}
static FT_Error
ftc_snode_load( FTC_SNode snode,
FTC_Manager manager,
@ -228,6 +237,15 @@
}
FT_LOCAL_DEF( FT_Error )
ftc_snode_new( FTC_SNode *psnode,
FTC_GQuery gquery,
FTC_Cache cache )
{
return FTC_SNode_New( psnode, gquery, cache );
}
FT_EXPORT_DEF( FT_ULong )
FTC_SNode_Weight( FTC_SNode snode )
{
@ -259,6 +277,13 @@
}
FT_LOCAL_DEF( FT_ULong )
ftc_snode_weight( FTC_SNode snode )
{
return FTC_SNode_Weight( snode );
}
FT_EXPORT_DEF( FT_Bool )
FTC_SNode_Compare( FTC_SNode snode,
FTC_GQuery gquery,
@ -294,4 +319,13 @@
}
FT_LOCAL_DEF( FT_Bool )
ftc_snode_compare( FTC_SNode snode,
FTC_GQuery gquery,
FTC_Cache cache )
{
return FTC_SNode_Compare( snode, gquery, cache );
}
/* END */

5
src/cache/rules.mk vendored
View File

@ -3,7 +3,7 @@
#
# Copyright 2000, 2001, 2003 by
# Copyright 2000, 2001, 2003, 2004 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@ -41,7 +41,8 @@ CACHE_DRV_H := $(CACHE_H_DIR)/ftcmru.h \
$(CACHE_H_DIR)/ftcglyph.h \
$(CACHE_H_DIR)/ftcimage.h \
$(CACHE_H_DIR)/ftccmap.h \
$(CACHE_DIR)/ftcerror.h
$(CACHE_DIR)/ftcerror.h \
$(CACHE_DIR)/ftccback.h
# Cache driver object(s)