diff options
Diffstat (limited to 'lib/libfontenc/src')
-rw-r--r-- | lib/libfontenc/src/Makefile.am | 7 | ||||
-rw-r--r-- | lib/libfontenc/src/Makefile.in | 31 | ||||
-rw-r--r-- | lib/libfontenc/src/encparse.c | 98 | ||||
-rw-r--r-- | lib/libfontenc/src/fontenc.c | 36 | ||||
-rw-r--r-- | lib/libfontenc/src/fontencI.h | 2 |
5 files changed, 74 insertions, 100 deletions
diff --git a/lib/libfontenc/src/Makefile.am b/lib/libfontenc/src/Makefile.am index 8cd09112d..96d0a38be 100644 --- a/lib/libfontenc/src/Makefile.am +++ b/lib/libfontenc/src/Makefile.am @@ -5,13 +5,14 @@ libfontenc_la_SOURCES = \ fontenc.c \ fontencI.h -AM_CFLAGS = @FONTENC_CFLAGS@ +AM_CFLAGS = \ + $(FONTENC_CFLAGS) \ + $(CWARNFLAGS) FONTENCDIR=@ENCODINGSDIR@ FONTENCDEFS = -DFONT_ENCODINGS_DIRECTORY=\"$(FONTENCDIR)/encodings.dir\" -INCLUDES = -I$(top_srcdir)/include \ - -DFONTENC_NO_LIBFONT $(FONTENCDEFS) +INCLUDES = -I$(top_srcdir)/include $(FONTENCDEFS) libfontenc_la_LIBADD = @FONTENC_LIBS@ diff --git a/lib/libfontenc/src/Makefile.in b/lib/libfontenc/src/Makefile.in index b5dd96982..3c86a5812 100644 --- a/lib/libfontenc/src/Makefile.in +++ b/lib/libfontenc/src/Makefile.in @@ -79,9 +79,14 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -101,6 +106,8 @@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ @@ -111,9 +118,13 @@ ENCODINGSDIR = @ENCODINGSDIR@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ FONTENC_CFLAGS = @FONTENC_CFLAGS@ FONTENC_LIBS = @FONTENC_LIBS@ +FONTROOTDIR = @FONTROOTDIR@ GREP = @GREP@ +INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -122,6 +133,8 @@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LINT = @LINT@ LINT_FALSE = @LINT_FALSE@ LINT_FLAGS = @LINT_FLAGS@ @@ -132,6 +145,9 @@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ @@ -148,6 +164,7 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ @@ -168,7 +185,6 @@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ -distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ @@ -202,12 +218,13 @@ libfontenc_la_SOURCES = \ fontenc.c \ fontencI.h -AM_CFLAGS = @FONTENC_CFLAGS@ +AM_CFLAGS = \ + $(FONTENC_CFLAGS) \ + $(CWARNFLAGS) + FONTENCDIR = @ENCODINGSDIR@ FONTENCDEFS = -DFONT_ENCODINGS_DIRECTORY=\"$(FONTENCDIR)/encodings.dir\" -INCLUDES = -I$(top_srcdir)/include \ - -DFONTENC_NO_LIBFONT $(FONTENCDEFS) - +INCLUDES = -I$(top_srcdir)/include $(FONTENCDEFS) libfontenc_la_LIBADD = @FONTENC_LIBS@ libfontenc_la_LDFLAGS = -version-number 1:0:0 -no-undefined libfontencincludedir = $(includedir)/X11/fonts @@ -230,9 +247,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile + $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff --git a/lib/libfontenc/src/encparse.c b/lib/libfontenc/src/encparse.c index 217bf7827..5b4cefb1f 100644 --- a/lib/libfontenc/src/encparse.c +++ b/lib/libfontenc/src/encparse.c @@ -1,4 +1,3 @@ -/* $XdotOrg: lib/fontenc/src/encparse.c,v 1.6 2006/04/10 16:15:12 alanc Exp $ */ /* Copyright (c) 1998-2001 by Juliusz Chroboczek @@ -21,8 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/lib/font/fontfile/encparse.c,v 1.20tsi Exp $ */ - /* Parser for encoding files */ /* This code assumes that we are using ASCII. We don't use the ctype @@ -37,17 +34,7 @@ THE SOFTWARE. #include <strings.h> #endif -#ifndef FONTENC_NO_LIBFONT - -#include <X11/fonts/fntfilio.h> -#include <X11/fonts/fntfilst.h> - -#else - #include <stdlib.h> -#define xalloc(n) malloc(n) -#define xrealloc(p, n) realloc(p, n) -#define xfree(p) free(p) #include "zlib.h" typedef gzFile FontFilePtr; @@ -58,8 +45,6 @@ typedef gzFile FontFilePtr; #define MAXFONTFILENAMELEN 1024 #define MAXFONTNAMELEN 1024 -#endif - #include <X11/fonts/fontenc.h> #include "fontencI.h" @@ -437,14 +422,14 @@ setCode(unsigned from, unsigned to, unsigned row_size, return 0; if(*encsize == 0) { *encsize = (index < 256) ? 256 : 0x10000; - *enc = (unsigned short*)xalloc((*encsize) * sizeof(unsigned short)); + *enc = malloc((*encsize) * sizeof(unsigned short)); if(*enc == NULL) { *encsize = 0; return 1; } } else if(*encsize <= index) { *encsize = 0x10000; - if((newenc = (unsigned short*)xrealloc(enc, *encsize))==NULL) + if((newenc = realloc(enc, *encsize))==NULL) return 1; *enc = newenc; } @@ -500,13 +485,12 @@ parseEncodingFile(FontFilePtr f, int headerOnly) case EOF_LINE: goto error; case STARTENCODING_LINE: - encoding = (FontEncPtr)xalloc(sizeof(FontEncRec)); + encoding = malloc(sizeof(FontEncRec)); if(encoding == NULL) goto error; - encoding->name = (char*)xalloc(strlen(keyword_value)+1); + encoding->name = strdup(keyword_value); if(encoding->name == NULL) goto error; - strcpy(encoding->name, keyword_value); encoding->size = 256; encoding->row_size = 0; encoding->mappings = NULL; @@ -523,10 +507,9 @@ parseEncodingFile(FontFilePtr f, int headerOnly) case EOF_LINE: goto done; case ALIAS_LINE: if(numaliases < MAXALIASES) { - aliases[numaliases] = (char*)xalloc(strlen(keyword_value)+1); + aliases[numaliases] = strdup(keyword_value); if(aliases[numaliases] == NULL) goto error; - strcpy(aliases[numaliases], keyword_value); numaliases++; } goto no_mapping; @@ -542,7 +525,7 @@ parseEncodingFile(FontFilePtr f, int headerOnly) if(headerOnly) goto done; if(!strcasecmp(keyword_value, "unicode")) { - mapping = (FontMapPtr)xalloc(sizeof(FontMapRec)); + mapping = malloc(sizeof(FontMapRec)); if(mapping == NULL) goto error; mapping->type = FONT_ENCODING_UNICODE; @@ -554,7 +537,7 @@ parseEncodingFile(FontFilePtr f, int headerOnly) mapping->next = NULL; goto mapping; } else if(!strcasecmp(keyword_value, "cmap")) { - mapping = (FontMapPtr)xalloc(sizeof(FontMapRec)); + mapping = malloc(sizeof(FontMapRec)); if(mapping == NULL) goto error; mapping->type = FONT_ENCODING_TRUETYPE; @@ -566,7 +549,7 @@ parseEncodingFile(FontFilePtr f, int headerOnly) mapping->next = NULL; goto mapping; } else if(!strcasecmp(keyword_value, "postscript")) { - mapping = (FontMapPtr)xalloc(sizeof(FontMapRec)); + mapping = malloc(sizeof(FontMapRec)); if(mapping == NULL) goto error; mapping->type = FONT_ENCODING_POSTSCRIPT; @@ -603,8 +586,7 @@ parseEncodingFile(FontFilePtr f, int headerOnly) case ENDMAPPING_LINE: mapping->recode = FontEncSimpleRecode; mapping->name = FontEncUndefinedName; - mapping->client_data = sm = - (FontEncSimpleMapPtr)xalloc(sizeof(FontEncSimpleMapRec)); + mapping->client_data = sm = malloc(sizeof(FontEncSimpleMapRec)); if(sm == NULL) goto error; sm->row_size = encoding->row_size; @@ -613,10 +595,9 @@ parseEncodingFile(FontFilePtr f, int headerOnly) sm->first = first; sm->len=last-first+1; - newmap = - (unsigned short*)xalloc(sm->len * sizeof(unsigned short)); + newmap = malloc(sm->len * sizeof(unsigned short)); if(newmap == NULL) { - xfree(sm); + free(sm); mapping->client_data = sm = NULL; goto error; } @@ -685,20 +666,19 @@ parseEncodingFile(FontFilePtr f, int headerOnly) case ENDMAPPING_LINE: mapping->recode = FontEncUndefinedRecode; mapping->name = FontEncSimpleName; - mapping->client_data = sn = - (FontEncSimpleNamePtr)xalloc(sizeof(FontEncSimpleNameRec)); + mapping->client_data = sn = malloc(sizeof(FontEncSimpleNameRec)); if(sn == NULL) goto error; if(first > last) { - xfree(sn); + free(sn); mapping->client_data = sn = NULL; goto error; } sn->first = first; sn->len = last - first + 1; - sn->map = (char**)xalloc(sn->len*sizeof(char*)); + sn->map = malloc(sn->len*sizeof(char*)); if(sn->map == NULL) { - xfree(sn); + free(sn); mapping->client_data = sn = NULL; goto error; } @@ -712,14 +692,14 @@ parseEncodingFile(FontFilePtr f, int headerOnly) if(value1 >= 0x10000) goto string_mapping; if(namsize == 0) { namsize = (value1) < 256 ? 256 : 0x10000; - nam = (char**)xalloc(namsize * sizeof(char*)); + nam = malloc(namsize * sizeof(char*)); if(nam == NULL) { namsize=0; goto error; } } else if(namsize <= value1) { namsize = 0x10000; - if((newnam = (char**)xrealloc(nam, namsize)) == NULL) + if((newnam = (char**)realloc(nam, namsize)) == NULL) goto error; nam = newnam; } @@ -736,23 +716,22 @@ parseEncodingFile(FontFilePtr f, int headerOnly) nam[i]=NULL; last = value1; } - nam[value1] = (char*)xalloc(strlen(keyword_value)+1); + nam[value1] = strdup(keyword_value); if(nam[value1] == NULL) { goto error; } - strcpy(nam[value1], keyword_value); goto string_mapping; default: goto string_mapping; /* ignore unknown lines */ } done: - if(encsize) xfree(enc); encsize=0; enc = NULL; - if(namsize) xfree(nam); namsize=0; nam = NULL; /* don't free entries! */ + if(encsize) free(enc); encsize=0; enc = NULL; + if(namsize) free(nam); namsize=0; nam = NULL; /* don't free entries! */ encoding->aliases=NULL; if(numaliases) { - encoding->aliases = (char**)xalloc((numaliases+1)*sizeof(char*)); + encoding->aliases = malloc((numaliases+1)*sizeof(char*)); if(encoding->aliases == NULL) goto error; for(i=0; i<numaliases; i++) @@ -763,30 +742,29 @@ parseEncodingFile(FontFilePtr f, int headerOnly) return encoding; error: - if(encsize) xfree(enc); encsize=0; + if(encsize) free(enc); encsize=0; if(namsize) { for(i = first; i <= last; i++) - if(nam[i]) - xfree(nam[i]); - xfree(nam); + free(nam[i]); + free(nam); namsize = 0; } if(mapping) { - if(mapping->client_data) xfree(mapping->client_data); - xfree(mapping); + free(mapping->client_data); + free(mapping); } if(encoding) { FontMapPtr nextmap; - if (encoding->name) xfree(encoding->name); + free(encoding->name); for (mapping = encoding->mappings; mapping; mapping = nextmap) { - if (mapping->client_data) xfree(mapping->client_data); + free(mapping->client_data); nextmap = mapping->next; - xfree(mapping); + free(mapping); } - xfree(encoding); + free(encoding); } for(i = 0; i < numaliases; i++) - xfree(aliases[i]); + free(aliases[i]); /* We don't need to free sn and sm as they handled locally in the body.*/ return NULL; } @@ -799,10 +777,9 @@ FontEncDirectory(void) if(dir == NULL) { char *c = getenv("FONT_ENCODINGS_DIRECTORY"); if(c) { - dir = malloc(strlen(c) + 1); + dir = strdup(c); if(!dir) return NULL; - strcpy(dir, c); } else { dir = FONT_ENCODINGS_DIRECTORY; } @@ -950,11 +927,10 @@ FontEncIdentify(const char *fileName) for(alias = encoding->aliases; *alias; alias++) numaliases++; - names = (char**)xalloc((numaliases+2)*sizeof(char*)); + names = malloc((numaliases+2)*sizeof(char*)); if(names == NULL) { - if(encoding->aliases) - xfree(encoding->aliases); - xfree(encoding); + free(encoding->aliases); + free(encoding); return NULL; } @@ -965,8 +941,8 @@ FontEncIdentify(const char *fileName) *name = *alias; *name = NULL; - xfree(encoding->aliases); - xfree(encoding); + free(encoding->aliases); + free(encoding); return names; } diff --git a/lib/libfontenc/src/fontenc.c b/lib/libfontenc/src/fontenc.c index 923e35ea2..86f59520b 100644 --- a/lib/libfontenc/src/fontenc.c +++ b/lib/libfontenc/src/fontenc.c @@ -20,9 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XdotOrg: xc/lib/font/fontfile/fontenc.c,v 1.3 2005/07/03 07:01:00 daniels Exp $ */ -/* $XFree86: xc/lib/font/fontfile/fontenc.c,v 1.15 2003/02/20 03:25:19 dawes Exp $ */ - /* Backend-independent encoding code */ #include <string.h> @@ -31,24 +28,13 @@ THE SOFTWARE. #include <strings.h> #endif -#ifndef FONTENC_NO_LIBFONT - -#include <X11/fonts/fontmisc.h> /* defines xalloc and friends */ -#include <X11/fonts/fntfilst.h> - -#else - #include <stdlib.h> -#define xalloc(n) malloc(n) -#define xrealloc(p, n) realloc(p, n) -#define xfree(p) free(p) + #define FALSE 0 #define TRUE 1 #define MAXFONTNAMELEN 1024 #define MAXFONTFILENAMELEN 1024 -#endif /* FONTENC_NO_FONTFILE */ - #include <X11/fonts/fontenc.h> #include "fontencI.h" @@ -767,22 +753,21 @@ FontEncLoad(const char *encoding_name, const char *filename) char *new_name; int numaliases = 0; - new_name = xalloc(strlen(encoding_name) + 1); + new_name = strdup(encoding_name); if(new_name == NULL) return NULL; - strcpy(new_name, encoding_name); if(encoding->aliases) { for(alias = encoding->aliases; *alias; alias++) numaliases++; } - new_aliases = (char**)xalloc((numaliases+2)*sizeof(char*)); + new_aliases = malloc((numaliases+2)*sizeof(char*)); if(new_aliases == NULL) { - xfree(new_name); + free(new_name); return NULL; } if(encoding->aliases) { memcpy(new_aliases, encoding->aliases, numaliases*sizeof(char*)); - xfree(encoding->aliases); + free(encoding->aliases); } new_aliases[numaliases] = new_name; new_aliases[numaliases+1] = NULL; @@ -928,10 +913,8 @@ FontMapReverse(FontMapPtr mapping) return reverse; bail: - if(map) - xfree(map); - if(reverse) - xfree(reverse); + free(map); + free(reverse); return NULL; } @@ -945,9 +928,8 @@ FontMapReverseFree(FontMapReversePtr delendum) return; for(i = 0; i < FONTENC_SEGMENTS; i++) - if(map[i] != NULL) - xfree(map[i]); + free(map[i]); - xfree(map); + free(map); return; } diff --git a/lib/libfontenc/src/fontencI.h b/lib/libfontenc/src/fontencI.h index 741193a3b..9bba85ee1 100644 --- a/lib/libfontenc/src/fontencI.h +++ b/lib/libfontenc/src/fontencI.h @@ -20,8 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/lib/font/fontfile/fontencI.h,v 1.3 1999/04/25 10:01:43 dawes Exp $ */ - /* Private types and functions for the encoding code. */ /* Used by the files `fontenc.h' and `encparse.h' */ |