diff options
author | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-06-07 15:54:51 -0400 |
---|---|---|
committer | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-06-07 15:54:51 -0400 |
commit | 3b1bcd7676fe810ce60d6a4758067b571796cceb (patch) | |
tree | 0ea14dbffcfe1b4537076d1b2311cc3f5c1ca26a /src | |
parent | 6257af0e547095483331b8c8ed588e5467852671 (diff) |
Dead code cull from fontserver code.
Diffstat (limited to 'src')
-rw-r--r-- | src/fc/fsconvert.c | 40 | ||||
-rw-r--r-- | src/fc/fserve.c | 73 | ||||
-rw-r--r-- | src/fc/fserve.h | 3 | ||||
-rw-r--r-- | src/fc/fservestr.h | 9 | ||||
-rw-r--r-- | src/fc/fsio.c | 62 | ||||
-rw-r--r-- | src/fc/fsio.h | 7 |
6 files changed, 39 insertions, 155 deletions
diff --git a/src/fc/fsconvert.c b/src/fc/fsconvert.c index 9ff54f5..8cdda2a 100644 --- a/src/fc/fsconvert.c +++ b/src/fc/fsconvert.c @@ -43,8 +43,6 @@ extern char _fs_glyph_undefined; extern char _fs_glyph_requested; -extern char _fs_glyph_zero_length; - /* * converts data from font server form to X server form @@ -400,41 +398,7 @@ _fs_clean_aborted_loadglyphs(FontPtr pfont, int num_expected_ranges, } } - -/* - * figures out what extents to request - * this is where lots of extra - * smarts wants to live - */ -/* ARGSUSED */ -int -_fs_check_extents(FontPtr pfont, Mask flags, int nranges, fsRange *range, - FSBlockDataPtr blockrec) -{ -/* XXX -- either fill in the requested info if we have it somewhere - * and return AccessDone, or else return Successful - */ - return Successful; -} - -/* - * figures out what glyphs to request - * this is where lots of extra - * smarts wants to live - */ -/* ARGSUSED */ -int -_fs_check_bitmaps(FontPtr pfont, fsBitmapFormat format, - Mask flags, int nranges, fsRange *range, - FSBlockDataPtr blockrec) -{ -/* XXX -- either fill in the requested info if we have it somewhere - * and return AccessDone, or else return Successful - */ - return Successful; -} - -int +static int _fs_get_glyphs(FontPtr pFont, unsigned long count, unsigned char *chars, FontEncoding charEncoding, unsigned long *glyphCount, /* RETURN */ @@ -640,7 +604,7 @@ _fs_get_metrics(FontPtr pFont, unsigned long count, unsigned char *chars, } -void +static void _fs_unload_font(FontPtr pfont) { FSFontPtr fsdata = (FSFontPtr) pfont->fontPrivate; diff --git a/src/fc/fserve.c b/src/fc/fserve.c index 804ac85..fd1bd53 100644 --- a/src/fc/fserve.c +++ b/src/fc/fserve.c @@ -130,11 +130,11 @@ static void fs_cleanup_bfont (FSBlockedFontPtr bfont); char _fs_glyph_undefined; char _fs_glyph_requested; -char _fs_glyph_zero_length; +static char _fs_glyph_zero_length; static int generationCount; -int FontServerRequestTimeout = 30 * 1000; +static int FontServerRequestTimeout = 30 * 1000; static void _fs_close_server (FSFpePtr conn); @@ -2046,41 +2046,7 @@ extern pointer serverClient; /* This could be any number that doesn't conflict with existing client values. */ -int -fs_load_all_glyphs(FontPtr pfont) -{ - int err; - FSFpePtr conn = (FSFpePtr) pfont->fpe->private; - - /* - * The purpose of this procedure is to load all glyphs in the event - * that we're dealing with someone who doesn't understand the finer - * points of glyph caching... it is called from _fs_get_glyphs() if - * the latter is called to get glyphs that have not yet been loaded. - * We assume that the caller will not know how to handle a return - * value of Suspended (usually the case for a GetGlyphs() caller), - * so this procedure hangs around, freezing the server, for the - * request to complete. This is an unpleasant kluge called to - * perform an unpleasant job that, we hope, will never be required. - */ - - while ((err = _fs_load_glyphs(serverClient, pfont, TRUE, 0, 0, NULL)) == - Suspended) - { - if (fs_await_reply (conn) != FSIO_READY) - { - /* Get rid of blockrec */ - fs_client_died(serverClient, pfont->fpe); - err = BadCharRange; - break; - } - fs_read_reply (pfont->fpe, serverClient); - } - return err; -} - - -int +static int _fs_load_glyphs(pointer client, FontPtr pfont, Bool range_flag, unsigned int nchars, int item_size, unsigned char *data) { @@ -2230,6 +2196,39 @@ _fs_load_glyphs(pointer client, FontPtr pfont, Bool range_flag, return fs_send_load_glyphs(client, pfont, nranges, ranges); } +int +fs_load_all_glyphs(FontPtr pfont) +{ + int err; + FSFpePtr conn = (FSFpePtr) pfont->fpe->private; + + /* + * The purpose of this procedure is to load all glyphs in the event + * that we're dealing with someone who doesn't understand the finer + * points of glyph caching... it is called from _fs_get_glyphs() if + * the latter is called to get glyphs that have not yet been loaded. + * We assume that the caller will not know how to handle a return + * value of Suspended (usually the case for a GetGlyphs() caller), + * so this procedure hangs around, freezing the server, for the + * request to complete. This is an unpleasant kluge called to + * perform an unpleasant job that, we hope, will never be required. + */ + + while ((err = _fs_load_glyphs(serverClient, pfont, TRUE, 0, 0, NULL)) == + Suspended) + { + if (fs_await_reply (conn) != FSIO_READY) + { + /* Get rid of blockrec */ + fs_client_died(serverClient, pfont->fpe); + err = BadCharRange; + break; + } + fs_read_reply (pfont->fpe, serverClient); + } + return err; +} + static int fs_read_list(FontPathElementPtr fpe, FSBlockDataPtr blockrec) { diff --git a/src/fc/fserve.h b/src/fc/fserve.h index 3254f40..3b08526 100644 --- a/src/fc/fserve.h +++ b/src/fc/fserve.h @@ -80,9 +80,6 @@ extern FontPtr fs_create_font (FontPathElementPtr fpe, fsBitmapFormatMask fmask); extern int fs_load_all_glyphs ( FontPtr pfont ); -extern int _fs_load_glyphs ( pointer client, FontPtr pfont, Bool range_flag, - unsigned int nchars, int item_size, - unsigned char *data ); /* * These should be declared elsewhere, but I'm concerned that moving them diff --git a/src/fc/fservestr.h b/src/fc/fservestr.h index 0e41666..1993de8 100644 --- a/src/fc/fservestr.h +++ b/src/fc/fservestr.h @@ -197,15 +197,6 @@ extern int fs_build_range ( FontPtr pfont, Bool range_flag, extern void _fs_clean_aborted_loadglyphs ( FontPtr pfont, int num_expected_ranges, fsRange *expected_ranges ); -extern int _fs_check_extents ( FontPtr pfont, Mask flags, int nranges, - fsRange *range, FSBlockDataPtr blockrec ); -extern int _fs_check_bitmaps ( FontPtr pfont, fsBitmapFormat format, - Mask flags, int nranges, fsRange *range, - FSBlockDataPtr blockrec ); -extern int _fs_get_glyphs ( FontPtr pFont, unsigned long count, - unsigned char *chars, FontEncoding charEncoding, - unsigned long *glyphCount, CharInfoPtr *glyphs ); -extern void _fs_unload_font ( FontPtr pfont ); extern void _fs_init_font ( FontPtr pfont ); extern pointer fs_alloc_glyphs (FontPtr pFont, int size); #endif /* _FSERVESTR_H_ */ diff --git a/src/fc/fsio.c b/src/fc/fsio.c index fbfb9df..a7abe12 100644 --- a/src/fc/fsio.c +++ b/src/fc/fsio.c @@ -150,7 +150,7 @@ _fs_connect(char *servername, int *err) return trans_conn; } -int +static int _fs_fill (FSFpePtr conn) { long avail; @@ -422,19 +422,6 @@ _fs_write_pad(FSFpePtr conn, char *data, long len) return _fs_do_write (conn, data, len, len + padlength[len & 3]); } -/* - * returns the amount of data waiting to be read - */ -int -_fs_data_ready(FSFpePtr conn) -{ - BytesReadable_t readable; - - if (_FontTransBytesReadable(conn->trans_conn, &readable) < 0) - return -1; - return readable; -} - int _fs_wait_for_readable(FSFpePtr conn, int ms) { @@ -467,50 +454,3 @@ _fs_wait_for_readable(FSFpePtr conn, int ms) return FSIO_ERROR; } } - -int -_fs_set_bit(fd_set *mask, int fd) -{ - FD_SET(fd, mask); - return fd; -} - -int -_fs_is_bit_set(fd_set *mask, int fd) -{ - return FD_ISSET(fd, mask); -} - -void -_fs_bit_clear(fd_set *mask, int fd) -{ - FD_CLR(fd, mask); -} - -int -_fs_any_bit_set(fd_set *mask) -{ - return XFD_ANYSET(mask); -} - -void -_fs_or_bits(fd_set *dst, fd_set *m1, fd_set *m2) -{ -#ifdef WIN32 - int i; - if (dst != m1) { - for (i = m1->fd_count; --i >= 0; ) { - if (!FD_ISSET(m1->fd_array[i], dst)) - FD_SET(m1->fd_array[i], dst); - } - } - if (dst != m2) { - for (i = m2->fd_count; --i >= 0; ) { - if (!FD_ISSET(m2->fd_array[i], dst)) - FD_SET(m2->fd_array[i], dst); - } - } -#else - XFD_ORSET(dst, m1, m2); -#endif -} diff --git a/src/fc/fsio.h b/src/fc/fsio.h index 2241436..1454b44 100644 --- a/src/fc/fsio.h +++ b/src/fc/fsio.h @@ -133,18 +133,11 @@ typedef struct _fs_fpe_data { extern Bool _fs_reopen_server ( FSFpePtr conn ); extern int _fs_write ( FSFpePtr conn, char *data, long size ); extern int _fs_write_pad ( FSFpePtr conn, char *data, long len ); -extern int _fs_data_ready ( FSFpePtr conn ); extern int _fs_wait_for_readable ( FSFpePtr conn, int ms ); -extern int _fs_set_bit ( fd_set * mask, int fd ); -extern int _fs_is_bit_set ( fd_set * mask, int fd ); -extern void _fs_bit_clear ( fd_set * mask, int fd ); -extern int _fs_any_bit_set ( fd_set * mask ); -extern void _fs_or_bits ( fd_set * dst, fd_set * m1, fd_set * m2 ); extern long _fs_pad_length (long len); extern void _fs_connection_died ( FSFpePtr conn ); -extern int _fs_fill (FSFpePtr conn); extern int _fs_flush (FSFpePtr conn); extern void _fs_mark_block (FSFpePtr conn, CARD32 mask); extern void _fs_unmark_block (FSFpePtr conn, CARD32 mask); |