Avoid reserved identifiers that are globally defined.

This is mandated by the C99 standard, and clang 15 produces zillions of
warnings otherwise.

* devel/ftoption.h, include/freetype/config/ftoption.h,
include/freetype/internal/ftmemory.h, src/autofit/afhints.h,
src/autofit/afmodule.c, src/autofit/aftypes.h, src/base/ftadvanc.c,
src/base/ftdbgmem.c, src/base/ftstream.c, src/bdf/bdflib.c,
src/truetype/ttinterp.c: Replace identifiers of the form `_foo` with `foo_`.
This commit is contained in:
Werner Lemberg 2023-02-07 07:37:07 +01:00
parent da9eb9c719
commit 37bc7c2604
15 changed files with 239 additions and 219 deletions

View File

@ -461,9 +461,9 @@ FT_BEGIN_HEADER
* while compiling in 'release' mode): * while compiling in 'release' mode):
* *
* ``` * ```
* _af_debug_disable_horz_hints * af_debug_disable_horz_hints_
* _af_debug_disable_vert_hints * af_debug_disable_vert_hints_
* _af_debug_disable_blue_hints * af_debug_disable_blue_hints_
* ``` * ```
* *
* Additionally, the following functions provide dumps of various * Additionally, the following functions provide dumps of various
@ -480,7 +480,7 @@ FT_BEGIN_HEADER
* As an argument, they use another global variable: * As an argument, they use another global variable:
* *
* ``` * ```
* _af_debug_hints * af_debug_hints_
* ``` * ```
* *
* Please have a look at the `ftgrid` demo program to see how those * Please have a look at the `ftgrid` demo program to see how those

View File

@ -53,6 +53,26 @@ CHANGES BETWEEN 2.12.1 and 2.13
- `ftmulti` can now handle up to 16 design axes. - `ftmulti` can now handle up to 16 design axes.
- To avoid reserved identifiers that are globally defined, the
auto-hinter debugging macros (which are only available if
`FT_DEBUG_AUTOFIT` is defined)
```
_af_debug_disable_horz_hints
_af_debug_disable_vert_hints
_af_debug_disable_blue_hints
_af_debug_hints
```
have been renamed to
```
af_debug_disable_horz_hints_
af_debug_disable_vert_hints_
af_debug_disable_blue_hints_
af_debug_hints_
```
====================================================================== ======================================================================

View File

@ -461,9 +461,9 @@ FT_BEGIN_HEADER
* while compiling in 'release' mode): * while compiling in 'release' mode):
* *
* ``` * ```
* _af_debug_disable_horz_hints * af_debug_disable_horz_hints_
* _af_debug_disable_vert_hints * af_debug_disable_vert_hints_
* _af_debug_disable_blue_hints * af_debug_disable_blue_hints_
* ``` * ```
* *
* Additionally, the following functions provide dumps of various * Additionally, the following functions provide dumps of various
@ -480,7 +480,7 @@ FT_BEGIN_HEADER
* As an argument, they use another global variable: * As an argument, they use another global variable:
* *
* ``` * ```
* _af_debug_hints * af_debug_hints_
* ``` * ```
* *
* Please have a look at the `ftgrid` demo program to see how those * Please have a look at the `ftgrid` demo program to see how those

View File

@ -96,15 +96,15 @@ extern "C++"
#ifdef FT_DEBUG_MEMORY #ifdef FT_DEBUG_MEMORY
FT_BASE( const char* ) _ft_debug_file; FT_BASE( const char* ) ft_debug_file_;
FT_BASE( long ) _ft_debug_lineno; FT_BASE( long ) ft_debug_lineno_;
#define FT_DEBUG_INNER( exp ) ( _ft_debug_file = __FILE__, \ #define FT_DEBUG_INNER( exp ) ( ft_debug_file_ = __FILE__, \
_ft_debug_lineno = __LINE__, \ ft_debug_lineno_ = __LINE__, \
(exp) ) (exp) )
#define FT_ASSIGNP_INNER( p, exp ) ( _ft_debug_file = __FILE__, \ #define FT_ASSIGNP_INNER( p, exp ) ( ft_debug_file_ = __FILE__, \
_ft_debug_lineno = __LINE__, \ ft_debug_lineno_ = __LINE__, \
FT_ASSIGNP( p, exp ) ) FT_ASSIGNP( p, exp ) )
#else /* !FT_DEBUG_MEMORY */ #else /* !FT_DEBUG_MEMORY */

View File

@ -356,7 +356,7 @@
globals->scale_down_factor = 0; globals->scale_down_factor = 0;
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
globals->hb_font = _hb_ft_font_create( face, NULL ); globals->hb_font = hb_ft_font_create_( face, NULL );
globals->hb_buf = hb_buffer_create(); globals->hb_buf = hb_buffer_create();
#endif #endif

View File

@ -375,14 +375,14 @@ FT_BEGIN_HEADER
#ifdef FT_DEBUG_AUTOFIT #ifdef FT_DEBUG_AUTOFIT
#define AF_HINTS_DO_HORIZONTAL( h ) \ #define AF_HINTS_DO_HORIZONTAL( h ) \
( !_af_debug_disable_horz_hints && \ ( !af_debug_disable_horz_hints_ && \
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL ) ) !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL ) )
#define AF_HINTS_DO_VERTICAL( h ) \ #define AF_HINTS_DO_VERTICAL( h ) \
( !_af_debug_disable_vert_hints && \ ( !af_debug_disable_vert_hints_ && \
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_VERTICAL ) ) !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_VERTICAL ) )
#define AF_HINTS_DO_BLUES( h ) ( !_af_debug_disable_blue_hints ) #define AF_HINTS_DO_BLUES( h ) ( !af_debug_disable_blue_hints_ )
#else /* !FT_DEBUG_AUTOFIT */ #else /* !FT_DEBUG_AUTOFIT */

View File

@ -43,14 +43,14 @@
#endif #endif
int _af_debug_disable_horz_hints; int af_debug_disable_horz_hints_;
int _af_debug_disable_vert_hints; int af_debug_disable_vert_hints_;
int _af_debug_disable_blue_hints; int af_debug_disable_blue_hints_;
/* we use a global object instead of a local one for debugging */ /* we use a global object instead of a local one for debugging */
static AF_GlyphHintsRec _af_debug_hints_rec[1]; static AF_GlyphHintsRec af_debug_hints_rec_[1];
void* _af_debug_hints = _af_debug_hints_rec; void* af_debug_hints_ = af_debug_hints_rec_;
#endif #endif
#include <freetype/internal/ftobjs.h> #include <freetype/internal/ftobjs.h>
@ -423,8 +423,8 @@
FT_UNUSED( ft_module ); FT_UNUSED( ft_module );
#ifdef FT_DEBUG_AUTOFIT #ifdef FT_DEBUG_AUTOFIT
if ( _af_debug_hints_rec->memory ) if ( af_debug_hints_rec_->memory )
af_glyph_hints_done( _af_debug_hints_rec ); af_glyph_hints_done( af_debug_hints_rec_ );
#endif #endif
} }
@ -443,7 +443,7 @@
/* in debug mode, we use a global object that survives this routine */ /* in debug mode, we use a global object that survives this routine */
AF_GlyphHints hints = _af_debug_hints_rec; AF_GlyphHints hints = af_debug_hints_rec_;
AF_LoaderRec loader[1]; AF_LoaderRec loader[1];
FT_UNUSED( size ); FT_UNUSED( size );

View File

@ -57,10 +57,10 @@ FT_BEGIN_HEADER
#ifdef FT_DEBUG_AUTOFIT #ifdef FT_DEBUG_AUTOFIT
extern int _af_debug_disable_horz_hints; extern int af_debug_disable_horz_hints_;
extern int _af_debug_disable_vert_hints; extern int af_debug_disable_vert_hints_;
extern int _af_debug_disable_blue_hints; extern int af_debug_disable_blue_hints_;
extern void* _af_debug_hints; extern void* af_debug_hints_;
#endif /* FT_DEBUG_AUTOFIT */ #endif /* FT_DEBUG_AUTOFIT */

View File

@ -36,7 +36,7 @@
*/ */
static hb_blob_t * static hb_blob_t *
_hb_ft_reference_table (hb_face_t *face, hb_tag_t tag, void *user_data) hb_ft_reference_table_ (hb_face_t *face, hb_tag_t tag, void *user_data)
{ {
FT_Face ft_face = (FT_Face) user_data; FT_Face ft_face = (FT_Face) user_data;
FT_Byte *buffer; FT_Byte *buffer;
@ -68,7 +68,7 @@ _hb_ft_reference_table (hb_face_t *face, hb_tag_t tag, void *user_data)
} }
static hb_face_t * static hb_face_t *
_hb_ft_face_create (FT_Face ft_face, hb_ft_face_create_ (FT_Face ft_face,
hb_destroy_func_t destroy) hb_destroy_func_t destroy)
{ {
hb_face_t *face; hb_face_t *face;
@ -83,7 +83,7 @@ _hb_ft_face_create (FT_Face ft_face,
face = hb_face_create (blob, ft_face->face_index); face = hb_face_create (blob, ft_face->face_index);
hb_blob_destroy (blob); hb_blob_destroy (blob);
} else { } else {
face = hb_face_create_for_tables (_hb_ft_reference_table, ft_face, destroy); face = hb_face_create_for_tables (hb_ft_reference_table_, ft_face, destroy);
} }
hb_face_set_index (face, ft_face->face_index); hb_face_set_index (face, ft_face->face_index);
@ -93,13 +93,13 @@ _hb_ft_face_create (FT_Face ft_face,
} }
hb_font_t * hb_font_t *
_hb_ft_font_create (FT_Face ft_face, hb_ft_font_create_ (FT_Face ft_face,
hb_destroy_func_t destroy) hb_destroy_func_t destroy)
{ {
hb_font_t *font; hb_font_t *font;
hb_face_t *face; hb_face_t *face;
face = _hb_ft_face_create (ft_face, destroy); face = hb_ft_face_create_ (ft_face, destroy);
font = hb_font_create (face); font = hb_font_create (face);
hb_face_destroy (face); hb_face_destroy (face);
return font; return font;

View File

@ -29,7 +29,7 @@
#include <hb.h> #include <hb.h>
hb_font_t * _hb_ft_font_create (FT_Face ft_face, hb_font_t * hb_ft_font_create_ (FT_Face ft_face,
hb_destroy_func_t destroy); hb_destroy_func_t destroy);
#endif #endif

View File

@ -23,7 +23,7 @@
static FT_Error static FT_Error
_ft_face_scale_advances( FT_Face face, ft_face_scale_advances_( FT_Face face,
FT_Fixed* advances, FT_Fixed* advances,
FT_UInt count, FT_UInt count,
FT_Int32 flags ) FT_Int32 flags )
@ -96,7 +96,7 @@
error = func( face, gindex, 1, flags, padvance ); error = func( face, gindex, 1, flags, padvance );
if ( !error ) if ( !error )
return _ft_face_scale_advances( face, padvance, 1, flags ); return ft_face_scale_advances_( face, padvance, 1, flags );
if ( FT_ERR_NEQ( error, Unimplemented_Feature ) ) if ( FT_ERR_NEQ( error, Unimplemented_Feature ) )
return error; return error;
@ -142,7 +142,7 @@
{ {
error = func( face, start, count, flags, padvances ); error = func( face, start, count, flags, padvances );
if ( !error ) if ( !error )
return _ft_face_scale_advances( face, padvances, count, flags ); return ft_face_scale_advances_( face, padvances, count, flags );
if ( FT_ERR_NEQ( error, Unimplemented_Feature ) ) if ( FT_ERR_NEQ( error, Unimplemented_Feature ) )
return error; return error;

View File

@ -35,8 +35,8 @@
#include FT_CONFIG_STANDARD_LIBRARY_H #include FT_CONFIG_STANDARD_LIBRARY_H
FT_BASE_DEF( const char* ) _ft_debug_file = NULL; FT_BASE_DEF( const char* ) ft_debug_file_ = NULL;
FT_BASE_DEF( long ) _ft_debug_lineno = 0; FT_BASE_DEF( long ) ft_debug_lineno_ = 0;
extern void extern void
FT_DumpMemory( FT_Memory memory ); FT_DumpMemory( FT_Memory memory );
@ -415,8 +415,8 @@
/* cast to FT_PtrDist first since void* can be larger */ /* cast to FT_PtrDist first since void* can be larger */
/* than FT_UInt32 and GCC 4.1.1 emits a warning */ /* than FT_UInt32 and GCC 4.1.1 emits a warning */
hash = (FT_UInt32)(FT_PtrDist)(void*)_ft_debug_file + hash = (FT_UInt32)(FT_PtrDist)(void*)ft_debug_file_ +
(FT_UInt32)( 5 * _ft_debug_lineno ); (FT_UInt32)( 5 * ft_debug_lineno_ );
pnode = &table->sources[hash % FT_MEM_SOURCE_BUCKETS]; pnode = &table->sources[hash % FT_MEM_SOURCE_BUCKETS];
for (;;) for (;;)
@ -425,8 +425,8 @@
if ( !node ) if ( !node )
break; break;
if ( node->file_name == _ft_debug_file && if ( node->file_name == ft_debug_file_ &&
node->line_no == _ft_debug_lineno ) node->line_no == ft_debug_lineno_ )
goto Exit; goto Exit;
pnode = &node->link; pnode = &node->link;
@ -437,8 +437,8 @@
ft_mem_debug_panic( ft_mem_debug_panic(
"not enough memory to perform memory debugging\n" ); "not enough memory to perform memory debugging\n" );
node->file_name = _ft_debug_file; node->file_name = ft_debug_file_;
node->line_no = _ft_debug_lineno; node->line_no = ft_debug_lineno_;
node->cur_blocks = 0; node->cur_blocks = 0;
node->max_blocks = 0; node->max_blocks = 0;
@ -495,7 +495,7 @@
"org=%s:%d new=%s:%d\n", "org=%s:%d new=%s:%d\n",
node->address, node->size, node->address, node->size,
FT_FILENAME( node->source->file_name ), node->source->line_no, FT_FILENAME( node->source->file_name ), node->source->line_no,
FT_FILENAME( _ft_debug_file ), _ft_debug_lineno ); FT_FILENAME( ft_debug_file_ ), ft_debug_lineno_ );
} }
} }
@ -582,7 +582,7 @@
" Block was allocated at (%s:%ld)\n" " Block was allocated at (%s:%ld)\n"
" and released at (%s:%ld).", " and released at (%s:%ld).",
address, address,
FT_FILENAME( _ft_debug_file ), _ft_debug_lineno, FT_FILENAME( ft_debug_file_ ), ft_debug_lineno_,
FT_FILENAME( node->source->file_name ), node->source->line_no, FT_FILENAME( node->source->file_name ), node->source->line_no,
FT_FILENAME( node->free_file_name ), node->free_line_no ); FT_FILENAME( node->free_file_name ), node->free_line_no );
@ -604,8 +604,8 @@
/* we simply invert the node's size to indicate that the node */ /* we simply invert the node's size to indicate that the node */
/* was freed. */ /* was freed. */
node->size = -node->size; node->size = -node->size;
node->free_file_name = _ft_debug_file; node->free_file_name = ft_debug_file_;
node->free_line_no = _ft_debug_lineno; node->free_line_no = ft_debug_lineno_;
} }
else else
{ {
@ -627,7 +627,7 @@
ft_mem_debug_panic( ft_mem_debug_panic(
"trying to free unknown block at %p in (%s:%ld)\n", "trying to free unknown block at %p in (%s:%ld)\n",
address, address,
FT_FILENAME( _ft_debug_file ), _ft_debug_lineno ); FT_FILENAME( ft_debug_file_ ), ft_debug_lineno_ );
} }
} }
@ -661,8 +661,8 @@
table->alloc_count++; table->alloc_count++;
} }
_ft_debug_file = "<unknown>"; ft_debug_file_ = "<unknown>";
_ft_debug_lineno = 0; ft_debug_lineno_ = 0;
return (FT_Pointer)block; return (FT_Pointer)block;
} }
@ -677,8 +677,8 @@
if ( !block ) if ( !block )
ft_mem_debug_panic( "trying to free NULL in (%s:%ld)", ft_mem_debug_panic( "trying to free NULL in (%s:%ld)",
FT_FILENAME( _ft_debug_file ), FT_FILENAME( ft_debug_file_ ),
_ft_debug_lineno ); ft_debug_lineno_ );
ft_mem_table_remove( table, (FT_Byte*)block, 0 ); ft_mem_table_remove( table, (FT_Byte*)block, 0 );
@ -687,8 +687,8 @@
table->alloc_count--; table->alloc_count--;
_ft_debug_file = "<unknown>"; ft_debug_file_ = "<unknown>";
_ft_debug_lineno = 0; ft_debug_lineno_ = 0;
} }
@ -703,8 +703,8 @@
FT_Pointer new_block; FT_Pointer new_block;
FT_Long delta; FT_Long delta;
const char* file_name = FT_FILENAME( _ft_debug_file ); const char* file_name = FT_FILENAME( ft_debug_file_ );
FT_Long line_no = _ft_debug_lineno; FT_Long line_no = ft_debug_lineno_;
/* unlikely, but possible */ /* unlikely, but possible */
@ -767,8 +767,8 @@
ft_mem_table_remove( table, (FT_Byte*)block, delta ); ft_mem_table_remove( table, (FT_Byte*)block, delta );
_ft_debug_file = "<unknown>"; ft_debug_file_ = "<unknown>";
_ft_debug_lineno = 0; ft_debug_lineno_ = 0;
if ( !table->keep_alive ) if ( !table->keep_alive )
ft_mem_table_free( table, block ); ft_mem_table_free( table, block );

View File

@ -261,7 +261,7 @@
} }
#ifdef FT_DEBUG_MEMORY #ifdef FT_DEBUG_MEMORY
/* assume _ft_debug_file and _ft_debug_lineno are already set */ /* assume `ft_debug_file_` and `ft_debug_lineno_` are already set */
stream->base = (unsigned char*)ft_mem_qalloc( memory, stream->base = (unsigned char*)ft_mem_qalloc( memory,
(FT_Long)count, (FT_Long)count,
&error ); &error );

View File

@ -58,7 +58,7 @@
*/ */
static const bdf_options_t _bdf_opts = static const bdf_options_t bdf_opts_ =
{ {
1, /* Correct metrics. */ 1, /* Correct metrics. */
1, /* Preserve unencoded glyphs. */ 1, /* Preserve unencoded glyphs. */
@ -76,7 +76,7 @@
/* List of most properties that might appear in a font. Doesn't include */ /* List of most properties that might appear in a font. Doesn't include */
/* the RAW_* and AXIS_* properties in X11R6 polymorphic fonts. */ /* the RAW_* and AXIS_* properties in X11R6 polymorphic fonts. */
static const bdf_property_t _bdf_properties[] = static const bdf_property_t bdf_properties_[] =
{ {
{ "ADD_STYLE_NAME", BDF_ATOM, 1, { 0 } }, { "ADD_STYLE_NAME", BDF_ATOM, 1, { 0 } },
{ "AVERAGE_WIDTH", BDF_INTEGER, 1, { 0 } }, { "AVERAGE_WIDTH", BDF_INTEGER, 1, { 0 } },
@ -164,8 +164,8 @@
}; };
static const unsigned long static const unsigned long
_num_bdf_properties = sizeof ( _bdf_properties ) / num_bdf_properties_ = sizeof ( bdf_properties_ ) /
sizeof ( _bdf_properties[0] ); sizeof ( bdf_properties_[0] );
/* An auxiliary macro to parse properties, to be used in conditionals. */ /* An auxiliary macro to parse properties, to be used in conditionals. */
@ -227,7 +227,7 @@
/* Function type for parsing lines of a BDF font. */ /* Function type for parsing lines of a BDF font. */
typedef FT_Error typedef FT_Error
(*_bdf_line_func_t)( char* line, (*bdf_line_func_t_)( char* line,
unsigned long linelen, unsigned long linelen,
unsigned long lineno, unsigned long lineno,
void* call_data, void* call_data,
@ -236,19 +236,19 @@
/* List structure for splitting lines into fields. */ /* List structure for splitting lines into fields. */
typedef struct _bdf_list_t_ typedef struct bdf_list_t__
{ {
char** field; char** field;
unsigned long size; unsigned long size;
unsigned long used; unsigned long used;
FT_Memory memory; FT_Memory memory;
} _bdf_list_t; } bdf_list_t_;
/* Structure used while loading BDF fonts. */ /* Structure used while loading BDF fonts. */
typedef struct _bdf_parse_t_ typedef struct bdf_parse_t__
{ {
unsigned long flags; unsigned long flags;
unsigned long cnt; unsigned long cnt;
@ -268,12 +268,12 @@
bdf_font_t* font; bdf_font_t* font;
bdf_options_t* opts; bdf_options_t* opts;
_bdf_list_t list; bdf_list_t_ list;
FT_Memory memory; FT_Memory memory;
unsigned long size; /* the stream size */ unsigned long size; /* the stream size */
} _bdf_parse_t; } bdf_parse_t_;
#define setsbit( m, cc ) \ #define setsbit( m, cc ) \
@ -283,7 +283,7 @@
static void static void
_bdf_list_init( _bdf_list_t* list, bdf_list_init_( bdf_list_t_* list,
FT_Memory memory ) FT_Memory memory )
{ {
FT_ZERO( list ); FT_ZERO( list );
@ -292,7 +292,7 @@
static void static void
_bdf_list_done( _bdf_list_t* list ) bdf_list_done_( bdf_list_t_* list )
{ {
FT_Memory memory = list->memory; FT_Memory memory = list->memory;
@ -306,15 +306,15 @@
static FT_Error static FT_Error
_bdf_list_ensure( _bdf_list_t* list, bdf_list_ensure_( bdf_list_t_* list,
unsigned long num_items ) /* same as _bdf_list_t.used */ unsigned long num_items ) /* same as bdf_list_t_.used */
{ {
FT_Error error = FT_Err_Ok; FT_Error error = FT_Err_Ok;
if ( num_items > list->size ) if ( num_items > list->size )
{ {
unsigned long oldsize = list->size; /* same as _bdf_list_t.size */ unsigned long oldsize = list->size; /* same as bdf_list_t_.size */
unsigned long newsize = oldsize + ( oldsize >> 1 ) + 5; unsigned long newsize = oldsize + ( oldsize >> 1 ) + 5;
unsigned long bigsize = (unsigned long)( FT_INT_MAX / sizeof ( char* ) ); unsigned long bigsize = (unsigned long)( FT_INT_MAX / sizeof ( char* ) );
FT_Memory memory = list->memory; FT_Memory memory = list->memory;
@ -340,7 +340,7 @@
static void static void
_bdf_list_shift( _bdf_list_t* list, bdf_list_shift_( bdf_list_t_* list,
unsigned long n ) unsigned long n )
{ {
unsigned long i, u; unsigned long i, u;
@ -367,7 +367,7 @@
static char * static char *
_bdf_list_join( _bdf_list_t* list, bdf_list_join_( bdf_list_t_* list,
int c, int c,
unsigned long *alen ) unsigned long *alen )
{ {
@ -405,7 +405,7 @@
/* don't have to check the number of fields in most cases. */ /* don't have to check the number of fields in most cases. */
static FT_Error static FT_Error
_bdf_list_split( _bdf_list_t* list, bdf_list_split_( bdf_list_t_* list,
const char* separators, const char* separators,
char* line, char* line,
unsigned long linelen ) unsigned long linelen )
@ -467,7 +467,7 @@
/* Resize the list if necessary. */ /* Resize the list if necessary. */
if ( list->used == list->size ) if ( list->used == list->size )
{ {
error = _bdf_list_ensure( list, list->used + 1 ); error = bdf_list_ensure_( list, list->used + 1 );
if ( error ) if ( error )
goto Exit; goto Exit;
} }
@ -496,7 +496,7 @@
/* Finally, NULL-terminate the list. */ /* Finally, NULL-terminate the list. */
if ( list->used + final_empty >= list->size ) if ( list->used + final_empty >= list->size )
{ {
error = _bdf_list_ensure( list, list->used + final_empty + 1 ); error = bdf_list_ensure_( list, list->used + final_empty + 1 );
if ( error ) if ( error )
goto Exit; goto Exit;
} }
@ -515,12 +515,12 @@
static FT_Error static FT_Error
_bdf_readstream( FT_Stream stream, bdf_readstream_( FT_Stream stream,
_bdf_line_func_t callback, bdf_line_func_t_ callback,
void* client_data, void* client_data,
unsigned long *lno ) unsigned long *lno )
{ {
_bdf_line_func_t cb; bdf_line_func_t_ cb;
unsigned long lineno, buf_size; unsigned long lineno, buf_size;
int refill, hold, to_skip; int refill, hold, to_skip;
ptrdiff_t bytes, start, end, cursor, avail; ptrdiff_t bytes, start, end, cursor, avail;
@ -603,7 +603,7 @@
error = FT_THROW( Missing_Startfont_Field ); error = FT_THROW( Missing_Startfont_Field );
else else
{ {
FT_ERROR(( "_bdf_readstream: " ERRMSG6, lineno )); FT_ERROR(( "bdf_readstream_: " ERRMSG6, lineno ));
error = FT_THROW( Invalid_Argument ); error = FT_THROW( Invalid_Argument );
} }
goto Exit; goto Exit;
@ -702,7 +702,7 @@
/* Routine to convert a decimal ASCII string to an unsigned long integer. */ /* Routine to convert a decimal ASCII string to an unsigned long integer. */
static unsigned long static unsigned long
_bdf_atoul( const char* s ) bdf_atoul_( const char* s )
{ {
unsigned long v; unsigned long v;
@ -727,7 +727,7 @@
/* Routine to convert a decimal ASCII string to a signed long integer. */ /* Routine to convert a decimal ASCII string to a signed long integer. */
static long static long
_bdf_atol( const char* s ) bdf_atol_( const char* s )
{ {
long v, neg; long v, neg;
@ -760,7 +760,7 @@
/* Routine to convert a decimal ASCII string to an unsigned short integer. */ /* Routine to convert a decimal ASCII string to an unsigned short integer. */
static unsigned short static unsigned short
_bdf_atous( const char* s ) bdf_atous_( const char* s )
{ {
unsigned short v; unsigned short v;
@ -785,7 +785,7 @@
/* Routine to convert a decimal ASCII string to a signed short integer. */ /* Routine to convert a decimal ASCII string to a signed short integer. */
static short static short
_bdf_atos( const char* s ) bdf_atos_( const char* s )
{ {
short v, neg; short v, neg;
@ -874,7 +874,7 @@
p->builtin = 0; p->builtin = 0;
p->value.atom = NULL; /* nothing is ever stored here */ p->value.atom = NULL; /* nothing is ever stored here */
n = _num_bdf_properties + font->nuser_props; n = num_bdf_properties_ + font->nuser_props;
error = ft_hash_str_insert( p->name, n, &(font->proptbl), memory ); error = ft_hash_str_insert( p->name, n, &(font->proptbl), memory );
if ( error ) if ( error )
@ -900,10 +900,10 @@
if ( ( propid = ft_hash_str_lookup( name, &(font->proptbl) ) ) == NULL ) if ( ( propid = ft_hash_str_lookup( name, &(font->proptbl) ) ) == NULL )
return 0; return 0;
if ( *propid >= _num_bdf_properties ) if ( *propid >= num_bdf_properties_ )
return font->user_props + ( *propid - _num_bdf_properties ); return font->user_props + ( *propid - num_bdf_properties_ );
return (bdf_property_t*)_bdf_properties + *propid; return (bdf_property_t*)bdf_properties_ + *propid;
} }
@ -943,7 +943,7 @@
static FT_Error static FT_Error
_bdf_add_comment( bdf_font_t* font, bdf_add_comment_( bdf_font_t* font,
char* comment, char* comment,
unsigned long len ) unsigned long len )
{ {
@ -972,13 +972,13 @@
/* Set the spacing from the font name if it exists, or set it to the */ /* Set the spacing from the font name if it exists, or set it to the */
/* default specified in the options. */ /* default specified in the options. */
static FT_Error static FT_Error
_bdf_set_default_spacing( bdf_font_t* font, bdf_set_default_spacing_( bdf_font_t* font,
bdf_options_t* opts, bdf_options_t* opts,
unsigned long lineno ) unsigned long lineno )
{ {
size_t len; size_t len;
char name[256]; char name[256];
_bdf_list_t list; bdf_list_t_ list;
FT_Memory memory; FT_Memory memory;
FT_Error error = FT_Err_Ok; FT_Error error = FT_Err_Ok;
@ -993,7 +993,7 @@
memory = font->memory; memory = font->memory;
_bdf_list_init( &list, memory ); bdf_list_init_( &list, memory );
font->spacing = opts->font_spacing; font->spacing = opts->font_spacing;
@ -1001,14 +1001,14 @@
/* Limit ourselves to 256 characters in the font name. */ /* Limit ourselves to 256 characters in the font name. */
if ( len >= 256 ) if ( len >= 256 )
{ {
FT_ERROR(( "_bdf_set_default_spacing: " ERRMSG7, lineno )); FT_ERROR(( "bdf_set_default_spacing_: " ERRMSG7, lineno ));
error = FT_THROW( Invalid_Argument ); error = FT_THROW( Invalid_Argument );
goto Exit; goto Exit;
} }
FT_MEM_COPY( name, font->name, len ); FT_MEM_COPY( name, font->name, len );
error = _bdf_list_split( &list, "-", name, (unsigned long)len ); error = bdf_list_split_( &list, "-", name, (unsigned long)len );
if ( error ) if ( error )
goto Fail; goto Fail;
@ -1032,7 +1032,7 @@
} }
Fail: Fail:
_bdf_list_done( &list ); bdf_list_done_( &list );
Exit: Exit:
return error; return error;
@ -1042,7 +1042,7 @@
/* Determine whether the property is an atom or not. If it is, then */ /* Determine whether the property is an atom or not. If it is, then */
/* clean it up so the double quotes are removed if they exist. */ /* clean it up so the double quotes are removed if they exist. */
static int static int
_bdf_is_atom( char* line, bdf_is_atom_( char* line,
unsigned long linelen, unsigned long linelen,
char** name, char** name,
char** value, char** value,
@ -1106,7 +1106,7 @@
static FT_Error static FT_Error
_bdf_add_property( bdf_font_t* font, bdf_add_property_( bdf_font_t* font,
const char* name, const char* name,
char* value, char* value,
unsigned long lineno ) unsigned long lineno )
@ -1141,11 +1141,11 @@
break; break;
case BDF_INTEGER: case BDF_INTEGER:
fp->value.l = _bdf_atol( value ); fp->value.l = bdf_atol_( value );
break; break;
case BDF_CARDINAL: case BDF_CARDINAL:
fp->value.ul = _bdf_atoul( value ); fp->value.ul = bdf_atoul_( value );
break; break;
default: default:
@ -1177,10 +1177,10 @@
font->props_size++; font->props_size++;
} }
if ( *propid >= _num_bdf_properties ) if ( *propid >= num_bdf_properties_ )
prop = font->user_props + ( *propid - _num_bdf_properties ); prop = font->user_props + ( *propid - num_bdf_properties_ );
else else
prop = (bdf_property_t*)_bdf_properties + *propid; prop = (bdf_property_t*)bdf_properties_ + *propid;
fp = font->props + font->props_used; fp = font->props + font->props_used;
@ -1200,11 +1200,11 @@
break; break;
case BDF_INTEGER: case BDF_INTEGER:
fp->value.l = _bdf_atol( value ); fp->value.l = bdf_atol_( value );
break; break;
case BDF_CARDINAL: case BDF_CARDINAL:
fp->value.ul = _bdf_atoul( value ); fp->value.ul = bdf_atoul_( value );
break; break;
} }
@ -1238,7 +1238,7 @@
{ {
if ( !fp->value.atom ) if ( !fp->value.atom )
{ {
FT_ERROR(( "_bdf_add_property: " ERRMSG8, lineno, "SPACING" )); FT_ERROR(( "bdf_add_property_: " ERRMSG8, lineno, "SPACING" ));
error = FT_THROW( Invalid_File_Format ); error = FT_THROW( Invalid_File_Format );
goto Exit; goto Exit;
} }
@ -1263,7 +1263,7 @@
static FT_Error static FT_Error
_bdf_parse_end( char* line, bdf_parse_end_( char* line,
unsigned long linelen, unsigned long linelen,
unsigned long lineno, unsigned long lineno,
void* call_data, void* call_data,
@ -1283,7 +1283,7 @@
/* Actually parse the glyph info and bitmaps. */ /* Actually parse the glyph info and bitmaps. */
static FT_Error static FT_Error
_bdf_parse_glyphs( char* line, bdf_parse_glyphs_( char* line,
unsigned long linelen, unsigned long linelen,
unsigned long lineno, unsigned long lineno,
void* call_data, void* call_data,
@ -1294,8 +1294,8 @@
unsigned char* bp; unsigned char* bp;
unsigned long i, slen, nibbles; unsigned long i, slen, nibbles;
_bdf_line_func_t* next; bdf_line_func_t_* next;
_bdf_parse_t* p; bdf_parse_t_* p;
bdf_glyph_t* glyph; bdf_glyph_t* glyph;
bdf_font_t* font; bdf_font_t* font;
@ -1305,8 +1305,8 @@
FT_UNUSED( lineno ); /* only used in debug mode */ FT_UNUSED( lineno ); /* only used in debug mode */
next = (_bdf_line_func_t *)call_data; next = (bdf_line_func_t_ *)call_data;
p = (_bdf_parse_t *) client_data; p = (bdf_parse_t_ *) client_data;
font = p->font; font = p->font;
memory = font->memory; memory = font->memory;
@ -1324,7 +1324,7 @@
s++; s++;
linelen--; linelen--;
} }
error = _bdf_add_comment( p->font, s, linelen ); error = bdf_add_comment_( p->font, s, linelen );
} }
goto Exit; goto Exit;
} }
@ -1334,21 +1334,21 @@
{ {
if ( _bdf_strncmp( line, "CHARS", 5 ) != 0 ) if ( _bdf_strncmp( line, "CHARS", 5 ) != 0 )
{ {
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "CHARS" )); FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG1, lineno, "CHARS" ));
error = FT_THROW( Missing_Chars_Field ); error = FT_THROW( Missing_Chars_Field );
goto Exit; goto Exit;
} }
error = _bdf_list_split( &p->list, " +", line, linelen ); error = bdf_list_split_( &p->list, " +", line, linelen );
if ( error ) if ( error )
goto Exit; goto Exit;
p->cnt = font->glyphs_size = _bdf_atoul( p->list.field[1] ); p->cnt = font->glyphs_size = bdf_atoul_( p->list.field[1] );
/* We need at least 20 bytes per glyph. */ /* We need at least 20 bytes per glyph. */
if ( p->cnt > p->size / 20 ) if ( p->cnt > p->size / 20 )
{ {
p->cnt = font->glyphs_size = p->size / 20; p->cnt = font->glyphs_size = p->size / 20;
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG17, p->cnt )); FT_TRACE2(( "bdf_parse_glyphs_: " ACMSG17, p->cnt ));
} }
/* Make sure the number of glyphs is non-zero. */ /* Make sure the number of glyphs is non-zero. */
@ -1359,7 +1359,7 @@
/* number of code points available in Unicode). */ /* number of code points available in Unicode). */
if ( p->cnt >= 0x110000UL ) if ( p->cnt >= 0x110000UL )
{ {
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG5, lineno, "CHARS" )); FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG5, lineno, "CHARS" ));
error = FT_THROW( Invalid_Argument ); error = FT_THROW( Invalid_Argument );
goto Exit; goto Exit;
} }
@ -1378,7 +1378,7 @@
if ( p->flags & BDF_GLYPH_BITS_ ) if ( p->flags & BDF_GLYPH_BITS_ )
{ {
/* Missing ENDCHAR field. */ /* Missing ENDCHAR field. */
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENDCHAR" )); FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG1, lineno, "ENDCHAR" ));
error = FT_THROW( Corrupted_Font_Glyphs ); error = FT_THROW( Corrupted_Font_Glyphs );
goto Exit; goto Exit;
} }
@ -1390,7 +1390,7 @@
by_encoding ); by_encoding );
p->flags &= ~BDF_START_; p->flags &= ~BDF_START_;
*next = _bdf_parse_end; *next = bdf_parse_end_;
goto Exit; goto Exit;
} }
@ -1417,7 +1417,7 @@
if ( p->flags & BDF_GLYPH_BITS_ ) if ( p->flags & BDF_GLYPH_BITS_ )
{ {
/* Missing ENDCHAR field. */ /* Missing ENDCHAR field. */
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENDCHAR" )); FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG1, lineno, "ENDCHAR" ));
error = FT_THROW( Missing_Startchar_Field ); error = FT_THROW( Missing_Startchar_Field );
goto Exit; goto Exit;
} }
@ -1426,17 +1426,17 @@
/* encoding can be checked for an unencoded character. */ /* encoding can be checked for an unencoded character. */
FT_FREE( p->glyph_name ); FT_FREE( p->glyph_name );
error = _bdf_list_split( &p->list, " +", line, linelen ); error = bdf_list_split_( &p->list, " +", line, linelen );
if ( error ) if ( error )
goto Exit; goto Exit;
_bdf_list_shift( &p->list, 1 ); bdf_list_shift_( &p->list, 1 );
s = _bdf_list_join( &p->list, ' ', &slen ); s = bdf_list_join_( &p->list, ' ', &slen );
if ( !s ) if ( !s )
{ {
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG8, lineno, "STARTCHAR" )); FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG8, lineno, "STARTCHAR" ));
error = FT_THROW( Invalid_File_Format ); error = FT_THROW( Invalid_File_Format );
goto Exit; goto Exit;
} }
@ -1459,16 +1459,16 @@
if ( !( p->flags & BDF_GLYPH_ ) ) if ( !( p->flags & BDF_GLYPH_ ) )
{ {
/* Missing STARTCHAR field. */ /* Missing STARTCHAR field. */
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "STARTCHAR" )); FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG1, lineno, "STARTCHAR" ));
error = FT_THROW( Missing_Startchar_Field ); error = FT_THROW( Missing_Startchar_Field );
goto Exit; goto Exit;
} }
error = _bdf_list_split( &p->list, " +", line, linelen ); error = bdf_list_split_( &p->list, " +", line, linelen );
if ( error ) if ( error )
goto Exit; goto Exit;
p->glyph_enc = _bdf_atol( p->list.field[1] ); p->glyph_enc = bdf_atol_( p->list.field[1] );
/* Normalize negative encoding values. The specification only */ /* Normalize negative encoding values. The specification only */
/* allows -1, but we can be more generous here. */ /* allows -1, but we can be more generous here. */
@ -1477,7 +1477,7 @@
/* Check for alternative encoding format. */ /* Check for alternative encoding format. */
if ( p->glyph_enc == -1 && p->list.used > 2 ) if ( p->glyph_enc == -1 && p->list.used > 2 )
p->glyph_enc = _bdf_atol( p->list.field[2] ); p->glyph_enc = bdf_atol_( p->list.field[2] );
if ( p->glyph_enc < -1 || p->glyph_enc >= 0x110000L ) if ( p->glyph_enc < -1 || p->glyph_enc >= 0x110000L )
p->glyph_enc = -1; p->glyph_enc = -1;
@ -1564,7 +1564,7 @@
{ {
if ( !( p->flags & BDF_GLYPH_HEIGHT_CHECK_ ) ) if ( !( p->flags & BDF_GLYPH_HEIGHT_CHECK_ ) )
{ {
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG13, glyph->encoding )); FT_TRACE2(( "bdf_parse_glyphs_: " ACMSG13, glyph->encoding ));
p->flags |= BDF_GLYPH_HEIGHT_CHECK_; p->flags |= BDF_GLYPH_HEIGHT_CHECK_;
} }
@ -1591,7 +1591,7 @@
if ( i < nibbles && if ( i < nibbles &&
!( p->flags & BDF_GLYPH_WIDTH_CHECK_ ) ) !( p->flags & BDF_GLYPH_WIDTH_CHECK_ ) )
{ {
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG16, glyph->encoding )); FT_TRACE2(( "bdf_parse_glyphs_: " ACMSG16, glyph->encoding ));
p->flags |= BDF_GLYPH_WIDTH_CHECK_; p->flags |= BDF_GLYPH_WIDTH_CHECK_;
} }
@ -1605,7 +1605,7 @@
sbitset( hdigits, line[nibbles] ) && sbitset( hdigits, line[nibbles] ) &&
!( p->flags & BDF_GLYPH_WIDTH_CHECK_ ) ) !( p->flags & BDF_GLYPH_WIDTH_CHECK_ ) )
{ {
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG14, glyph->encoding )); FT_TRACE2(( "bdf_parse_glyphs_: " ACMSG14, glyph->encoding ));
p->flags |= BDF_GLYPH_WIDTH_CHECK_; p->flags |= BDF_GLYPH_WIDTH_CHECK_;
} }
@ -1616,11 +1616,11 @@
/* Expect the SWIDTH (scalable width) field next. */ /* Expect the SWIDTH (scalable width) field next. */
if ( _bdf_strncmp( line, "SWIDTH", 6 ) == 0 ) if ( _bdf_strncmp( line, "SWIDTH", 6 ) == 0 )
{ {
error = _bdf_list_split( &p->list, " +", line, linelen ); error = bdf_list_split_( &p->list, " +", line, linelen );
if ( error ) if ( error )
goto Exit; goto Exit;
glyph->swidth = _bdf_atous( p->list.field[1] ); glyph->swidth = bdf_atous_( p->list.field[1] );
p->flags |= BDF_SWIDTH_; p->flags |= BDF_SWIDTH_;
goto Exit; goto Exit;
@ -1629,17 +1629,17 @@
/* Expect the DWIDTH (device width) field next. */ /* Expect the DWIDTH (device width) field next. */
if ( _bdf_strncmp( line, "DWIDTH", 6 ) == 0 ) if ( _bdf_strncmp( line, "DWIDTH", 6 ) == 0 )
{ {
error = _bdf_list_split( &p->list, " +", line, linelen ); error = bdf_list_split_( &p->list, " +", line, linelen );
if ( error ) if ( error )
goto Exit; goto Exit;
glyph->dwidth = _bdf_atous( p->list.field[1] ); glyph->dwidth = bdf_atous_( p->list.field[1] );
if ( !( p->flags & BDF_SWIDTH_ ) ) if ( !( p->flags & BDF_SWIDTH_ ) )
{ {
/* Missing SWIDTH field. Emit an auto correction message and set */ /* Missing SWIDTH field. Emit an auto correction message and set */
/* the scalable width from the device width. */ /* the scalable width from the device width. */
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG9, lineno )); FT_TRACE2(( "bdf_parse_glyphs_: " ACMSG9, lineno ));
glyph->swidth = (unsigned short)FT_MulDiv( glyph->swidth = (unsigned short)FT_MulDiv(
glyph->dwidth, 72000L, glyph->dwidth, 72000L,
@ -1654,14 +1654,14 @@
/* Expect the BBX field next. */ /* Expect the BBX field next. */
if ( _bdf_strncmp( line, "BBX", 3 ) == 0 ) if ( _bdf_strncmp( line, "BBX", 3 ) == 0 )
{ {
error = _bdf_list_split( &p->list, " +", line, linelen ); error = bdf_list_split_( &p->list, " +", line, linelen );
if ( error ) if ( error )
goto Exit; goto Exit;
glyph->bbx.width = _bdf_atous( p->list.field[1] ); glyph->bbx.width = bdf_atous_( p->list.field[1] );
glyph->bbx.height = _bdf_atous( p->list.field[2] ); glyph->bbx.height = bdf_atous_( p->list.field[2] );
glyph->bbx.x_offset = _bdf_atos( p->list.field[3] ); glyph->bbx.x_offset = bdf_atos_( p->list.field[3] );
glyph->bbx.y_offset = _bdf_atos( p->list.field[4] ); glyph->bbx.y_offset = bdf_atos_( p->list.field[4] );
/* Generate the ascent and descent of the character. */ /* Generate the ascent and descent of the character. */
glyph->bbx.ascent = (short)( glyph->bbx.height + glyph->bbx.y_offset ); glyph->bbx.ascent = (short)( glyph->bbx.height + glyph->bbx.y_offset );
@ -1682,7 +1682,7 @@
{ {
/* Missing DWIDTH field. Emit an auto correction message and set */ /* Missing DWIDTH field. Emit an auto correction message and set */
/* the device width to the glyph width. */ /* the device width to the glyph width. */
FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG10, lineno )); FT_TRACE2(( "bdf_parse_glyphs_: " ACMSG10, lineno ));
glyph->dwidth = glyph->bbx.width; glyph->dwidth = glyph->bbx.width;
} }
@ -1718,7 +1718,7 @@
if ( !( p->flags & BDF_BBX_ ) ) if ( !( p->flags & BDF_BBX_ ) )
{ {
/* Missing BBX field. */ /* Missing BBX field. */
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "BBX" )); FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG1, lineno, "BBX" ));
error = FT_THROW( Missing_Bbx_Field ); error = FT_THROW( Missing_Bbx_Field );
goto Exit; goto Exit;
} }
@ -1729,7 +1729,7 @@
bitmap_size = glyph->bpr * glyph->bbx.height; bitmap_size = glyph->bpr * glyph->bbx.height;
if ( glyph->bpr > 0xFFFFU || bitmap_size > 0xFFFFU ) if ( glyph->bpr > 0xFFFFU || bitmap_size > 0xFFFFU )
{ {
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG4, lineno )); FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG4, lineno ));
error = FT_THROW( Bbx_Too_Big ); error = FT_THROW( Bbx_Too_Big );
goto Exit; goto Exit;
} }
@ -1745,13 +1745,13 @@
goto Exit; goto Exit;
} }
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG9, lineno )); FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG9, lineno ));
error = FT_THROW( Invalid_File_Format ); error = FT_THROW( Invalid_File_Format );
goto Exit; goto Exit;
Missing_Encoding: Missing_Encoding:
/* Missing ENCODING field. */ /* Missing ENCODING field. */
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENCODING" )); FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG1, lineno, "ENCODING" ));
error = FT_THROW( Missing_Encoding_Field ); error = FT_THROW( Missing_Encoding_Field );
Exit: Exit:
@ -1764,15 +1764,15 @@
/* Load the font properties. */ /* Load the font properties. */
static FT_Error static FT_Error
_bdf_parse_properties( char* line, bdf_parse_properties_( char* line,
unsigned long linelen, unsigned long linelen,
unsigned long lineno, unsigned long lineno,
void* call_data, void* call_data,
void* client_data ) void* client_data )
{ {
unsigned long vlen; unsigned long vlen;
_bdf_line_func_t* next; bdf_line_func_t_* next;
_bdf_parse_t* p; bdf_parse_t_* p;
char* name; char* name;
char* value; char* value;
char nbuf[128]; char nbuf[128];
@ -1781,8 +1781,8 @@
FT_UNUSED( lineno ); FT_UNUSED( lineno );
next = (_bdf_line_func_t *)call_data; next = (bdf_line_func_t_ *)call_data;
p = (_bdf_parse_t *) client_data; p = (bdf_parse_t_ *) client_data;
/* Check for the end of the properties. */ /* Check for the end of the properties. */
if ( _bdf_strncmp( line, "ENDPROPERTIES", 13 ) == 0 ) if ( _bdf_strncmp( line, "ENDPROPERTIES", 13 ) == 0 )
@ -1797,28 +1797,28 @@
{ {
p->font->font_ascent = p->font->bbx.ascent; p->font->font_ascent = p->font->bbx.ascent;
ft_sprintf( nbuf, "%hd", p->font->bbx.ascent ); ft_sprintf( nbuf, "%hd", p->font->bbx.ascent );
error = _bdf_add_property( p->font, "FONT_ASCENT", error = bdf_add_property_( p->font, "FONT_ASCENT",
nbuf, lineno ); nbuf, lineno );
if ( error ) if ( error )
goto Exit; goto Exit;
FT_TRACE2(( "_bdf_parse_properties: " ACMSG1, p->font->bbx.ascent )); FT_TRACE2(( "bdf_parse_properties_: " ACMSG1, p->font->bbx.ascent ));
} }
if ( bdf_get_font_property( p->font, "FONT_DESCENT" ) == 0 ) if ( bdf_get_font_property( p->font, "FONT_DESCENT" ) == 0 )
{ {
p->font->font_descent = p->font->bbx.descent; p->font->font_descent = p->font->bbx.descent;
ft_sprintf( nbuf, "%hd", p->font->bbx.descent ); ft_sprintf( nbuf, "%hd", p->font->bbx.descent );
error = _bdf_add_property( p->font, "FONT_DESCENT", error = bdf_add_property_( p->font, "FONT_DESCENT",
nbuf, lineno ); nbuf, lineno );
if ( error ) if ( error )
goto Exit; goto Exit;
FT_TRACE2(( "_bdf_parse_properties: " ACMSG2, p->font->bbx.descent )); FT_TRACE2(( "bdf_parse_properties_: " ACMSG2, p->font->bbx.descent ));
} }
p->flags &= ~BDF_PROPS_; p->flags &= ~BDF_PROPS_;
*next = _bdf_parse_glyphs; *next = bdf_parse_glyphs_;
goto Exit; goto Exit;
} }
@ -1835,27 +1835,27 @@
value += 7; value += 7;
if ( *value ) if ( *value )
*value++ = 0; *value++ = 0;
error = _bdf_add_property( p->font, name, value, lineno ); error = bdf_add_property_( p->font, name, value, lineno );
if ( error ) if ( error )
goto Exit; goto Exit;
} }
else if ( _bdf_is_atom( line, linelen, &name, &value, p->font ) ) else if ( bdf_is_atom_( line, linelen, &name, &value, p->font ) )
{ {
error = _bdf_add_property( p->font, name, value, lineno ); error = bdf_add_property_( p->font, name, value, lineno );
if ( error ) if ( error )
goto Exit; goto Exit;
} }
else else
{ {
error = _bdf_list_split( &p->list, " +", line, linelen ); error = bdf_list_split_( &p->list, " +", line, linelen );
if ( error ) if ( error )
goto Exit; goto Exit;
name = p->list.field[0]; name = p->list.field[0];
_bdf_list_shift( &p->list, 1 ); bdf_list_shift_( &p->list, 1 );
value = _bdf_list_join( &p->list, ' ', &vlen ); value = bdf_list_join_( &p->list, ' ', &vlen );
error = _bdf_add_property( p->font, name, value, lineno ); error = bdf_add_property_( p->font, name, value, lineno );
if ( error ) if ( error )
goto Exit; goto Exit;
} }
@ -1867,15 +1867,15 @@
/* Load the font header. */ /* Load the font header. */
static FT_Error static FT_Error
_bdf_parse_start( char* line, bdf_parse_start_( char* line,
unsigned long linelen, unsigned long linelen,
unsigned long lineno, unsigned long lineno,
void* call_data, void* call_data,
void* client_data ) void* client_data )
{ {
unsigned long slen; unsigned long slen;
_bdf_line_func_t* next; bdf_line_func_t_* next;
_bdf_parse_t* p; bdf_parse_t_* p;
bdf_font_t* font; bdf_font_t* font;
char *s; char *s;
@ -1885,8 +1885,8 @@
FT_UNUSED( lineno ); /* only used in debug mode */ FT_UNUSED( lineno ); /* only used in debug mode */
next = (_bdf_line_func_t *)call_data; next = (bdf_line_func_t_ *)call_data;
p = (_bdf_parse_t *) client_data; p = (bdf_parse_t_ *) client_data;
if ( p->font ) if ( p->font )
memory = p->font->memory; memory = p->font->memory;
@ -1905,7 +1905,7 @@
s++; s++;
linelen--; linelen--;
} }
error = _bdf_add_comment( p->font, s, linelen ); error = bdf_add_comment_( p->font, s, linelen );
} }
goto Exit; goto Exit;
} }
@ -1939,8 +1939,8 @@
error = ft_hash_str_init( &(font->proptbl), memory ); error = ft_hash_str_init( &(font->proptbl), memory );
if ( error ) if ( error )
goto Exit; goto Exit;
for ( i = 0, prop = (bdf_property_t*)_bdf_properties; for ( i = 0, prop = (bdf_property_t*)bdf_properties_;
i < _num_bdf_properties; i++, prop++ ) i < num_bdf_properties_; i++, prop++ )
{ {
error = ft_hash_str_insert( prop->name, i, error = ft_hash_str_insert( prop->name, i,
&(font->proptbl), memory ); &(font->proptbl), memory );
@ -1966,23 +1966,23 @@
if ( !( p->flags & BDF_FONT_BBX_ ) ) if ( !( p->flags & BDF_FONT_BBX_ ) )
{ {
/* Missing the FONTBOUNDINGBOX field. */ /* Missing the FONTBOUNDINGBOX field. */
FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONTBOUNDINGBOX" )); FT_ERROR(( "bdf_parse_start_: " ERRMSG1, lineno, "FONTBOUNDINGBOX" ));
error = FT_THROW( Missing_Fontboundingbox_Field ); error = FT_THROW( Missing_Fontboundingbox_Field );
goto Exit; goto Exit;
} }
error = _bdf_list_split( &p->list, " +", line, linelen ); error = bdf_list_split_( &p->list, " +", line, linelen );
if ( error ) if ( error )
goto Exit; goto Exit;
/* at this point, `p->font' can't be NULL */ /* at this point, `p->font' can't be NULL */
p->cnt = p->font->props_size = _bdf_atoul( p->list.field[1] ); p->cnt = p->font->props_size = bdf_atoul_( p->list.field[1] );
/* We need at least 4 bytes per property. */ /* We need at least 4 bytes per property. */
if ( p->cnt > p->size / 4 ) if ( p->cnt > p->size / 4 )
{ {
p->font->props_size = 0; p->font->props_size = 0;
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG5, lineno, "STARTPROPERTIES" )); FT_ERROR(( "bdf_parse_glyphs_: " ERRMSG5, lineno, "STARTPROPERTIES" ));
error = FT_THROW( Invalid_Argument ); error = FT_THROW( Invalid_Argument );
goto Exit; goto Exit;
} }
@ -1994,7 +1994,7 @@
} }
p->flags |= BDF_PROPS_; p->flags |= BDF_PROPS_;
*next = _bdf_parse_properties; *next = bdf_parse_properties_;
goto Exit; goto Exit;
} }
@ -2005,20 +2005,20 @@
if ( !( p->flags & BDF_SIZE_ ) ) if ( !( p->flags & BDF_SIZE_ ) )
{ {
/* Missing the SIZE field. */ /* Missing the SIZE field. */
FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "SIZE" )); FT_ERROR(( "bdf_parse_start_: " ERRMSG1, lineno, "SIZE" ));
error = FT_THROW( Missing_Size_Field ); error = FT_THROW( Missing_Size_Field );
goto Exit; goto Exit;
} }
error = _bdf_list_split( &p->list, " +", line, linelen ); error = bdf_list_split_( &p->list, " +", line, linelen );
if ( error ) if ( error )
goto Exit; goto Exit;
p->font->bbx.width = _bdf_atous( p->list.field[1] ); p->font->bbx.width = bdf_atous_( p->list.field[1] );
p->font->bbx.height = _bdf_atous( p->list.field[2] ); p->font->bbx.height = bdf_atous_( p->list.field[2] );
p->font->bbx.x_offset = _bdf_atos( p->list.field[3] ); p->font->bbx.x_offset = bdf_atos_( p->list.field[3] );
p->font->bbx.y_offset = _bdf_atos( p->list.field[4] ); p->font->bbx.y_offset = bdf_atos_( p->list.field[4] );
p->font->bbx.ascent = (short)( p->font->bbx.height + p->font->bbx.ascent = (short)( p->font->bbx.height +
p->font->bbx.y_offset ); p->font->bbx.y_offset );
@ -2033,16 +2033,16 @@
/* The next thing to check for is the FONT field. */ /* The next thing to check for is the FONT field. */
if ( _bdf_strncmp( line, "FONT", 4 ) == 0 ) if ( _bdf_strncmp( line, "FONT", 4 ) == 0 )
{ {
error = _bdf_list_split( &p->list, " +", line, linelen ); error = bdf_list_split_( &p->list, " +", line, linelen );
if ( error ) if ( error )
goto Exit; goto Exit;
_bdf_list_shift( &p->list, 1 ); bdf_list_shift_( &p->list, 1 );
s = _bdf_list_join( &p->list, ' ', &slen ); s = bdf_list_join_( &p->list, ' ', &slen );
if ( !s ) if ( !s )
{ {
FT_ERROR(( "_bdf_parse_start: " ERRMSG8, lineno, "FONT" )); FT_ERROR(( "bdf_parse_start_: " ERRMSG8, lineno, "FONT" ));
error = FT_THROW( Invalid_File_Format ); error = FT_THROW( Invalid_File_Format );
goto Exit; goto Exit;
} }
@ -2056,7 +2056,7 @@
/* If the font name is an XLFD name, set the spacing to the one in */ /* If the font name is an XLFD name, set the spacing to the one in */
/* the font name. If there is no spacing fall back on the default. */ /* the font name. If there is no spacing fall back on the default. */
error = _bdf_set_default_spacing( p->font, p->opts, lineno ); error = bdf_set_default_spacing_( p->font, p->opts, lineno );
if ( error ) if ( error )
goto Exit; goto Exit;
@ -2071,18 +2071,18 @@
if ( !( p->flags & BDF_FONT_NAME_ ) ) if ( !( p->flags & BDF_FONT_NAME_ ) )
{ {
/* Missing the FONT field. */ /* Missing the FONT field. */
FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONT" )); FT_ERROR(( "bdf_parse_start_: " ERRMSG1, lineno, "FONT" ));
error = FT_THROW( Missing_Font_Field ); error = FT_THROW( Missing_Font_Field );
goto Exit; goto Exit;
} }
error = _bdf_list_split( &p->list, " +", line, linelen ); error = bdf_list_split_( &p->list, " +", line, linelen );
if ( error ) if ( error )
goto Exit; goto Exit;
p->font->point_size = _bdf_atoul( p->list.field[1] ); p->font->point_size = bdf_atoul_( p->list.field[1] );
p->font->resolution_x = _bdf_atoul( p->list.field[2] ); p->font->resolution_x = bdf_atoul_( p->list.field[2] );
p->font->resolution_y = _bdf_atoul( p->list.field[3] ); p->font->resolution_y = bdf_atoul_( p->list.field[3] );
/* Check for the bits per pixel field. */ /* Check for the bits per pixel field. */
if ( p->list.used == 5 ) if ( p->list.used == 5 )
@ -2090,7 +2090,7 @@
unsigned short bpp; unsigned short bpp;
bpp = _bdf_atous( p->list.field[4] ); bpp = bdf_atous_( p->list.field[4] );
/* Only values 1, 2, 4, 8 are allowed for greymap fonts. */ /* Only values 1, 2, 4, 8 are allowed for greymap fonts. */
if ( bpp > 4 ) if ( bpp > 4 )
@ -2103,7 +2103,7 @@
p->font->bpp = 1; p->font->bpp = 1;
if ( p->font->bpp != bpp ) if ( p->font->bpp != bpp )
FT_TRACE2(( "_bdf_parse_start: " ACMSG11, p->font->bpp )); FT_TRACE2(( "bdf_parse_start_: " ACMSG11, p->font->bpp ));
} }
else else
p->font->bpp = 1; p->font->bpp = 1;
@ -2122,7 +2122,7 @@
if ( !( p->flags & BDF_FONT_BBX_ ) ) if ( !( p->flags & BDF_FONT_BBX_ ) )
{ {
/* Missing the FONTBOUNDINGBOX field. */ /* Missing the FONTBOUNDINGBOX field. */
FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONTBOUNDINGBOX" )); FT_ERROR(( "bdf_parse_start_: " ERRMSG1, lineno, "FONTBOUNDINGBOX" ));
error = FT_THROW( Missing_Fontboundingbox_Field ); error = FT_THROW( Missing_Fontboundingbox_Field );
goto Exit; goto Exit;
} }
@ -2131,28 +2131,28 @@
/* for compiling fonts. */ /* for compiling fonts. */
p->font->font_ascent = p->font->bbx.ascent; p->font->font_ascent = p->font->bbx.ascent;
ft_sprintf( nbuf, "%hd", p->font->bbx.ascent ); ft_sprintf( nbuf, "%hd", p->font->bbx.ascent );
error = _bdf_add_property( p->font, "FONT_ASCENT", error = bdf_add_property_( p->font, "FONT_ASCENT",
nbuf, lineno ); nbuf, lineno );
if ( error ) if ( error )
goto Exit; goto Exit;
FT_TRACE2(( "_bdf_parse_properties: " ACMSG1, p->font->bbx.ascent )); FT_TRACE2(( "bdf_parse_properties_: " ACMSG1, p->font->bbx.ascent ));
p->font->font_descent = p->font->bbx.descent; p->font->font_descent = p->font->bbx.descent;
ft_sprintf( nbuf, "%hd", p->font->bbx.descent ); ft_sprintf( nbuf, "%hd", p->font->bbx.descent );
error = _bdf_add_property( p->font, "FONT_DESCENT", error = bdf_add_property_( p->font, "FONT_DESCENT",
nbuf, lineno ); nbuf, lineno );
if ( error ) if ( error )
goto Exit; goto Exit;
FT_TRACE2(( "_bdf_parse_properties: " ACMSG2, p->font->bbx.descent )); FT_TRACE2(( "bdf_parse_properties_: " ACMSG2, p->font->bbx.descent ));
*next = _bdf_parse_glyphs; *next = bdf_parse_glyphs_;
/* A special return value. */ /* A special return value. */
error = -1; error = -1;
goto Exit; goto Exit;
} }
FT_ERROR(( "_bdf_parse_start: " ERRMSG9, lineno )); FT_ERROR(( "bdf_parse_start_: " ERRMSG9, lineno ));
error = FT_THROW( Invalid_File_Format ); error = FT_THROW( Invalid_File_Format );
Exit: Exit:
@ -2174,7 +2174,7 @@
bdf_font_t* *font ) bdf_font_t* *font )
{ {
unsigned long lineno = 0; /* make compiler happy */ unsigned long lineno = 0; /* make compiler happy */
_bdf_parse_t *p = NULL; bdf_parse_t_ *p = NULL;
FT_Error error = FT_Err_Ok; FT_Error error = FT_Err_Ok;
@ -2182,14 +2182,14 @@
if ( FT_NEW( p ) ) if ( FT_NEW( p ) )
goto Exit; goto Exit;
p->opts = (bdf_options_t*)( opts ? opts : &_bdf_opts ); p->opts = (bdf_options_t*)( opts ? opts : &bdf_opts_ );
p->minlb = 32767; p->minlb = 32767;
p->size = stream->size; p->size = stream->size;
p->memory = memory; /* only during font creation */ p->memory = memory; /* only during font creation */
_bdf_list_init( &p->list, memory ); bdf_list_init_( &p->list, memory );
error = _bdf_readstream( stream, _bdf_parse_start, error = bdf_readstream_( stream, bdf_parse_start_,
(void *)p, &lineno ); (void *)p, &lineno );
if ( error ) if ( error )
goto Fail; goto Fail;
@ -2283,7 +2283,7 @@
Exit: Exit:
if ( p ) if ( p )
{ {
_bdf_list_done( &p->list ); bdf_list_done_( &p->list );
FT_FREE( p->glyph_name ); FT_FREE( p->glyph_name );
FT_FREE( p ); FT_FREE( p );

View File

@ -6871,7 +6871,7 @@
static void static void
_iup_worker_shift( IUP_Worker worker, iup_worker_shift_( IUP_Worker worker,
FT_UInt p1, FT_UInt p1,
FT_UInt p2, FT_UInt p2,
FT_UInt p ) FT_UInt p )
@ -6893,7 +6893,7 @@
static void static void
_iup_worker_interpolate( IUP_Worker worker, iup_worker_interpolate_( IUP_Worker worker,
FT_UInt p1, FT_UInt p1,
FT_UInt p2, FT_UInt p2,
FT_UInt ref1, FT_UInt ref1,
@ -7087,7 +7087,7 @@
{ {
if ( ( exc->pts.tags[point] & mask ) != 0 ) if ( ( exc->pts.tags[point] & mask ) != 0 )
{ {
_iup_worker_interpolate( &V, iup_worker_interpolate_( &V,
cur_touched + 1, cur_touched + 1,
point - 1, point - 1,
cur_touched, cur_touched,
@ -7099,17 +7099,17 @@
} }
if ( cur_touched == first_touched ) if ( cur_touched == first_touched )
_iup_worker_shift( &V, first_point, end_point, cur_touched ); iup_worker_shift_( &V, first_point, end_point, cur_touched );
else else
{ {
_iup_worker_interpolate( &V, iup_worker_interpolate_( &V,
(FT_UShort)( cur_touched + 1 ), (FT_UShort)( cur_touched + 1 ),
end_point, end_point,
cur_touched, cur_touched,
first_touched ); first_touched );
if ( first_touched > 0 ) if ( first_touched > 0 )
_iup_worker_interpolate( &V, iup_worker_interpolate_( &V,
first_point, first_point,
first_touched - 1, first_touched - 1,
cur_touched, cur_touched,