Added fontconfig and expat libs

This commit is contained in:
Sergii Pylypenko
2014-03-13 23:13:20 +02:00
parent 3061223a9c
commit f1289903a1
79 changed files with 47729 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
LOCAL_PATH:= $(call my-dir)
common_SRC_FILES := \
lib/xmlparse.c \
lib/xmlrole.c \
lib/xmltok.c
common_CFLAGS := \
-Wall \
-Wmissing-prototypes -Wstrict-prototypes \
-Wno-unused-parameter -Wno-missing-field-initializers \
-fexceptions \
-DHAVE_EXPAT_CONFIG_H \
-I$(LOCAL_PATH)/lib -I$(LOCAL_PATH)
common_C_INCLUDES += \
$(LOCAL_PATH)/include
common_COPY_HEADERS_TO := libexpat
common_COPY_HEADERS := \
lib/expat.h \
lib/expat_external.h
# Device shared library
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(common_SRC_FILES)
LOCAL_CFLAGS += $(common_CFLAGS)
LOCAL_C_INCLUDES += $(common_C_INCLUDES)
LOCAL_MODULE:= expat
include $(BUILD_SHARED_LIBRARY)

205
project/jni/expat/Changes Normal file
View File

@@ -0,0 +1,205 @@
Release 2.1.0 Sat March 24 2012
- Bug Fixes:
#1742315: Harmful XML_ParserCreateNS suggestion.
#2895533: CVE-2012-1147 - Resource leak in readfilemap.c.
#1785430: Expat build fails on linux-amd64 with gcc version>=4.1 -O3.
#1983953, 2517952, 2517962, 2649838:
Build modifications using autoreconf instead of buildconf.sh.
#2815947, #2884086: OBJEXT and EXEEXT support while building.
#1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences.
#2517938: xmlwf should return non-zero exit status if not well-formed.
#2517946: Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml.
#2855609: Dangling positionPtr after error.
#2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8().
#2958794: CVE-2012-1148 - Memory leak in poolGrow.
#2990652: CMake support.
#3010819: UNEXPECTED_STATE with a trailing "%" in entity value.
#3206497: Unitialized memory returned from XML_Parse.
#3287849: make check fails on mingw-w64.
#3496608: CVE-2012-0876 - Hash DOS attack.
- Patches:
#1749198: pkg-config support.
#3010222: Fix for bug #3010819.
#3312568: CMake support.
#3446384: Report byte offsets for attr names and values.
- New Features / API changes:
Added new API member XML_SetHashSalt() that allows setting an intial
value (salt) for hash calculations. This is part of the fix for
bug #3496608 to randomize hash parameters.
When compiled with XML_ATTR_INFO defined, adds new API member
XML_GetAttributeInfo() that allows retrieving the byte
offsets for attribute names and values (patch #3446384).
Added CMake build system.
See bug #2990652 and patch #3312568.
Added run-benchmark target to Makefile.in - relies on testdata module
present in the same relative location as in the repository.
Release 2.0.1 Tue June 5 2007
- Fixed bugs #1515266, #1515600: The character data handler's calling
of XML_StopParser() was not handled properly; if the parser was
stopped and the handler set to NULL, the parser would segfault.
- Fixed bug #1690883: Expat failed on EBCDIC systems as it assumed
some character constants to be ASCII encoded.
- Minor cleanups of the test harness.
- Fixed xmlwf bug #1513566: "out of memory" error on file size zero.
- Fixed outline.c bug #1543233: missing a final XML_ParserFree() call.
- Fixes and improvements for Windows platform:
bugs #1409451, #1476160, #1548182, #1602769, #1717322.
- Build fixes for various platforms:
HP-UX, Tru64, Solaris 9: patch #1437840, bug #1196180.
All Unix: #1554618 (refreshed config.sub/config.guess).
#1490371, #1613457: support both, DESTDIR and INSTALL_ROOT,
without relying on GNU-Make specific features.
#1647805: Patched configure.in to work better with Intel compiler.
- Fixes to Makefile.in to have make check work correctly:
bugs #1408143, #1535603, #1536684.
- Added Open Watcom support: patch #1523242.
Release 2.0.0 Wed Jan 11 2006
- We no longer use the "check" library for C unit testing; we
always use the (partial) internal implementation of the API.
- Report XML_NS setting via XML_GetFeatureList().
- Fixed headers for use from C++.
- XML_GetCurrentLineNumber() and XML_GetCurrentColumnNumber()
now return unsigned integers.
- Added XML_LARGE_SIZE switch to enable 64-bit integers for
byte indexes and line/column numbers.
- Updated to use libtool 1.5.22 (the most recent).
- Added support for AmigaOS.
- Some mostly minor bug fixes. SF issues include: #1006708,
#1021776, #1023646, #1114960, #1156398, #1221160, #1271642.
Release 1.95.8 Fri Jul 23 2004
- Major new feature: suspend/resume. Handlers can now request
that a parse be suspended for later resumption or aborted
altogether. See "Temporarily Stopping Parsing" in the
documentation for more details.
- Some mostly minor bug fixes, but compilation should no
longer generate warnings on most platforms. SF issues
include: #827319, #840173, #846309, #888329, #896188, #923913,
#928113, #961698, #985192.
Release 1.95.7 Mon Oct 20 2003
- Fixed enum XML_Status issue (reported on SourceForge many
times), so compilers that are properly picky will be happy.
- Introduced an XMLCALL macro to control the calling
convention used by the Expat API; this macro should be used
to annotate prototypes and definitions of callback
implementations in code compiled with a calling convention
other than the default convention for the host platform.
- Improved ability to build without the configure-generated
expat_config.h header. This is useful for applications
which embed Expat rather than linking in the library.
- Fixed a variety of bugs: see SF issues #458907, #609603,
#676844, #679754, #692878, #692964, #695401, #699323, #699487,
#820946.
- Improved hash table lookups.
- Added more regression tests and improved documentation.
Release 1.95.6 Tue Jan 28 2003
- Added XML_FreeContentModel().
- Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree().
- Fixed a variety of bugs: see SF issues #615606, #616863,
#618199, #653180, #673791.
- Enhanced the regression test suite.
- Man page improvements: includes SF issue #632146.
Release 1.95.5 Fri Sep 6 2002
- Added XML_UseForeignDTD() for improved SAX2 support.
- Added XML_GetFeatureList().
- Defined XML_Bool type and the values XML_TRUE and XML_FALSE.
- Use an incomplete struct instead of a void* for the parser
(may not retain).
- Fixed UTF-8 decoding bug that caused legal UTF-8 to be rejected.
- Finally fixed bug where default handler would report DTD
events that were already handled by another handler.
Initial patch contributed by Darryl Miles.
- Removed unnecessary DllMain() function that caused static
linking into a DLL to be difficult.
- Added VC++ projects for building static libraries.
- Reduced line-length for all source code and headers to be
no longer than 80 characters, to help with AS/400 support.
- Reduced memory copying during parsing (SF patch #600964).
- Fixed a variety of bugs: see SF issues #580793, #434664,
#483514, #580503, #581069, #584041, #584183, #584832, #585537,
#596555, #596678, #598352, #598944, #599715, #600479, #600971.
Release 1.95.4 Fri Jul 12 2002
- Added support for VMS, contributed by Craig Berry. See
vms/README.vms for more information.
- Added Mac OS (classic) support, with a makefile for MPW,
contributed by Thomas Wegner and Daryle Walker.
- Added Borland C++ Builder 5 / BCC 5.5 support, contributed
by Patrick McConnell (SF patch #538032).
- Fixed a variety of bugs: see SF issues #441449, #563184,
#564342, #566334, #566901, #569461, #570263, #575168, #579196.
- Made skippedEntityHandler conform to SAX2 (see source comment)
- Re-implemented WFC: Entity Declared from XML 1.0 spec and
added a new error "entity declared in parameter entity":
see SF bug report #569461 and SF patch #578161
- Re-implemented section 5.1 from XML 1.0 spec:
see SF bug report #570263 and SF patch #578161
Release 1.95.3 Mon Jun 3 2002
- Added a project to the MSVC workspace to create a wchar_t
version of the library; the DLLs are named libexpatw.dll.
- Changed the name of the Windows DLLs from expat.dll to
libexpat.dll; this fixes SF bug #432456.
- Added the XML_ParserReset() API function.
- Fixed XML_SetReturnNSTriplet() to work for element names.
- Made the XML_UNICODE builds usable (thanks, Karl!).
- Allow xmlwf to read from standard input.
- Install a man page for xmlwf on Unix systems.
- Fixed many bugs; see SF bug reports #231864, #461380, #464837,
#466885, #469226, #477667, #484419, #487840, #494749, #496505,
#547350. Other bugs which we can't test as easily may also
have been fixed, especially in the area of build support.
Release 1.95.2 Fri Jul 27 2001
- More changes to make MSVC happy with the build; add a single
workspace to support both the library and xmlwf application.
- Added a Windows installer for Windows users; includes
xmlwf.exe.
- Added compile-time constants that can be used to determine the
Expat version
- Removed a lot of GNU-specific dependencies to aide portability
among the various Unix flavors.
- Fix the UTF-8 BOM bug.
- Cleaned up warning messages for several compilers.
- Added the -Wall, -Wstrict-prototypes options for GCC.
Release 1.95.1 Sun Oct 22 15:11:36 EDT 2000
- Changes to get expat to build under Microsoft compiler
- Removed all aborts and instead return an UNEXPECTED_STATE error.
- Fixed a bug where a stray '%' in an entity value would cause an
abort.
- Defined XML_SetEndNamespaceDeclHandler. Thanks to Darryl Miles for
finding this oversight.
- Changed default patterns in lib/Makefile.in to fit non-GNU makes
Thanks to robin@unrated.net for reporting and providing an
account to test on.
- The reference had the wrong label for XML_SetStartNamespaceDecl.
Reported by an anonymous user.
Release 1.95.0 Fri Sep 29 2000
- XML_ParserCreate_MM
Allows you to set a memory management suite to replace the
standard malloc,realloc, and free.
- XML_SetReturnNSTriplet
If you turn this feature on when namespace processing is in
effect, then qualified, prefixed element and attribute names
are returned as "uri|name|prefix" where '|' is whatever
separator character is used in namespace processing.
- Merged in features from perl-expat
o XML_SetElementDeclHandler
o XML_SetAttlistDeclHandler
o XML_SetXmlDeclHandler
o XML_SetEntityDeclHandler
o StartDoctypeDeclHandler takes 3 additional parameters:
sysid, pubid, has_internal_subset
o Many paired handler setters (like XML_SetElementHandler)
now have corresponding individual handler setters
o XML_GetInputContext for getting the input context of
the current parse position.
- Added reference material
- Packaged into a distribution that builds a sharable library

22
project/jni/expat/NOTICE Normal file
View File

@@ -0,0 +1,22 @@
Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
and Clark Cooper
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

139
project/jni/expat/README Normal file
View File

@@ -0,0 +1,139 @@
Expat, Release 2.1.0
This is Expat, a C library for parsing XML, written by James Clark.
Expat is a stream-oriented XML parser. This means that you register
handlers with the parser before starting the parse. These handlers
are called when the parser discovers the associated structures in the
document being parsed. A start tag is an example of the kind of
structures for which you may register handlers.
Windows users should use the expat_win32bin package, which includes
both precompiled libraries and executables, and source code for
developers.
Expat is free software. You may copy, distribute, and modify it under
the terms of the License contained in the file COPYING distributed
with this package. This license is the same as the MIT/X Consortium
license.
Versions of Expat that have an odd minor version (the middle number in
the release above), are development releases and should be considered
as beta software. Releases with even minor version numbers are
intended to be production grade software.
If you are building Expat from a check-out from the CVS repository,
you need to run a script that generates the configure script using the
GNU autoconf and libtool tools. To do this, you need to have
autoconf 2.58 or newer. Run the script like this:
./buildconf.sh
Once this has been done, follow the same instructions as for building
from a source distribution.
To build Expat from a source distribution, you first run the
configuration shell script in the top level distribution directory:
./configure
There are many options which you may provide to configure (which you
can discover by running configure with the --help option). But the
one of most interest is the one that sets the installation directory.
By default, the configure script will set things up to install
libexpat into /usr/local/lib, expat.h into /usr/local/include, and
xmlwf into /usr/local/bin. If, for example, you'd prefer to install
into /home/me/mystuff/lib, /home/me/mystuff/include, and
/home/me/mystuff/bin, you can tell configure about that with:
./configure --prefix=/home/me/mystuff
Another interesting option is to enable 64-bit integer support for
line and column numbers and the over-all byte index:
./configure CPPFLAGS=-DXML_LARGE_SIZE
However, such a modification would be a breaking change to the ABI
and is therefore not recommended for general use - e.g. as part of
a Linux distribution - but rather for builds with special requirements.
After running the configure script, the "make" command will build
things and "make install" will install things into their proper
location. Have a look at the "Makefile" to learn about additional
"make" options. Note that you need to have write permission into
the directories into which things will be installed.
If you are interested in building Expat to provide document
information in UTF-16 encoding rather than the default UTF-8, follow
these instructions (after having run "make distclean"):
1. For UTF-16 output as unsigned short (and version/error
strings as char), run:
./configure CPPFLAGS=-DXML_UNICODE
For UTF-16 output as wchar_t (incl. version/error strings),
run:
./configure CFLAGS="-g -O2 -fshort-wchar" \
CPPFLAGS=-DXML_UNICODE_WCHAR_T
2. Edit the MakeFile, changing:
LIBRARY = libexpat.la
to:
LIBRARY = libexpatw.la
(Note the additional "w" in the library name.)
3. Run "make buildlib" (which builds the library only).
Or, to save step 2, run "make buildlib LIBRARY=libexpatw.la".
4. Run "make installlib" (which installs the library only).
Or, if step 2 was omitted, run "make installlib LIBRARY=libexpatw.la".
Using DESTDIR or INSTALL_ROOT is enabled, with INSTALL_ROOT being the default
value for DESTDIR, and the rest of the make file using only DESTDIR.
It works as follows:
$ make install DESTDIR=/path/to/image
overrides the in-makefile set DESTDIR, while both
$ INSTALL_ROOT=/path/to/image make install
$ make install INSTALL_ROOT=/path/to/image
use DESTDIR=$(INSTALL_ROOT), even if DESTDIR eventually is defined in the
environment, because variable-setting priority is
1) commandline
2) in-makefile
3) environment
Note: This only applies to the Expat library itself, building UTF-16 versions
of xmlwf and the tests is currently not supported.
Note for Solaris users: The "ar" command is usually located in
"/usr/ccs/bin", which is not in the default PATH. You will need to
add this to your path for the "make" command, and probably also switch
to GNU make (the "make" found in /usr/ccs/bin does not seem to work
properly -- appearantly it does not understand .PHONY directives). If
you're using ksh or bash, use this command to build:
PATH=/usr/ccs/bin:$PATH make
When using Expat with a project using autoconf for configuration, you
can use the probing macro in conftools/expat.m4 to determine how to
include Expat. See the comments at the top of that file for more
information.
A reference manual is available in the file doc/reference.html in this
distribution.
The homepage for this project is http://www.libexpat.org/. There
are links there to connect you to the bug reports page. If you need
to report a bug when you don't have access to a browser, you may also
send a bug report by email to expat-bugs@mail.libexpat.org.
Discussion related to the direction of future expat development takes
place on expat-discuss@mail.libexpat.org. Archives of this list and
other Expat-related lists may be found at:
http://mail.libexpat.org/mailman/listinfo/

View File

@@ -0,0 +1,103 @@
/* expat_config.h. Generated from expat_config.h.in by configure. */
/* expat_config.h.in. Generated from configure.in by autoheader. */
/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
#define BYTEORDER 1234
/* Define to 1 if you have the `bcopy' function. */
#define HAVE_BCOPY 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `getpagesize' function. */
#define HAVE_GETPAGESIZE 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have a working `mmap' system call. */
#define HAVE_MMAP 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "expat-bugs@libexpat.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "expat"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "expat 2.1.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "expat"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "2.1.0"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* whether byteorder is bigendian */
/* #undef WORDS_BIGENDIAN */
/* Define to specify how much context to retain around the current parse
point. */
#define XML_CONTEXT_BYTES 1024
/* Define to make parameter entity parsing functionality available. */
#define XML_DTD 1
/* Define to make XML Namespaces functionality available. */
#define XML_NS 1
/* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */
/* #undef __func__ */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */

View File

@@ -0,0 +1 @@
../lib/expat.h

View File

@@ -0,0 +1 @@
../lib/expat_external.h

View File

@@ -0,0 +1,92 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
#define ASCII_A 0x41
#define ASCII_B 0x42
#define ASCII_C 0x43
#define ASCII_D 0x44
#define ASCII_E 0x45
#define ASCII_F 0x46
#define ASCII_G 0x47
#define ASCII_H 0x48
#define ASCII_I 0x49
#define ASCII_J 0x4A
#define ASCII_K 0x4B
#define ASCII_L 0x4C
#define ASCII_M 0x4D
#define ASCII_N 0x4E
#define ASCII_O 0x4F
#define ASCII_P 0x50
#define ASCII_Q 0x51
#define ASCII_R 0x52
#define ASCII_S 0x53
#define ASCII_T 0x54
#define ASCII_U 0x55
#define ASCII_V 0x56
#define ASCII_W 0x57
#define ASCII_X 0x58
#define ASCII_Y 0x59
#define ASCII_Z 0x5A
#define ASCII_a 0x61
#define ASCII_b 0x62
#define ASCII_c 0x63
#define ASCII_d 0x64
#define ASCII_e 0x65
#define ASCII_f 0x66
#define ASCII_g 0x67
#define ASCII_h 0x68
#define ASCII_i 0x69
#define ASCII_j 0x6A
#define ASCII_k 0x6B
#define ASCII_l 0x6C
#define ASCII_m 0x6D
#define ASCII_n 0x6E
#define ASCII_o 0x6F
#define ASCII_p 0x70
#define ASCII_q 0x71
#define ASCII_r 0x72
#define ASCII_s 0x73
#define ASCII_t 0x74
#define ASCII_u 0x75
#define ASCII_v 0x76
#define ASCII_w 0x77
#define ASCII_x 0x78
#define ASCII_y 0x79
#define ASCII_z 0x7A
#define ASCII_0 0x30
#define ASCII_1 0x31
#define ASCII_2 0x32
#define ASCII_3 0x33
#define ASCII_4 0x34
#define ASCII_5 0x35
#define ASCII_6 0x36
#define ASCII_7 0x37
#define ASCII_8 0x38
#define ASCII_9 0x39
#define ASCII_TAB 0x09
#define ASCII_SPACE 0x20
#define ASCII_EXCL 0x21
#define ASCII_QUOT 0x22
#define ASCII_AMP 0x26
#define ASCII_APOS 0x27
#define ASCII_MINUS 0x2D
#define ASCII_PERIOD 0x2E
#define ASCII_COLON 0x3A
#define ASCII_SEMI 0x3B
#define ASCII_LT 0x3C
#define ASCII_EQUALS 0x3D
#define ASCII_GT 0x3E
#define ASCII_LSQB 0x5B
#define ASCII_RSQB 0x5D
#define ASCII_UNDERSCORE 0x5F
#define ASCII_LPAREN 0x28
#define ASCII_RPAREN 0x29
#define ASCII_FF 0x0C
#define ASCII_SLASH 0x2F
#define ASCII_HASH 0x23
#define ASCII_PIPE 0x7C
#define ASCII_COMMA 0x2C

View File

@@ -0,0 +1,36 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,115 @@
/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
#ifndef Expat_External_INCLUDED
#define Expat_External_INCLUDED 1
/* External API definitions */
#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
#define XML_USE_MSC_EXTENSIONS 1
#endif
/* Expat tries very hard to make the API boundary very specifically
defined. There are two macros defined to control this boundary;
each of these can be defined before including this header to
achieve some different behavior, but doing so it not recommended or
tested frequently.
XMLCALL - The calling convention to use for all calls across the
"library boundary." This will default to cdecl, and
try really hard to tell the compiler that's what we
want.
XMLIMPORT - Whatever magic is needed to note that a function is
to be imported from a dynamically loaded library
(.dll, .so, or .sl, depending on your platform).
The XMLCALL macro was added in Expat 1.95.7. The only one which is
expected to be directly useful in client code is XMLCALL.
Note that on at least some Unix versions, the Expat library must be
compiled with the cdecl calling convention as the default since
system headers may assume the cdecl convention.
*/
#ifndef XMLCALL
#if defined(_MSC_VER)
#define XMLCALL __cdecl
#elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
#define XMLCALL __attribute__((cdecl))
#else
/* For any platform which uses this definition and supports more than
one calling convention, we need to extend this definition to
declare the convention used on that platform, if it's possible to
do so.
If this is the case for your platform, please file a bug report
with information on how to identify your platform via the C
pre-processor and how to specify the same calling convention as the
platform's malloc() implementation.
*/
#define XMLCALL
#endif
#endif /* not defined XMLCALL */
#if !defined(XML_STATIC) && !defined(XMLIMPORT)
#ifndef XML_BUILDING_EXPAT
/* using Expat from an application */
#ifdef XML_USE_MSC_EXTENSIONS
#define XMLIMPORT __declspec(dllimport)
#endif
#endif
#endif /* not defined XML_STATIC */
/* If we didn't define it above, define it away: */
#ifndef XMLIMPORT
#define XMLIMPORT
#endif
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
#ifdef __cplusplus
extern "C" {
#endif
#ifdef XML_UNICODE_WCHAR_T
#define XML_UNICODE
#endif
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
#ifdef XML_UNICODE_WCHAR_T
typedef wchar_t XML_Char;
typedef wchar_t XML_LChar;
#else
typedef unsigned short XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE_WCHAR_T */
#else /* Information is UTF-8 encoded. */
typedef char XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE */
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
typedef __int64 XML_Index;
typedef unsigned __int64 XML_Size;
#else
typedef long long XML_Index;
typedef unsigned long long XML_Size;
#endif
#else
typedef long XML_Index;
typedef unsigned long XML_Size;
#endif /* XML_LARGE_SIZE */
#ifdef __cplusplus
}
#endif
#endif /* not Expat_External_INCLUDED */

View File

@@ -0,0 +1,37 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,

View File

@@ -0,0 +1,73 @@
/* internal.h
Internal definitions used by Expat. This is not needed to compile
client code.
The following calling convention macros are defined for frequently
called functions:
FASTCALL - Used for those internal functions that have a simple
body and a low number of arguments and local variables.
PTRCALL - Used for functions called though function pointers.
PTRFASTCALL - Like PTRCALL, but for low number of arguments.
inline - Used for selected internal functions for which inlining
may improve performance on some platforms.
Note: Use of these macros is based on judgement, not hard rules,
and therefore subject to change.
*/
#if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__)
/* We'll use this version by default only where we know it helps.
regparm() generates warnings on Solaris boxes. See SF bug #692878.
Instability reported with egcs on a RedHat Linux 7.3.
Let's comment out:
#define FASTCALL __attribute__((stdcall, regparm(3)))
and let's try this:
*/
#define FASTCALL __attribute__((regparm(3)))
#define PTRFASTCALL __attribute__((regparm(3)))
#endif
/* Using __fastcall seems to have an unexpected negative effect under
MS VC++, especially for function pointers, so we won't use it for
now on that platform. It may be reconsidered for a future release
if it can be made more effective.
Likely reason: __fastcall on Windows is like stdcall, therefore
the compiler cannot perform stack optimizations for call clusters.
*/
/* Make sure all of these are defined if they aren't already. */
#ifndef FASTCALL
#define FASTCALL
#endif
#ifndef PTRCALL
#define PTRCALL
#endif
#ifndef PTRFASTCALL
#define PTRFASTCALL
#endif
#ifndef XML_MIN_SIZE
#if !defined(__cplusplus) && !defined(inline)
#ifdef __GNUC__
#define inline __inline
#endif /* __GNUC__ */
#endif
#endif /* XML_MIN_SIZE */
#ifdef __cplusplus
#define inline inline
#else
#ifndef inline
#define inline
#endif
#endif

View File

@@ -0,0 +1,36 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME,
/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,

View File

@@ -0,0 +1,150 @@
static const unsigned namingBitmap[] = {
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE,
0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF,
0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF,
0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF,
0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000,
0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060,
0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003,
0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003,
0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000,
0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001,
0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003,
0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000,
0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003,
0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003,
0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000,
0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000,
0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF,
0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB,
0x40000000, 0xF580C900, 0x00000007, 0x02010800,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF,
0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF,
0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF,
0x00000000, 0x00004C40, 0x00000000, 0x00000000,
0x00000007, 0x00000000, 0x00000000, 0x00000000,
0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF,
0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF,
0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000,
0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE,
0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF,
0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003,
0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF,
0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF,
0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF,
0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF,
0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF,
0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0,
0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1,
0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3,
0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80,
0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3,
0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3,
0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000,
0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000,
0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF,
0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x1FFF0000, 0x00000002,
0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF,
0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF,
};
static const unsigned char nmstrtPages[] = {
0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00,
0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static const unsigned char namePages[] = {
0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00,
0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};

View File

@@ -0,0 +1,37 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4,
/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,114 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
#ifndef XmlRole_INCLUDED
#define XmlRole_INCLUDED 1
#ifdef __VMS
/* 0 1 2 3 0 1 2 3
1234567890123456789012345678901 1234567890123456789012345678901 */
#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt
#endif
#include "xmltok.h"
#ifdef __cplusplus
extern "C" {
#endif
enum {
XML_ROLE_ERROR = -1,
XML_ROLE_NONE = 0,
XML_ROLE_XML_DECL,
XML_ROLE_INSTANCE_START,
XML_ROLE_DOCTYPE_NONE,
XML_ROLE_DOCTYPE_NAME,
XML_ROLE_DOCTYPE_SYSTEM_ID,
XML_ROLE_DOCTYPE_PUBLIC_ID,
XML_ROLE_DOCTYPE_INTERNAL_SUBSET,
XML_ROLE_DOCTYPE_CLOSE,
XML_ROLE_GENERAL_ENTITY_NAME,
XML_ROLE_PARAM_ENTITY_NAME,
XML_ROLE_ENTITY_NONE,
XML_ROLE_ENTITY_VALUE,
XML_ROLE_ENTITY_SYSTEM_ID,
XML_ROLE_ENTITY_PUBLIC_ID,
XML_ROLE_ENTITY_COMPLETE,
XML_ROLE_ENTITY_NOTATION_NAME,
XML_ROLE_NOTATION_NONE,
XML_ROLE_NOTATION_NAME,
XML_ROLE_NOTATION_SYSTEM_ID,
XML_ROLE_NOTATION_NO_SYSTEM_ID,
XML_ROLE_NOTATION_PUBLIC_ID,
XML_ROLE_ATTRIBUTE_NAME,
XML_ROLE_ATTRIBUTE_TYPE_CDATA,
XML_ROLE_ATTRIBUTE_TYPE_ID,
XML_ROLE_ATTRIBUTE_TYPE_IDREF,
XML_ROLE_ATTRIBUTE_TYPE_IDREFS,
XML_ROLE_ATTRIBUTE_TYPE_ENTITY,
XML_ROLE_ATTRIBUTE_TYPE_ENTITIES,
XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN,
XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS,
XML_ROLE_ATTRIBUTE_ENUM_VALUE,
XML_ROLE_ATTRIBUTE_NOTATION_VALUE,
XML_ROLE_ATTLIST_NONE,
XML_ROLE_ATTLIST_ELEMENT_NAME,
XML_ROLE_IMPLIED_ATTRIBUTE_VALUE,
XML_ROLE_REQUIRED_ATTRIBUTE_VALUE,
XML_ROLE_DEFAULT_ATTRIBUTE_VALUE,
XML_ROLE_FIXED_ATTRIBUTE_VALUE,
XML_ROLE_ELEMENT_NONE,
XML_ROLE_ELEMENT_NAME,
XML_ROLE_CONTENT_ANY,
XML_ROLE_CONTENT_EMPTY,
XML_ROLE_CONTENT_PCDATA,
XML_ROLE_GROUP_OPEN,
XML_ROLE_GROUP_CLOSE,
XML_ROLE_GROUP_CLOSE_REP,
XML_ROLE_GROUP_CLOSE_OPT,
XML_ROLE_GROUP_CLOSE_PLUS,
XML_ROLE_GROUP_CHOICE,
XML_ROLE_GROUP_SEQUENCE,
XML_ROLE_CONTENT_ELEMENT,
XML_ROLE_CONTENT_ELEMENT_REP,
XML_ROLE_CONTENT_ELEMENT_OPT,
XML_ROLE_CONTENT_ELEMENT_PLUS,
XML_ROLE_PI,
XML_ROLE_COMMENT,
#ifdef XML_DTD
XML_ROLE_TEXT_DECL,
XML_ROLE_IGNORE_SECT,
XML_ROLE_INNER_PARAM_ENTITY_REF,
#endif /* XML_DTD */
XML_ROLE_PARAM_ENTITY_REF
};
typedef struct prolog_state {
int (PTRCALL *handler) (struct prolog_state *state,
int tok,
const char *ptr,
const char *end,
const ENCODING *enc);
unsigned level;
int role_none;
#ifdef XML_DTD
unsigned includeLevel;
int documentEntity;
int inEntityValue;
#endif /* XML_DTD */
} PROLOG_STATE;
void XmlPrologStateInit(PROLOG_STATE *);
#ifdef XML_DTD
void XmlPrologStateInitExternalEntity(PROLOG_STATE *);
#endif /* XML_DTD */
#define XmlTokenRole(state, tok, ptr, end, enc) \
(((state)->handler)(state, tok, ptr, end, enc))
#ifdef __cplusplus
}
#endif
#endif /* not XmlRole_INCLUDED */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,316 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
#ifndef XmlTok_INCLUDED
#define XmlTok_INCLUDED 1
#ifdef __cplusplus
extern "C" {
#endif
/* The following token may be returned by XmlContentTok */
#define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be
start of illegal ]]> sequence */
/* The following tokens may be returned by both XmlPrologTok and
XmlContentTok.
*/
#define XML_TOK_NONE -4 /* The string to be scanned is empty */
#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan;
might be part of CRLF sequence */
#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
#define XML_TOK_PARTIAL -1 /* only part of a token */
#define XML_TOK_INVALID 0
/* The following tokens are returned by XmlContentTok; some are also
returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok.
*/
#define XML_TOK_START_TAG_WITH_ATTS 1
#define XML_TOK_START_TAG_NO_ATTS 2
#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag <e/> */
#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4
#define XML_TOK_END_TAG 5
#define XML_TOK_DATA_CHARS 6
#define XML_TOK_DATA_NEWLINE 7
#define XML_TOK_CDATA_SECT_OPEN 8
#define XML_TOK_ENTITY_REF 9
#define XML_TOK_CHAR_REF 10 /* numeric character reference */
/* The following tokens may be returned by both XmlPrologTok and
XmlContentTok.
*/
#define XML_TOK_PI 11 /* processing instruction */
#define XML_TOK_XML_DECL 12 /* XML decl or text decl */
#define XML_TOK_COMMENT 13
#define XML_TOK_BOM 14 /* Byte order mark */
/* The following tokens are returned only by XmlPrologTok */
#define XML_TOK_PROLOG_S 15
#define XML_TOK_DECL_OPEN 16 /* <!foo */
#define XML_TOK_DECL_CLOSE 17 /* > */
#define XML_TOK_NAME 18
#define XML_TOK_NMTOKEN 19
#define XML_TOK_POUND_NAME 20 /* #name */
#define XML_TOK_OR 21 /* | */
#define XML_TOK_PERCENT 22
#define XML_TOK_OPEN_PAREN 23
#define XML_TOK_CLOSE_PAREN 24
#define XML_TOK_OPEN_BRACKET 25
#define XML_TOK_CLOSE_BRACKET 26
#define XML_TOK_LITERAL 27
#define XML_TOK_PARAM_ENTITY_REF 28
#define XML_TOK_INSTANCE_START 29
/* The following occur only in element type declarations */
#define XML_TOK_NAME_QUESTION 30 /* name? */
#define XML_TOK_NAME_ASTERISK 31 /* name* */
#define XML_TOK_NAME_PLUS 32 /* name+ */
#define XML_TOK_COND_SECT_OPEN 33 /* <![ */
#define XML_TOK_COND_SECT_CLOSE 34 /* ]]> */
#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */
#define XML_TOK_COMMA 38
/* The following token is returned only by XmlAttributeValueTok */
#define XML_TOK_ATTRIBUTE_VALUE_S 39
/* The following token is returned only by XmlCdataSectionTok */
#define XML_TOK_CDATA_SECT_CLOSE 40
/* With namespace processing this is returned by XmlPrologTok for a
name with a colon.
*/
#define XML_TOK_PREFIXED_NAME 41
#ifdef XML_DTD
#define XML_TOK_IGNORE_SECT 42
#endif /* XML_DTD */
#ifdef XML_DTD
#define XML_N_STATES 4
#else /* not XML_DTD */
#define XML_N_STATES 3
#endif /* not XML_DTD */
#define XML_PROLOG_STATE 0
#define XML_CONTENT_STATE 1
#define XML_CDATA_SECTION_STATE 2
#ifdef XML_DTD
#define XML_IGNORE_SECTION_STATE 3
#endif /* XML_DTD */
#define XML_N_LITERAL_TYPES 2
#define XML_ATTRIBUTE_VALUE_LITERAL 0
#define XML_ENTITY_VALUE_LITERAL 1
/* The size of the buffer passed to XmlUtf8Encode must be at least this. */
#define XML_UTF8_ENCODE_MAX 4
/* The size of the buffer passed to XmlUtf16Encode must be at least this. */
#define XML_UTF16_ENCODE_MAX 2
typedef struct position {
/* first line and first column are 0 not 1 */
XML_Size lineNumber;
XML_Size columnNumber;
} POSITION;
typedef struct {
const char *name;
const char *valuePtr;
const char *valueEnd;
char normalized;
} ATTRIBUTE;
struct encoding;
typedef struct encoding ENCODING;
typedef int (PTRCALL *SCANNER)(const ENCODING *,
const char *,
const char *,
const char **);
struct encoding {
SCANNER scanners[XML_N_STATES];
SCANNER literalScanners[XML_N_LITERAL_TYPES];
int (PTRCALL *sameName)(const ENCODING *,
const char *,
const char *);
int (PTRCALL *nameMatchesAscii)(const ENCODING *,
const char *,
const char *,
const char *);
int (PTRFASTCALL *nameLength)(const ENCODING *, const char *);
const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *);
int (PTRCALL *getAtts)(const ENCODING *enc,
const char *ptr,
int attsMax,
ATTRIBUTE *atts);
int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr);
int (PTRCALL *predefinedEntityName)(const ENCODING *,
const char *,
const char *);
void (PTRCALL *updatePosition)(const ENCODING *,
const char *ptr,
const char *end,
POSITION *);
int (PTRCALL *isPublicId)(const ENCODING *enc,
const char *ptr,
const char *end,
const char **badPtr);
void (PTRCALL *utf8Convert)(const ENCODING *enc,
const char **fromP,
const char *fromLim,
char **toP,
const char *toLim);
void (PTRCALL *utf16Convert)(const ENCODING *enc,
const char **fromP,
const char *fromLim,
unsigned short **toP,
const unsigned short *toLim);
int minBytesPerChar;
char isUtf8;
char isUtf16;
};
/* Scan the string starting at ptr until the end of the next complete
token, but do not scan past eptr. Return an integer giving the
type of token.
Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set.
Return XML_TOK_PARTIAL when the string does not contain a complete
token; nextTokPtr will not be set.
Return XML_TOK_INVALID when the string does not start a valid
token; nextTokPtr will be set to point to the character which made
the token invalid.
Otherwise the string starts with a valid token; nextTokPtr will be
set to point to the character following the end of that token.
Each data character counts as a single token, but adjacent data
characters may be returned together. Similarly for characters in
the prolog outside literals, comments and processing instructions.
*/
#define XmlTok(enc, state, ptr, end, nextTokPtr) \
(((enc)->scanners[state])(enc, ptr, end, nextTokPtr))
#define XmlPrologTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
#define XmlContentTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
#ifdef XML_DTD
#define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr)
#endif /* XML_DTD */
/* This is used for performing a 2nd-level tokenization on the content
of a literal that has already been returned by XmlTok.
*/
#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
(((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \
XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
#define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2))
#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
(((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
#define XmlNameLength(enc, ptr) \
(((enc)->nameLength)(enc, ptr))
#define XmlSkipS(enc, ptr) \
(((enc)->skipS)(enc, ptr))
#define XmlGetAttributes(enc, ptr, attsMax, atts) \
(((enc)->getAtts)(enc, ptr, attsMax, atts))
#define XmlCharRefNumber(enc, ptr) \
(((enc)->charRefNumber)(enc, ptr))
#define XmlPredefinedEntityName(enc, ptr, end) \
(((enc)->predefinedEntityName)(enc, ptr, end))
#define XmlUpdatePosition(enc, ptr, end, pos) \
(((enc)->updatePosition)(enc, ptr, end, pos))
#define XmlIsPublicId(enc, ptr, end, badPtr) \
(((enc)->isPublicId)(enc, ptr, end, badPtr))
#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \
(((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \
(((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim))
typedef struct {
ENCODING initEnc;
const ENCODING **encPtr;
} INIT_ENCODING;
int XmlParseXmlDecl(int isGeneralTextEntity,
const ENCODING *enc,
const char *ptr,
const char *end,
const char **badPtr,
const char **versionPtr,
const char **versionEndPtr,
const char **encodingNamePtr,
const ENCODING **namedEncodingPtr,
int *standalonePtr);
int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
const ENCODING *XmlGetUtf8InternalEncoding(void);
const ENCODING *XmlGetUtf16InternalEncoding(void);
int FASTCALL XmlUtf8Encode(int charNumber, char *buf);
int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf);
int XmlSizeOfUnknownEncoding(void);
typedef int (XMLCALL *CONVERTER) (void *userData, const char *p);
ENCODING *
XmlInitUnknownEncoding(void *mem,
int *table,
CONVERTER convert,
void *userData);
int XmlParseXmlDeclNS(int isGeneralTextEntity,
const ENCODING *enc,
const char *ptr,
const char *end,
const char **badPtr,
const char **versionPtr,
const char **versionEndPtr,
const char **encodingNamePtr,
const ENCODING **namedEncodingPtr,
int *standalonePtr);
int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
const ENCODING *XmlGetUtf8InternalEncodingNS(void);
const ENCODING *XmlGetUtf16InternalEncodingNS(void);
ENCODING *
XmlInitUnknownEncodingNS(void *mem,
int *table,
CONVERTER convert,
void *userData);
#ifdef __cplusplus
}
#endif
#endif /* not XmlTok_INCLUDED */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,46 @@
/*
Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
enum {
BT_NONXML,
BT_MALFORM,
BT_LT,
BT_AMP,
BT_RSQB,
BT_LEAD2,
BT_LEAD3,
BT_LEAD4,
BT_TRAIL,
BT_CR,
BT_LF,
BT_GT,
BT_QUOT,
BT_APOS,
BT_EQUALS,
BT_QUEST,
BT_EXCL,
BT_SOL,
BT_SEMI,
BT_NUM,
BT_LSQB,
BT_S,
BT_NMSTRT,
BT_COLON,
BT_HEX,
BT_DIGIT,
BT_NAME,
BT_MINUS,
BT_OTHER, /* known not to be a name or name start character */
BT_NONASCII, /* might be a name or name start character */
BT_PERCNT,
BT_LPAR,
BT_RPAR,
BT_AST,
BT_PLUS,
BT_COMMA,
BT_VERBAR
};
#include <stddef.h>

View File

@@ -0,0 +1,115 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* This file is included! */
#ifdef XML_TOK_NS_C
const ENCODING *
NS(XmlGetUtf8InternalEncoding)(void)
{
return &ns(internal_utf8_encoding).enc;
}
const ENCODING *
NS(XmlGetUtf16InternalEncoding)(void)
{
#if BYTEORDER == 1234
return &ns(internal_little2_encoding).enc;
#elif BYTEORDER == 4321
return &ns(internal_big2_encoding).enc;
#else
const short n = 1;
return (*(const char *)&n
? &ns(internal_little2_encoding).enc
: &ns(internal_big2_encoding).enc);
#endif
}
static const ENCODING * const NS(encodings)[] = {
&ns(latin1_encoding).enc,
&ns(ascii_encoding).enc,
&ns(utf8_encoding).enc,
&ns(big2_encoding).enc,
&ns(big2_encoding).enc,
&ns(little2_encoding).enc,
&ns(utf8_encoding).enc /* NO_ENC */
};
static int PTRCALL
NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
return initScan(NS(encodings), (const INIT_ENCODING *)enc,
XML_PROLOG_STATE, ptr, end, nextTokPtr);
}
static int PTRCALL
NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
return initScan(NS(encodings), (const INIT_ENCODING *)enc,
XML_CONTENT_STATE, ptr, end, nextTokPtr);
}
int
NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
const char *name)
{
int i = getEncodingIndex(name);
if (i == UNKNOWN_ENC)
return 0;
SET_INIT_ENC_INDEX(p, i);
p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog);
p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent);
p->initEnc.updatePosition = initUpdatePosition;
p->encPtr = encPtr;
*encPtr = &(p->initEnc);
return 1;
}
static const ENCODING *
NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end)
{
#define ENCODING_MAX 128
char buf[ENCODING_MAX];
char *p = buf;
int i;
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
if (ptr != end)
return 0;
*p = 0;
if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2)
return enc;
i = getEncodingIndex(buf);
if (i == UNKNOWN_ENC)
return 0;
return NS(encodings)[i];
}
int
NS(XmlParseXmlDecl)(int isGeneralTextEntity,
const ENCODING *enc,
const char *ptr,
const char *end,
const char **badPtr,
const char **versionPtr,
const char **versionEndPtr,
const char **encodingName,
const ENCODING **encoding,
int *standalone)
{
return doParseXmlDecl(NS(findEncoding),
isGeneralTextEntity,
enc,
ptr,
end,
badPtr,
versionPtr,
versionEndPtr,
encodingName,
encoding,
standalone);
}
#endif /* XML_TOK_NS_C */

View File

@@ -0,0 +1,3 @@
Keith Packard <keithp@keithp.com>
Patrick Lam <plam@mit.edu>

View File

@@ -0,0 +1,26 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := fontconfig
LOCAL_CFLAGS := -DFONTCONFIG_PATH=\".fontconfig\"
LOCAL_CFLAGS += -DFC_CACHEDIR=\".font-cache\"
LOCAL_CFLAGS += -DFC_DEFAULT_FONTS=\"/system/fonts\"
LOCAL_CFLAGS += -I$(LOCAL_PATH) -I$(LOCAL_PATH)/src
LOCAL_CFLAGS += -DHAVE_CONFIG_H
LOCAL_SHARED_LIBRARIES := freetype expat
LOCAL_LDLIBS := -lz
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/../freetype/include \
$(LOCAL_PATH)/../expat/include
LOCAL_SRC_FILES := $(addprefix src/, $(notdir $(wildcard $(LOCAL_PATH)/src/*.c) $(wildcard $(LOCAL_PATH)/src/*.cpp)))
include $(BUILD_SHARED_LIBRARY)

View File

@@ -0,0 +1,28 @@
fontconfig/COPYING
Copyright © 2000,2001,2002,2003,2004,2006,2007 Keith Packard
Copyright © 2005 Patrick Lam
Copyright © 2009 Roozbeh Pournader
Copyright © 2008,2009 Red Hat, Inc.
Copyright © 2008 Danilo Šegan
Copyright © 2012 Google, Inc.
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of the author(s) not be used in
advertising or publicity pertaining to distribution of the software without
specific, written prior permission. The authors make no
representations about the suitability of this software for any purpose. It
is provided "as is" without express or implied warranty.
THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
/*
* Copyright 息 2006 Keith Packard
* Copyright 息 2010 Behdad Esfahbod
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* This header file is supposed to be included in config.h */
/* just a hack to build the fat binaries:
* https://bugs.freedesktop.org/show_bug.cgi?id=20208
*/
#ifdef __APPLE__
# include <machine/endian.h>
# undef SIZEOF_VOID_P
# undef ALIGNOF_DOUBLE
# ifdef __LP64__
# define SIZEOF_VOID_P 8
# define ALIGNOF_DOUBLE 8
# else
# define SIZEOF_VOID_P 4
# define ALIGNOF_DOUBLE 4
# endif
#endif

View File

@@ -0,0 +1,374 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* The normal alignment of `double', in bytes. */
#define ALIGNOF_DOUBLE 8
/* Use libxml2 instead of Expat */
/* #undef ENABLE_LIBXML2 */
/* Additional font directories */
#define FC_ADD_FONTS "yes"
/* Architecture prefix to use for cache file names */
/* #undef FC_ARCHITECTURE */
/* System font directory */
// #define FC_DEFAULT_FONTS "/system/fonts"
/* Define to nothing if C supports flexible array members, and to 1 if it does
not. That way, with a declaration like `struct s { int n; double
d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
compilers. When computing the size of such an object, don't use 'sizeof
(struct s)' as it overestimates the size. Use 'offsetof (struct s, d)'
instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with
MSVC and with C++ compilers. */
#define FLEXIBLE_ARRAY_MEMBER /**/
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `fstatfs' function. */
#define HAVE_FSTATFS 1
/* Define to 1 if you have the `fstatvfs' function. */
#define HAVE_FSTATVFS 1
/* FT_Bitmap_Size structure includes y_ppem field */
#define HAVE_FT_BITMAP_SIZE_Y_PPEM 1
/* Define to 1 if you have the `FT_Get_BDF_Property' function. */
#define HAVE_FT_GET_BDF_PROPERTY 1
/* Define to 1 if you have the `FT_Get_Next_Char' function. */
#define HAVE_FT_GET_NEXT_CHAR 1
/* Define to 1 if you have the `FT_Get_PS_Font_Info' function. */
#define HAVE_FT_GET_PS_FONT_INFO 1
/* Define to 1 if you have the `FT_Get_X11_Font_Format' function. */
#define HAVE_FT_GET_X11_FONT_FORMAT 1
/* Define to 1 if you have the `FT_Has_PS_Glyph_Names' function. */
#define HAVE_FT_HAS_PS_GLYPH_NAMES 1
/* Define to 1 if you have the `FT_Select_Size' function. */
#define HAVE_FT_SELECT_SIZE 1
/* Define to 1 if you have the `getexecname' function. */
/* #undef HAVE_GETEXECNAME */
/* Define to 1 if you have the `getopt' function. */
// #define HAVE_GETOPT 1
/* Define to 1 if you have the `getopt_long' function. */
// #define HAVE_GETOPT_LONG 1
/* Define to 1 if you have the `getpagesize' function. */
// #define HAVE_GETPAGESIZE 1
/* Define to 1 if you have the `getprogname' function. */
/* #undef HAVE_GETPROGNAME */
/* Have Intel __sync_* atomic primitives */
// #define HAVE_INTEL_ATOMIC_PRIMITIVES 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `link' function. */
#define HAVE_LINK 1
/* Define to 1 if you have the `lrand48' function. */
#define HAVE_LRAND48 1
/* Define to 1 if you have the `lstat' function. */
#define HAVE_LSTAT 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mkdtemp' function. */
#define HAVE_MKDTEMP 1
/* Define to 1 if you have the `mkostemp' function. */
// #define HAVE_MKOSTEMP 1
/* Define to 1 if you have the `mkstemp' function. */
#define HAVE_MKSTEMP 1
/* Define to 1 if you have a working `mmap' system call. */
#define HAVE_MMAP 1
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the 'posix_fadivse' function. */
// #define HAVE_POSIX_FADVISE 1
/* Have POSIX threads */
#define HAVE_PTHREAD 1
/* Have PTHREAD_PRIO_INHERIT. */
//#define HAVE_PTHREAD_PRIO_INHERIT 1
/* Define to 1 if you have the `rand' function. */
#define HAVE_RAND 1
/* Define to 1 if you have the `random' function. */
//#define HAVE_RANDOM 1
/* Define to 1 if you have the `random_r' function. */
//#define HAVE_RANDOM_R 1
/* Define to 1 if you have the `rand_r' function. */
//#define HAVE_RAND_R 1
/* Define to 1 if you have the `readlink' function. */
#define HAVE_READLINK 1
/* Define to 1 if you have the `regcomp' function. */
#define HAVE_REGCOMP 1
/* Define to 1 if you have the `regerror' function. */
#define HAVE_REGERROR 1
/* Define to 1 if you have the `regexec' function. */
#define HAVE_REGEXEC 1
/* Define to 1 if you have the <regex.h> header file. */
#define HAVE_REGEX_H 1
/* Define to 1 if you have the `regfree' function. */
#define HAVE_REGFREE 1
/* Define to 1 if you have the 'scandir' function. */
#define HAVE_SCANDIR 1
/* Define to 1 if you have the 'scandir' function with int (* compar)(const
void *, const void *) */
/* #undef HAVE_SCANDIR_VOID_P */
/* Define to 1 if you have the <sched.h> header file. */
/* #undef HAVE_SCHED_H */
/* Have sched_yield */
/* #undef HAVE_SCHED_YIELD */
/* Have Solaris __machine_*_barrier and atomic_* operations */
/* #undef HAVE_SOLARIS_ATOMIC_OPS */
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if `d_type' is a member of `struct dirent'. */
#define HAVE_STRUCT_DIRENT_D_TYPE 1
/* Define to 1 if `f_flags' is a member of `struct statfs'. */
#define HAVE_STRUCT_STATFS_F_FLAGS 1
/* Define to 1 if `f_fstypename' is a member of `struct statfs'. */
/* #undef HAVE_STRUCT_STATFS_F_FSTYPENAME */
/* Define to 1 if `f_basetype' is a member of `struct statvfs'. */
/* #undef HAVE_STRUCT_STATVFS_F_BASETYPE */
/* Define to 1 if `f_fstypename' is a member of `struct statvfs'. */
/* #undef HAVE_STRUCT_STATVFS_F_FSTYPENAME */
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/mount.h> header file. */
//#define HAVE_SYS_MOUNT_H 1
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/statfs.h> header file. */
//#define HAVE_SYS_STATFS_H 1
/* Define to 1 if you have the <sys/statvfs.h> header file. */
//#define HAVE_SYS_STATVFS_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/vfs.h> header file. */
#define HAVE_SYS_VFS_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1
/* Can use #warning in C files */
#define HAVE_WARNING_CPP_DIRECTIVE 1
/* Use xmlparse.h instead of expat.h */
/* #undef HAVE_XMLPARSE_H */
/* Define to 1 if you have the `XML_SetDoctypeDeclHandler' function. */
//#define HAVE_XML_SETDOCTYPEDECLHANDLER 1
/* Define to 1 if you have the `_mktemp_s' function. */
/* #undef HAVE__MKTEMP_S */
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"
/* Name of package */
#define PACKAGE "fontconfig"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=fontconfig"
/* Define to the full name of this package. */
#define PACKAGE_NAME "fontconfig"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "fontconfig 2.11.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "fontconfig"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "2.11.0"
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
/* #undef PTHREAD_CREATE_JOINABLE */
/* The size of `char', as computed by sizeof. */
/* #undef SIZEOF_CHAR */
/* The size of `int', as computed by sizeof. */
/* #undef SIZEOF_INT */
/* The size of `long', as computed by sizeof. */
/* #undef SIZEOF_LONG */
/* The size of `short', as computed by sizeof. */
/* #undef SIZEOF_SHORT */
/* The size of `void*', as computed by sizeof. */
/* #undef SIZEOF_VOIDP */
/* The size of `void *', as computed by sizeof. */
#define SIZEOF_VOID_P 4
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Use iconv. */
#define USE_ICONV 0
/* Use regex */
#define USE_REGEX /**/
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
/* Version number of package */
#define VERSION "2.11.0"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* Define to 1 if on MINIX. */
/* #undef _MINIX */
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define to 1 if you need to in order for `stat' and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */
#include "config-fixups.h"

View File

@@ -0,0 +1,330 @@
/*
* fontconfig/fc-case/fccase.tmpl.h
*
* Copyright © 2003 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#define FC_NUM_CASE_FOLD 264
#define FC_NUM_CASE_FOLD_CHARS 471
#define FC_MAX_CASE_FOLD_CHARS 6
#define FC_MAX_CASE_FOLD_EXPAND 4
#define FC_MIN_FOLD_CHAR 0x00000041
#define FC_MAX_FOLD_CHAR 0x00010427
static const FcCaseFold fcCaseFold[FC_NUM_CASE_FOLD] = {
{ 0x00000041, FC_CASE_FOLD_RANGE, 0x001a, 32 },
{ 0x000000b5, FC_CASE_FOLD_RANGE, 0x0001, 775 },
{ 0x000000c0, FC_CASE_FOLD_RANGE, 0x0017, 32 },
{ 0x000000d8, FC_CASE_FOLD_RANGE, 0x0007, 32 },
{ 0x000000df, FC_CASE_FOLD_FULL, 0x0002, 0 },
{ 0x00000100, FC_CASE_FOLD_EVEN_ODD, 0x002f, 1 },
{ 0x00000130, FC_CASE_FOLD_FULL, 0x0003, 2 },
{ 0x00000132, FC_CASE_FOLD_EVEN_ODD, 0x0005, 1 },
{ 0x00000139, FC_CASE_FOLD_EVEN_ODD, 0x000f, 1 },
{ 0x00000149, FC_CASE_FOLD_FULL, 0x0003, 5 },
{ 0x0000014a, FC_CASE_FOLD_EVEN_ODD, 0x002d, 1 },
{ 0x00000178, FC_CASE_FOLD_RANGE, 0x0001, -121 },
{ 0x00000179, FC_CASE_FOLD_EVEN_ODD, 0x0005, 1 },
{ 0x0000017f, FC_CASE_FOLD_RANGE, 0x0001, -268 },
{ 0x00000181, FC_CASE_FOLD_RANGE, 0x0001, 210 },
{ 0x00000182, FC_CASE_FOLD_EVEN_ODD, 0x0003, 1 },
{ 0x00000186, FC_CASE_FOLD_RANGE, 0x0001, 206 },
{ 0x00000187, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x00000189, FC_CASE_FOLD_RANGE, 0x0002, 205 },
{ 0x0000018b, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x0000018e, FC_CASE_FOLD_RANGE, 0x0001, 79 },
{ 0x0000018f, FC_CASE_FOLD_RANGE, 0x0001, 202 },
{ 0x00000190, FC_CASE_FOLD_RANGE, 0x0001, 203 },
{ 0x00000191, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x00000193, FC_CASE_FOLD_RANGE, 0x0001, 205 },
{ 0x00000194, FC_CASE_FOLD_RANGE, 0x0001, 207 },
{ 0x00000196, FC_CASE_FOLD_RANGE, 0x0001, 211 },
{ 0x00000197, FC_CASE_FOLD_RANGE, 0x0001, 209 },
{ 0x00000198, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x0000019c, FC_CASE_FOLD_RANGE, 0x0001, 211 },
{ 0x0000019d, FC_CASE_FOLD_RANGE, 0x0001, 213 },
{ 0x0000019f, FC_CASE_FOLD_RANGE, 0x0001, 214 },
{ 0x000001a0, FC_CASE_FOLD_EVEN_ODD, 0x0005, 1 },
{ 0x000001a6, FC_CASE_FOLD_RANGE, 0x0001, 218 },
{ 0x000001a7, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x000001a9, FC_CASE_FOLD_RANGE, 0x0001, 218 },
{ 0x000001ac, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x000001ae, FC_CASE_FOLD_RANGE, 0x0001, 218 },
{ 0x000001af, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x000001b1, FC_CASE_FOLD_RANGE, 0x0002, 217 },
{ 0x000001b3, FC_CASE_FOLD_EVEN_ODD, 0x0003, 1 },
{ 0x000001b7, FC_CASE_FOLD_RANGE, 0x0001, 219 },
{ 0x000001b8, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x000001bc, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x000001c4, FC_CASE_FOLD_RANGE, 0x0001, 2 },
{ 0x000001c5, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x000001c7, FC_CASE_FOLD_RANGE, 0x0001, 2 },
{ 0x000001c8, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x000001ca, FC_CASE_FOLD_RANGE, 0x0001, 2 },
{ 0x000001cb, FC_CASE_FOLD_EVEN_ODD, 0x0011, 1 },
{ 0x000001de, FC_CASE_FOLD_EVEN_ODD, 0x0011, 1 },
{ 0x000001f0, FC_CASE_FOLD_FULL, 0x0003, 8 },
{ 0x000001f1, FC_CASE_FOLD_RANGE, 0x0001, 2 },
{ 0x000001f2, FC_CASE_FOLD_EVEN_ODD, 0x0003, 1 },
{ 0x000001f6, FC_CASE_FOLD_RANGE, 0x0001, -97 },
{ 0x000001f7, FC_CASE_FOLD_RANGE, 0x0001, -56 },
{ 0x000001f8, FC_CASE_FOLD_EVEN_ODD, 0x0027, 1 },
{ 0x00000220, FC_CASE_FOLD_RANGE, 0x0001, -130 },
{ 0x00000222, FC_CASE_FOLD_EVEN_ODD, 0x0011, 1 },
{ 0x0000023a, FC_CASE_FOLD_RANGE, 0x0001, 10795 },
{ 0x0000023b, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x0000023d, FC_CASE_FOLD_RANGE, 0x0001, -163 },
{ 0x0000023e, FC_CASE_FOLD_RANGE, 0x0001, 10792 },
{ 0x00000241, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x00000243, FC_CASE_FOLD_RANGE, 0x0001, -195 },
{ 0x00000244, FC_CASE_FOLD_RANGE, 0x0001, 69 },
{ 0x00000245, FC_CASE_FOLD_RANGE, 0x0001, 71 },
{ 0x00000246, FC_CASE_FOLD_EVEN_ODD, 0x0009, 1 },
{ 0x00000345, FC_CASE_FOLD_RANGE, 0x0001, 116 },
{ 0x00000370, FC_CASE_FOLD_EVEN_ODD, 0x0003, 1 },
{ 0x00000376, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x00000386, FC_CASE_FOLD_RANGE, 0x0001, 38 },
{ 0x00000388, FC_CASE_FOLD_RANGE, 0x0003, 37 },
{ 0x0000038c, FC_CASE_FOLD_RANGE, 0x0001, 64 },
{ 0x0000038e, FC_CASE_FOLD_RANGE, 0x0002, 63 },
{ 0x00000390, FC_CASE_FOLD_FULL, 0x0006, 11 },
{ 0x00000391, FC_CASE_FOLD_RANGE, 0x0011, 32 },
{ 0x000003a3, FC_CASE_FOLD_RANGE, 0x0009, 32 },
{ 0x000003b0, FC_CASE_FOLD_FULL, 0x0006, 17 },
{ 0x000003c2, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x000003cf, FC_CASE_FOLD_RANGE, 0x0001, 8 },
{ 0x000003d0, FC_CASE_FOLD_RANGE, 0x0001, -30 },
{ 0x000003d1, FC_CASE_FOLD_RANGE, 0x0001, -25 },
{ 0x000003d5, FC_CASE_FOLD_RANGE, 0x0001, -15 },
{ 0x000003d6, FC_CASE_FOLD_RANGE, 0x0001, -22 },
{ 0x000003d8, FC_CASE_FOLD_EVEN_ODD, 0x0017, 1 },
{ 0x000003f0, FC_CASE_FOLD_RANGE, 0x0001, -54 },
{ 0x000003f1, FC_CASE_FOLD_RANGE, 0x0001, -48 },
{ 0x000003f4, FC_CASE_FOLD_RANGE, 0x0001, -60 },
{ 0x000003f5, FC_CASE_FOLD_RANGE, 0x0001, -64 },
{ 0x000003f7, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x000003f9, FC_CASE_FOLD_RANGE, 0x0001, -7 },
{ 0x000003fa, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x000003fd, FC_CASE_FOLD_RANGE, 0x0003, -130 },
{ 0x00000400, FC_CASE_FOLD_RANGE, 0x0010, 80 },
{ 0x00000410, FC_CASE_FOLD_RANGE, 0x0020, 32 },
{ 0x00000460, FC_CASE_FOLD_EVEN_ODD, 0x0021, 1 },
{ 0x0000048a, FC_CASE_FOLD_EVEN_ODD, 0x0035, 1 },
{ 0x000004c0, FC_CASE_FOLD_RANGE, 0x0001, 15 },
{ 0x000004c1, FC_CASE_FOLD_EVEN_ODD, 0x000d, 1 },
{ 0x000004d0, FC_CASE_FOLD_EVEN_ODD, 0x0057, 1 },
{ 0x00000531, FC_CASE_FOLD_RANGE, 0x0026, 48 },
{ 0x00000587, FC_CASE_FOLD_FULL, 0x0004, 23 },
{ 0x000010a0, FC_CASE_FOLD_RANGE, 0x0026, 7264 },
{ 0x000010c7, FC_CASE_FOLD_RANGE, 0x0001, 7264 },
{ 0x000010cd, FC_CASE_FOLD_RANGE, 0x0001, 7264 },
{ 0x00001e00, FC_CASE_FOLD_EVEN_ODD, 0x0095, 1 },
{ 0x00001e96, FC_CASE_FOLD_FULL, 0x0003, 27 },
{ 0x00001e97, FC_CASE_FOLD_FULL, 0x0003, 30 },
{ 0x00001e98, FC_CASE_FOLD_FULL, 0x0003, 33 },
{ 0x00001e99, FC_CASE_FOLD_FULL, 0x0003, 36 },
{ 0x00001e9a, FC_CASE_FOLD_FULL, 0x0003, 39 },
{ 0x00001e9b, FC_CASE_FOLD_RANGE, 0x0001, -58 },
{ 0x00001e9e, FC_CASE_FOLD_FULL, 0x0002, 42 },
{ 0x00001ea0, FC_CASE_FOLD_EVEN_ODD, 0x005f, 1 },
{ 0x00001f08, FC_CASE_FOLD_RANGE, 0x0008, -8 },
{ 0x00001f18, FC_CASE_FOLD_RANGE, 0x0006, -8 },
{ 0x00001f28, FC_CASE_FOLD_RANGE, 0x0008, -8 },
{ 0x00001f38, FC_CASE_FOLD_RANGE, 0x0008, -8 },
{ 0x00001f48, FC_CASE_FOLD_RANGE, 0x0006, -8 },
{ 0x00001f50, FC_CASE_FOLD_FULL, 0x0004, 44 },
{ 0x00001f52, FC_CASE_FOLD_FULL, 0x0006, 48 },
{ 0x00001f54, FC_CASE_FOLD_FULL, 0x0006, 54 },
{ 0x00001f56, FC_CASE_FOLD_FULL, 0x0006, 60 },
{ 0x00001f59, FC_CASE_FOLD_RANGE, 0x0001, -8 },
{ 0x00001f5b, FC_CASE_FOLD_RANGE, 0x0001, -8 },
{ 0x00001f5d, FC_CASE_FOLD_RANGE, 0x0001, -8 },
{ 0x00001f5f, FC_CASE_FOLD_RANGE, 0x0001, -8 },
{ 0x00001f68, FC_CASE_FOLD_RANGE, 0x0008, -8 },
{ 0x00001f80, FC_CASE_FOLD_FULL, 0x0005, 66 },
{ 0x00001f81, FC_CASE_FOLD_FULL, 0x0005, 71 },
{ 0x00001f82, FC_CASE_FOLD_FULL, 0x0005, 76 },
{ 0x00001f83, FC_CASE_FOLD_FULL, 0x0005, 81 },
{ 0x00001f84, FC_CASE_FOLD_FULL, 0x0005, 86 },
{ 0x00001f85, FC_CASE_FOLD_FULL, 0x0005, 91 },
{ 0x00001f86, FC_CASE_FOLD_FULL, 0x0005, 96 },
{ 0x00001f87, FC_CASE_FOLD_FULL, 0x0005, 101 },
{ 0x00001f88, FC_CASE_FOLD_FULL, 0x0005, 106 },
{ 0x00001f89, FC_CASE_FOLD_FULL, 0x0005, 111 },
{ 0x00001f8a, FC_CASE_FOLD_FULL, 0x0005, 116 },
{ 0x00001f8b, FC_CASE_FOLD_FULL, 0x0005, 121 },
{ 0x00001f8c, FC_CASE_FOLD_FULL, 0x0005, 126 },
{ 0x00001f8d, FC_CASE_FOLD_FULL, 0x0005, 131 },
{ 0x00001f8e, FC_CASE_FOLD_FULL, 0x0005, 136 },
{ 0x00001f8f, FC_CASE_FOLD_FULL, 0x0005, 141 },
{ 0x00001f90, FC_CASE_FOLD_FULL, 0x0005, 146 },
{ 0x00001f91, FC_CASE_FOLD_FULL, 0x0005, 151 },
{ 0x00001f92, FC_CASE_FOLD_FULL, 0x0005, 156 },
{ 0x00001f93, FC_CASE_FOLD_FULL, 0x0005, 161 },
{ 0x00001f94, FC_CASE_FOLD_FULL, 0x0005, 166 },
{ 0x00001f95, FC_CASE_FOLD_FULL, 0x0005, 171 },
{ 0x00001f96, FC_CASE_FOLD_FULL, 0x0005, 176 },
{ 0x00001f97, FC_CASE_FOLD_FULL, 0x0005, 181 },
{ 0x00001f98, FC_CASE_FOLD_FULL, 0x0005, 186 },
{ 0x00001f99, FC_CASE_FOLD_FULL, 0x0005, 191 },
{ 0x00001f9a, FC_CASE_FOLD_FULL, 0x0005, 196 },
{ 0x00001f9b, FC_CASE_FOLD_FULL, 0x0005, 201 },
{ 0x00001f9c, FC_CASE_FOLD_FULL, 0x0005, 206 },
{ 0x00001f9d, FC_CASE_FOLD_FULL, 0x0005, 211 },
{ 0x00001f9e, FC_CASE_FOLD_FULL, 0x0005, 216 },
{ 0x00001f9f, FC_CASE_FOLD_FULL, 0x0005, 221 },
{ 0x00001fa0, FC_CASE_FOLD_FULL, 0x0005, 226 },
{ 0x00001fa1, FC_CASE_FOLD_FULL, 0x0005, 231 },
{ 0x00001fa2, FC_CASE_FOLD_FULL, 0x0005, 236 },
{ 0x00001fa3, FC_CASE_FOLD_FULL, 0x0005, 241 },
{ 0x00001fa4, FC_CASE_FOLD_FULL, 0x0005, 246 },
{ 0x00001fa5, FC_CASE_FOLD_FULL, 0x0005, 251 },
{ 0x00001fa6, FC_CASE_FOLD_FULL, 0x0005, 256 },
{ 0x00001fa7, FC_CASE_FOLD_FULL, 0x0005, 261 },
{ 0x00001fa8, FC_CASE_FOLD_FULL, 0x0005, 266 },
{ 0x00001fa9, FC_CASE_FOLD_FULL, 0x0005, 271 },
{ 0x00001faa, FC_CASE_FOLD_FULL, 0x0005, 276 },
{ 0x00001fab, FC_CASE_FOLD_FULL, 0x0005, 281 },
{ 0x00001fac, FC_CASE_FOLD_FULL, 0x0005, 286 },
{ 0x00001fad, FC_CASE_FOLD_FULL, 0x0005, 291 },
{ 0x00001fae, FC_CASE_FOLD_FULL, 0x0005, 296 },
{ 0x00001faf, FC_CASE_FOLD_FULL, 0x0005, 301 },
{ 0x00001fb2, FC_CASE_FOLD_FULL, 0x0005, 306 },
{ 0x00001fb3, FC_CASE_FOLD_FULL, 0x0004, 311 },
{ 0x00001fb4, FC_CASE_FOLD_FULL, 0x0004, 315 },
{ 0x00001fb6, FC_CASE_FOLD_FULL, 0x0004, 319 },
{ 0x00001fb7, FC_CASE_FOLD_FULL, 0x0006, 323 },
{ 0x00001fb8, FC_CASE_FOLD_RANGE, 0x0002, -8 },
{ 0x00001fba, FC_CASE_FOLD_RANGE, 0x0002, -74 },
{ 0x00001fbc, FC_CASE_FOLD_FULL, 0x0004, 329 },
{ 0x00001fbe, FC_CASE_FOLD_RANGE, 0x0001, -7173 },
{ 0x00001fc2, FC_CASE_FOLD_FULL, 0x0005, 333 },
{ 0x00001fc3, FC_CASE_FOLD_FULL, 0x0004, 338 },
{ 0x00001fc4, FC_CASE_FOLD_FULL, 0x0004, 342 },
{ 0x00001fc6, FC_CASE_FOLD_FULL, 0x0004, 346 },
{ 0x00001fc7, FC_CASE_FOLD_FULL, 0x0006, 350 },
{ 0x00001fc8, FC_CASE_FOLD_RANGE, 0x0004, -86 },
{ 0x00001fcc, FC_CASE_FOLD_FULL, 0x0004, 356 },
{ 0x00001fd2, FC_CASE_FOLD_FULL, 0x0006, 360 },
{ 0x00001fd3, FC_CASE_FOLD_FULL, 0x0006, 366 },
{ 0x00001fd6, FC_CASE_FOLD_FULL, 0x0004, 372 },
{ 0x00001fd7, FC_CASE_FOLD_FULL, 0x0006, 376 },
{ 0x00001fd8, FC_CASE_FOLD_RANGE, 0x0002, -8 },
{ 0x00001fda, FC_CASE_FOLD_RANGE, 0x0002, -100 },
{ 0x00001fe2, FC_CASE_FOLD_FULL, 0x0006, 382 },
{ 0x00001fe3, FC_CASE_FOLD_FULL, 0x0006, 388 },
{ 0x00001fe4, FC_CASE_FOLD_FULL, 0x0004, 394 },
{ 0x00001fe6, FC_CASE_FOLD_FULL, 0x0004, 398 },
{ 0x00001fe7, FC_CASE_FOLD_FULL, 0x0006, 402 },
{ 0x00001fe8, FC_CASE_FOLD_RANGE, 0x0002, -8 },
{ 0x00001fea, FC_CASE_FOLD_RANGE, 0x0002, -112 },
{ 0x00001fec, FC_CASE_FOLD_RANGE, 0x0001, -7 },
{ 0x00001ff2, FC_CASE_FOLD_FULL, 0x0005, 408 },
{ 0x00001ff3, FC_CASE_FOLD_FULL, 0x0004, 413 },
{ 0x00001ff4, FC_CASE_FOLD_FULL, 0x0004, 417 },
{ 0x00001ff6, FC_CASE_FOLD_FULL, 0x0004, 421 },
{ 0x00001ff7, FC_CASE_FOLD_FULL, 0x0006, 425 },
{ 0x00001ff8, FC_CASE_FOLD_RANGE, 0x0002, -128 },
{ 0x00001ffa, FC_CASE_FOLD_RANGE, 0x0002, -126 },
{ 0x00001ffc, FC_CASE_FOLD_FULL, 0x0004, 431 },
{ 0x00002126, FC_CASE_FOLD_RANGE, 0x0001, -7517 },
{ 0x0000212a, FC_CASE_FOLD_RANGE, 0x0001, -8383 },
{ 0x0000212b, FC_CASE_FOLD_RANGE, 0x0001, -8262 },
{ 0x00002132, FC_CASE_FOLD_RANGE, 0x0001, 28 },
{ 0x00002160, FC_CASE_FOLD_RANGE, 0x0010, 16 },
{ 0x00002183, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x000024b6, FC_CASE_FOLD_RANGE, 0x001a, 26 },
{ 0x00002c00, FC_CASE_FOLD_RANGE, 0x002f, 48 },
{ 0x00002c60, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x00002c62, FC_CASE_FOLD_RANGE, 0x0001, -10743 },
{ 0x00002c63, FC_CASE_FOLD_RANGE, 0x0001, -3814 },
{ 0x00002c64, FC_CASE_FOLD_RANGE, 0x0001, -10727 },
{ 0x00002c67, FC_CASE_FOLD_EVEN_ODD, 0x0005, 1 },
{ 0x00002c6d, FC_CASE_FOLD_RANGE, 0x0001, -10780 },
{ 0x00002c6e, FC_CASE_FOLD_RANGE, 0x0001, -10749 },
{ 0x00002c6f, FC_CASE_FOLD_RANGE, 0x0001, -10783 },
{ 0x00002c70, FC_CASE_FOLD_RANGE, 0x0001, -10782 },
{ 0x00002c72, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x00002c75, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x00002c7e, FC_CASE_FOLD_RANGE, 0x0002, -10815 },
{ 0x00002c80, FC_CASE_FOLD_EVEN_ODD, 0x0063, 1 },
{ 0x00002ceb, FC_CASE_FOLD_EVEN_ODD, 0x0003, 1 },
{ 0x00002cf2, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x0000a640, FC_CASE_FOLD_EVEN_ODD, 0x002d, 1 },
{ 0x0000a680, FC_CASE_FOLD_EVEN_ODD, 0x0017, 1 },
{ 0x0000a722, FC_CASE_FOLD_EVEN_ODD, 0x000d, 1 },
{ 0x0000a732, FC_CASE_FOLD_EVEN_ODD, 0x003d, 1 },
{ 0x0000a779, FC_CASE_FOLD_EVEN_ODD, 0x0003, 1 },
{ 0x0000a77d, FC_CASE_FOLD_RANGE, 0x0001, 30204 },
{ 0x0000a77e, FC_CASE_FOLD_EVEN_ODD, 0x0009, 1 },
{ 0x0000a78b, FC_CASE_FOLD_EVEN_ODD, 0x0001, 1 },
{ 0x0000a78d, FC_CASE_FOLD_RANGE, 0x0001, 23256 },
{ 0x0000a790, FC_CASE_FOLD_EVEN_ODD, 0x0003, 1 },
{ 0x0000a7a0, FC_CASE_FOLD_EVEN_ODD, 0x0009, 1 },
{ 0x0000a7aa, FC_CASE_FOLD_RANGE, 0x0001, 23228 },
{ 0x0000fb00, FC_CASE_FOLD_FULL, 0x0002, 435 },
{ 0x0000fb01, FC_CASE_FOLD_FULL, 0x0002, 437 },
{ 0x0000fb02, FC_CASE_FOLD_FULL, 0x0002, 439 },
{ 0x0000fb03, FC_CASE_FOLD_FULL, 0x0003, 441 },
{ 0x0000fb04, FC_CASE_FOLD_FULL, 0x0003, 444 },
{ 0x0000fb05, FC_CASE_FOLD_FULL, 0x0002, 447 },
{ 0x0000fb06, FC_CASE_FOLD_FULL, 0x0002, 449 },
{ 0x0000fb13, FC_CASE_FOLD_FULL, 0x0004, 451 },
{ 0x0000fb14, FC_CASE_FOLD_FULL, 0x0004, 455 },
{ 0x0000fb15, FC_CASE_FOLD_FULL, 0x0004, 459 },
{ 0x0000fb16, FC_CASE_FOLD_FULL, 0x0004, 463 },
{ 0x0000fb17, FC_CASE_FOLD_FULL, 0x0004, 467 },
{ 0x0000ff21, FC_CASE_FOLD_RANGE, 0x001a, 32 },
{ 0x00010400, FC_CASE_FOLD_RANGE, 0x0028, 40 },
};
static const FcChar8 fcCaseFoldChars[FC_NUM_CASE_FOLD_CHARS] = {
0x73,0x73,0x69,0xcc,0x87,0xca,0xbc,0x6e,0x6a,0xcc,0x8c,0xce,0xb9,0xcc,0x88,0xcc,
0x81,0xcf,0x85,0xcc,0x88,0xcc,0x81,0xd5,0xa5,0xd6,0x82,0x68,0xcc,0xb1,0x74,0xcc,
0x88,0x77,0xcc,0x8a,0x79,0xcc,0x8a,0x61,0xca,0xbe,0x73,0x73,0xcf,0x85,0xcc,0x93,
0xcf,0x85,0xcc,0x93,0xcc,0x80,0xcf,0x85,0xcc,0x93,0xcc,0x81,0xcf,0x85,0xcc,0x93,
0xcd,0x82,0xe1,0xbc,0x80,0xce,0xb9,0xe1,0xbc,0x81,0xce,0xb9,0xe1,0xbc,0x82,0xce,
0xb9,0xe1,0xbc,0x83,0xce,0xb9,0xe1,0xbc,0x84,0xce,0xb9,0xe1,0xbc,0x85,0xce,0xb9,
0xe1,0xbc,0x86,0xce,0xb9,0xe1,0xbc,0x87,0xce,0xb9,0xe1,0xbc,0x80,0xce,0xb9,0xe1,
0xbc,0x81,0xce,0xb9,0xe1,0xbc,0x82,0xce,0xb9,0xe1,0xbc,0x83,0xce,0xb9,0xe1,0xbc,
0x84,0xce,0xb9,0xe1,0xbc,0x85,0xce,0xb9,0xe1,0xbc,0x86,0xce,0xb9,0xe1,0xbc,0x87,
0xce,0xb9,0xe1,0xbc,0xa0,0xce,0xb9,0xe1,0xbc,0xa1,0xce,0xb9,0xe1,0xbc,0xa2,0xce,
0xb9,0xe1,0xbc,0xa3,0xce,0xb9,0xe1,0xbc,0xa4,0xce,0xb9,0xe1,0xbc,0xa5,0xce,0xb9,
0xe1,0xbc,0xa6,0xce,0xb9,0xe1,0xbc,0xa7,0xce,0xb9,0xe1,0xbc,0xa0,0xce,0xb9,0xe1,
0xbc,0xa1,0xce,0xb9,0xe1,0xbc,0xa2,0xce,0xb9,0xe1,0xbc,0xa3,0xce,0xb9,0xe1,0xbc,
0xa4,0xce,0xb9,0xe1,0xbc,0xa5,0xce,0xb9,0xe1,0xbc,0xa6,0xce,0xb9,0xe1,0xbc,0xa7,
0xce,0xb9,0xe1,0xbd,0xa0,0xce,0xb9,0xe1,0xbd,0xa1,0xce,0xb9,0xe1,0xbd,0xa2,0xce,
0xb9,0xe1,0xbd,0xa3,0xce,0xb9,0xe1,0xbd,0xa4,0xce,0xb9,0xe1,0xbd,0xa5,0xce,0xb9,
0xe1,0xbd,0xa6,0xce,0xb9,0xe1,0xbd,0xa7,0xce,0xb9,0xe1,0xbd,0xa0,0xce,0xb9,0xe1,
0xbd,0xa1,0xce,0xb9,0xe1,0xbd,0xa2,0xce,0xb9,0xe1,0xbd,0xa3,0xce,0xb9,0xe1,0xbd,
0xa4,0xce,0xb9,0xe1,0xbd,0xa5,0xce,0xb9,0xe1,0xbd,0xa6,0xce,0xb9,0xe1,0xbd,0xa7,
0xce,0xb9,0xe1,0xbd,0xb0,0xce,0xb9,0xce,0xb1,0xce,0xb9,0xce,0xac,0xce,0xb9,0xce,
0xb1,0xcd,0x82,0xce,0xb1,0xcd,0x82,0xce,0xb9,0xce,0xb1,0xce,0xb9,0xe1,0xbd,0xb4,
0xce,0xb9,0xce,0xb7,0xce,0xb9,0xce,0xae,0xce,0xb9,0xce,0xb7,0xcd,0x82,0xce,0xb7,
0xcd,0x82,0xce,0xb9,0xce,0xb7,0xce,0xb9,0xce,0xb9,0xcc,0x88,0xcc,0x80,0xce,0xb9,
0xcc,0x88,0xcc,0x81,0xce,0xb9,0xcd,0x82,0xce,0xb9,0xcc,0x88,0xcd,0x82,0xcf,0x85,
0xcc,0x88,0xcc,0x80,0xcf,0x85,0xcc,0x88,0xcc,0x81,0xcf,0x81,0xcc,0x93,0xcf,0x85,
0xcd,0x82,0xcf,0x85,0xcc,0x88,0xcd,0x82,0xe1,0xbd,0xbc,0xce,0xb9,0xcf,0x89,0xce,
0xb9,0xcf,0x8e,0xce,0xb9,0xcf,0x89,0xcd,0x82,0xcf,0x89,0xcd,0x82,0xce,0xb9,0xcf,
0x89,0xce,0xb9,0x66,0x66,0x66,0x69,0x66,0x6c,0x66,0x66,0x69,0x66,0x66,0x6c,0x73,
0x74,0x73,0x74,0xd5,0xb4,0xd5,0xb6,0xd5,0xb4,0xd5,0xa5,0xd5,0xb4,0xd5,0xab,0xd5,
0xbe,0xd5,0xb6,0xd5,0xb4,0xd5,0xad
};

View File

@@ -0,0 +1,781 @@
/*
* fontconfig/fc-glyphname/fcglyphname.tmpl.h
*
* Copyright © 2003 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* 201 glyphnames in 271 entries, 74% occupancy */
#define FC_GLYPHNAME_HASH 271
#define FC_GLYPHNAME_REHASH 269
#define FC_GLYPHNAME_MAXLEN 4
typedef int16_t FcGlyphId;
static const struct { const FcChar32 ucs; const FcChar8 name[5]; } _fc_glyph_names[201] = {
{ 0x2701, "a1" },
{ 0x2721, "a10" },
{ 0x275e, "a100" },
{ 0x2761, "a101" },
{ 0x2762, "a102" },
{ 0x2763, "a103" },
{ 0x2764, "a104" },
{ 0x2710, "a105" },
{ 0x2765, "a106" },
{ 0x2766, "a107" },
{ 0x2767, "a108" },
{ 0x2660, "a109" },
{ 0x261b, "a11" },
{ 0x2665, "a110" },
{ 0x2666, "a111" },
{ 0x2663, "a112" },
{ 0x2709, "a117" },
{ 0x2708, "a118" },
{ 0x2707, "a119" },
{ 0x261e, "a12" },
{ 0x2460, "a120" },
{ 0x2461, "a121" },
{ 0x2462, "a122" },
{ 0x2463, "a123" },
{ 0x2464, "a124" },
{ 0x2465, "a125" },
{ 0x2466, "a126" },
{ 0x2467, "a127" },
{ 0x2468, "a128" },
{ 0x2469, "a129" },
{ 0x270c, "a13" },
{ 0x2776, "a130" },
{ 0x2777, "a131" },
{ 0x2778, "a132" },
{ 0x2779, "a133" },
{ 0x277a, "a134" },
{ 0x277b, "a135" },
{ 0x277c, "a136" },
{ 0x277d, "a137" },
{ 0x277e, "a138" },
{ 0x277f, "a139" },
{ 0x270d, "a14" },
{ 0x2780, "a140" },
{ 0x2781, "a141" },
{ 0x2782, "a142" },
{ 0x2783, "a143" },
{ 0x2784, "a144" },
{ 0x2785, "a145" },
{ 0x2786, "a146" },
{ 0x2787, "a147" },
{ 0x2788, "a148" },
{ 0x2789, "a149" },
{ 0x270e, "a15" },
{ 0x278a, "a150" },
{ 0x278b, "a151" },
{ 0x278c, "a152" },
{ 0x278d, "a153" },
{ 0x278e, "a154" },
{ 0x278f, "a155" },
{ 0x2790, "a156" },
{ 0x2791, "a157" },
{ 0x2792, "a158" },
{ 0x2793, "a159" },
{ 0x270f, "a16" },
{ 0x2794, "a160" },
{ 0x2192, "a161" },
{ 0x27a3, "a162" },
{ 0x2194, "a163" },
{ 0x2195, "a164" },
{ 0x2799, "a165" },
{ 0x279b, "a166" },
{ 0x279c, "a167" },
{ 0x279d, "a168" },
{ 0x279e, "a169" },
{ 0x2711, "a17" },
{ 0x279f, "a170" },
{ 0x27a0, "a171" },
{ 0x27a1, "a172" },
{ 0x27a2, "a173" },
{ 0x27a4, "a174" },
{ 0x27a5, "a175" },
{ 0x27a6, "a176" },
{ 0x27a7, "a177" },
{ 0x27a8, "a178" },
{ 0x27a9, "a179" },
{ 0x2712, "a18" },
{ 0x27ab, "a180" },
{ 0x27ad, "a181" },
{ 0x27af, "a182" },
{ 0x27b2, "a183" },
{ 0x27b3, "a184" },
{ 0x27b5, "a185" },
{ 0x27b8, "a186" },
{ 0x27ba, "a187" },
{ 0x27bb, "a188" },
{ 0x27bc, "a189" },
{ 0x2713, "a19" },
{ 0x27bd, "a190" },
{ 0x27be, "a191" },
{ 0x279a, "a192" },
{ 0x27aa, "a193" },
{ 0x27b6, "a194" },
{ 0x27b9, "a195" },
{ 0x2798, "a196" },
{ 0x27b4, "a197" },
{ 0x27b7, "a198" },
{ 0x27ac, "a199" },
{ 0x2702, "a2" },
{ 0x2714, "a20" },
{ 0x27ae, "a200" },
{ 0x27b1, "a201" },
{ 0x2703, "a202" },
{ 0x2750, "a203" },
{ 0x2752, "a204" },
{ 0x276e, "a205" },
{ 0x2770, "a206" },
{ 0x2715, "a21" },
{ 0x2716, "a22" },
{ 0x2717, "a23" },
{ 0x2718, "a24" },
{ 0x2719, "a25" },
{ 0x271a, "a26" },
{ 0x271b, "a27" },
{ 0x271c, "a28" },
{ 0x2722, "a29" },
{ 0x2704, "a3" },
{ 0x2723, "a30" },
{ 0x2724, "a31" },
{ 0x2725, "a32" },
{ 0x2726, "a33" },
{ 0x2727, "a34" },
{ 0x2605, "a35" },
{ 0x2729, "a36" },
{ 0x272a, "a37" },
{ 0x272b, "a38" },
{ 0x272c, "a39" },
{ 0x260e, "a4" },
{ 0x272d, "a40" },
{ 0x272e, "a41" },
{ 0x272f, "a42" },
{ 0x2730, "a43" },
{ 0x2731, "a44" },
{ 0x2732, "a45" },
{ 0x2733, "a46" },
{ 0x2734, "a47" },
{ 0x2735, "a48" },
{ 0x2736, "a49" },
{ 0x2706, "a5" },
{ 0x2737, "a50" },
{ 0x2738, "a51" },
{ 0x2739, "a52" },
{ 0x273a, "a53" },
{ 0x273b, "a54" },
{ 0x273c, "a55" },
{ 0x273d, "a56" },
{ 0x273e, "a57" },
{ 0x273f, "a58" },
{ 0x2740, "a59" },
{ 0x271d, "a6" },
{ 0x2741, "a60" },
{ 0x2742, "a61" },
{ 0x2743, "a62" },
{ 0x2744, "a63" },
{ 0x2745, "a64" },
{ 0x2746, "a65" },
{ 0x2747, "a66" },
{ 0x2748, "a67" },
{ 0x2749, "a68" },
{ 0x274a, "a69" },
{ 0x271e, "a7" },
{ 0x274b, "a70" },
{ 0x25cf, "a71" },
{ 0x274d, "a72" },
{ 0x25a0, "a73" },
{ 0x274f, "a74" },
{ 0x2751, "a75" },
{ 0x25b2, "a76" },
{ 0x25bc, "a77" },
{ 0x25c6, "a78" },
{ 0x2756, "a79" },
{ 0x271f, "a8" },
{ 0x25d7, "a81" },
{ 0x2758, "a82" },
{ 0x2759, "a83" },
{ 0x275a, "a84" },
{ 0x276f, "a85" },
{ 0x2771, "a86" },
{ 0x2772, "a87" },
{ 0x2773, "a88" },
{ 0x2768, "a89" },
{ 0x2720, "a9" },
{ 0x2769, "a90" },
{ 0x276c, "a91" },
{ 0x276d, "a92" },
{ 0x276a, "a93" },
{ 0x276b, "a94" },
{ 0x2774, "a95" },
{ 0x2775, "a96" },
{ 0x275b, "a97" },
{ 0x275c, "a98" },
{ 0x275d, "a99" },
};
static const FcGlyphId _fc_name_to_ucs[271] = {
123,
81,
198,
154,
142,
186,
82,
-1,
143,
172,
181,
79,
153,
191,
-1,
-1,
80,
195,
179,
170,
151,
129,
101,
194,
85,
102,
73,
171,
99,
-1,
-1,
100,
196,
-1,
189,
163,
110,
199,
-1,
-1,
59,
50,
-1,
60,
75,
-1,
51,
-1,
-1,
58,
-1,
61,
55,
-1,
192,
56,
62,
-1,
53,
166,
113,
54,
-1,
157,
33,
188,
177,
21,
-1,
-1,
31,
-1,
-1,
32,
-1,
-1,
24,
160,
-1,
38,
-1,
-1,
26,
-1,
161,
27,
197,
94,
95,
105,
106,
90,
91,
92,
93,
86,
87,
88,
89,
28,
29,
39,
40,
10,
11,
17,
18,
6,
7,
8,
9,
2,
3,
4,
5,
-1,
-1,
114,
108,
146,
74,
-1,
117,
115,
118,
156,
119,
-1,
120,
-1,
121,
131,
122,
-1,
109,
-1,
124,
141,
134,
174,
144,
-1,
137,
155,
138,
-1,
64,
-1,
140,
152,
65,
-1,
111,
-1,
57,
162,
-1,
-1,
67,
-1,
-1,
150,
68,
-1,
167,
-1,
69,
164,
-1,
116,
70,
-1,
-1,
148,
71,
-1,
-1,
184,
72,
149,
176,
193,
34,
182,
145,
-1,
83,
187,
-1,
103,
84,
104,
200,
63,
37,
41,
52,
19,
30,
1,
12,
97,
35,
98,
135,
46,
36,
47,
96,
48,
159,
49,
-1,
42,
112,
43,
173,
44,
168,
45,
-1,
20,
183,
16,
147,
22,
178,
23,
-1,
15,
-1,
25,
190,
13,
139,
14,
-1,
-1,
-1,
128,
107,
125,
-1,
0,
158,
169,
136,
126,
-1,
-1,
180,
127,
77,
-1,
-1,
132,
-1,
78,
-1,
133,
-1,
165,
66,
130,
-1,
-1,
-1,
76,
-1,
185,
175,
};
static const FcGlyphId _fc_ucs_to_name[271] = {
56,
135,
19,
138,
58,
140,
59,
142,
60,
144,
61,
146,
62,
149,
64,
151,
152,
153,
154,
155,
156,
157,
159,
160,
161,
162,
163,
131,
165,
166,
167,
168,
170,
-1,
172,
-1,
174,
112,
175,
113,
-1,
173,
-1,
179,
-1,
182,
183,
158,
198,
199,
200,
2,
-1,
-1,
3,
4,
5,
6,
8,
9,
10,
189,
164,
194,
195,
192,
193,
114,
11,
115,
186,
15,
188,
13,
14,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
53,
54,
55,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
-1,
103,
69,
99,
70,
71,
72,
73,
75,
76,
77,
78,
66,
79,
80,
81,
82,
83,
84,
100,
86,
106,
87,
109,
88,
-1,
110,
89,
90,
104,
91,
101,
105,
92,
102,
93,
94,
95,
97,
98,
196,
-1,
134,
-1,
-1,
-1,
-1,
-1,
137,
-1,
-1,
-1,
-1,
-1,
139,
-1,
-1,
176,
-1,
-1,
141,
184,
-1,
-1,
-1,
-1,
143,
177,
57,
-1,
-1,
-1,
145,
-1,
-1,
-1,
-1,
178,
148,
-1,
-1,
-1,
-1,
-1,
150,
65,
171,
67,
68,
-1,
-1,
191,
-1,
-1,
181,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
185,
-1,
-1,
-1,
-1,
-1,
187,
-1,
-1,
-1,
133,
-1,
197,
-1,
-1,
-1,
-1,
-1,
0,
107,
111,
125,
-1,
147,
18,
17,
16,
-1,
-1,
30,
41,
52,
63,
7,
74,
85,
96,
108,
116,
117,
118,
119,
120,
121,
122,
123,
136,
169,
180,
190,
1,
124,
126,
127,
128,
129,
130,
-1,
132,
12,
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,59 @@
/*
* fontconfig/fontconfig/fcfreetype.h
*
* Copyright © 2001 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _FCFREETYPE_H_
#define _FCFREETYPE_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifndef FcPublic
#define FcPublic
#endif
_FCFUNCPROTOBEGIN
FcPublic FT_UInt
FcFreeTypeCharIndex (FT_Face face, FcChar32 ucs4);
FcPublic FcCharSet *
FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing);
FcPublic FcCharSet *
FcFreeTypeCharSet (FT_Face face, FcBlanks *blanks);
FcPublic FcResult
FcPatternGetFTFace (const FcPattern *p, const char *object, int n, FT_Face *f);
FcPublic FcBool
FcPatternAddFTFace (FcPattern *p, const char *object, const FT_Face f);
FcPublic FcPattern *
FcFreeTypeQueryFace (const FT_Face face,
const FcChar8 *file,
int id,
FcBlanks *blanks);
_FCFUNCPROTOEND
#endif

View File

@@ -0,0 +1,124 @@
/*
* fontconfig/fontconfig/fcprivate.h
*
* Copyright © 2001 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _FCPRIVATE_H_
#define _FCPRIVATE_H_
/*
* I tried this with functions that took va_list* arguments
* but portability concerns made me change these functions
* into macros (sigh).
*/
#define FcPatternVapBuild(result, orig, va) \
{ \
FcPattern *__p__ = (orig); \
const char *__o__; \
FcValue __v__; \
\
if (!__p__) \
{ \
__p__ = FcPatternCreate (); \
if (!__p__) \
goto _FcPatternVapBuild_bail0; \
} \
for (;;) \
{ \
__o__ = va_arg (va, const char *); \
if (!__o__) \
break; \
__v__.type = va_arg (va, int); \
switch (__v__.type) { \
case FcTypeUnknown: \
case FcTypeVoid: \
goto _FcPatternVapBuild_bail1; \
case FcTypeInteger: \
__v__.u.i = va_arg (va, int); \
break; \
case FcTypeDouble: \
__v__.u.d = va_arg (va, double); \
break; \
case FcTypeString: \
__v__.u.s = va_arg (va, const FcChar8 *); \
break; \
case FcTypeBool: \
__v__.u.b = va_arg (va, FcBool); \
break; \
case FcTypeMatrix: \
__v__.u.m = va_arg (va, const FcMatrix *); \
break; \
case FcTypeCharSet: \
__v__.u.c = va_arg (va, const FcCharSet *); \
break; \
case FcTypeFTFace: \
__v__.u.f = va_arg (va, FT_Face); \
break; \
case FcTypeLangSet: \
__v__.u.l = va_arg (va, const FcLangSet *); \
break; \
} \
if (!FcPatternAdd (__p__, __o__, __v__, FcTrue)) \
goto _FcPatternVapBuild_bail1; \
} \
result = __p__; \
goto _FcPatternVapBuild_return; \
\
_FcPatternVapBuild_bail1: \
if (!orig) \
FcPatternDestroy (__p__); \
_FcPatternVapBuild_bail0: \
result = (void*)0; \
\
_FcPatternVapBuild_return: \
; \
}
#define FcObjectSetVapBuild(__ret__, __first__, __va__) \
{ \
FcObjectSet *__os__; \
const char *__ob__; \
\
__ret__ = 0; \
__os__ = FcObjectSetCreate (); \
if (!__os__) \
goto _FcObjectSetVapBuild_bail0; \
__ob__ = __first__; \
while (__ob__) \
{ \
if (!FcObjectSetAdd (__os__, __ob__)) \
goto _FcObjectSetVapBuild_bail1; \
__ob__ = va_arg (__va__, const char *); \
} \
__ret__ = __os__; \
\
_FcObjectSetVapBuild_bail1: \
if (!__ret__ && __os__) \
FcObjectSetDestroy (__os__); \
_FcObjectSetVapBuild_bail0: \
; \
}
#endif /* _FCPRIVATE_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,392 @@
extern __typeof (FcBlanksCreate) IA__FcBlanksCreate __attribute((visibility("hidden")));
#define FcBlanksCreate IA__FcBlanksCreate
extern __typeof (FcBlanksDestroy) IA__FcBlanksDestroy __attribute((visibility("hidden")));
#define FcBlanksDestroy IA__FcBlanksDestroy
extern __typeof (FcBlanksAdd) IA__FcBlanksAdd __attribute((visibility("hidden")));
#define FcBlanksAdd IA__FcBlanksAdd
extern __typeof (FcBlanksIsMember) IA__FcBlanksIsMember __attribute((visibility("hidden")));
#define FcBlanksIsMember IA__FcBlanksIsMember
extern __typeof (FcCacheCopySet) IA__FcCacheCopySet __attribute((visibility("hidden")));
#define FcCacheCopySet IA__FcCacheCopySet
extern __typeof (FcCacheNumSubdir) IA__FcCacheNumSubdir __attribute((visibility("hidden")));
#define FcCacheNumSubdir IA__FcCacheNumSubdir
extern __typeof (FcCacheNumFont) IA__FcCacheNumFont __attribute((visibility("hidden")));
#define FcCacheNumFont IA__FcCacheNumFont
extern __typeof (FcDirCacheUnlink) IA__FcDirCacheUnlink __attribute((visibility("hidden")));
#define FcDirCacheUnlink IA__FcDirCacheUnlink
extern __typeof (FcDirCacheValid) IA__FcDirCacheValid __attribute((visibility("hidden")));
#define FcDirCacheValid IA__FcDirCacheValid
extern __typeof (FcDirCacheClean) IA__FcDirCacheClean __attribute((visibility("hidden")));
#define FcDirCacheClean IA__FcDirCacheClean
extern __typeof (FcCacheCreateTagFile) IA__FcCacheCreateTagFile __attribute((visibility("hidden")));
#define FcCacheCreateTagFile IA__FcCacheCreateTagFile
extern __typeof (FcConfigHome) IA__FcConfigHome __attribute((visibility("hidden")));
#define FcConfigHome IA__FcConfigHome
extern __typeof (FcConfigEnableHome) IA__FcConfigEnableHome __attribute((visibility("hidden")));
#define FcConfigEnableHome IA__FcConfigEnableHome
extern __typeof (FcConfigFilename) IA__FcConfigFilename __attribute((visibility("hidden")));
#define FcConfigFilename IA__FcConfigFilename
extern __typeof (FcConfigCreate) IA__FcConfigCreate __attribute((visibility("hidden")));
#define FcConfigCreate IA__FcConfigCreate
extern __typeof (FcConfigReference) IA__FcConfigReference __attribute((visibility("hidden")));
#define FcConfigReference IA__FcConfigReference
extern __typeof (FcConfigDestroy) IA__FcConfigDestroy __attribute((visibility("hidden")));
#define FcConfigDestroy IA__FcConfigDestroy
extern __typeof (FcConfigSetCurrent) IA__FcConfigSetCurrent __attribute((visibility("hidden")));
#define FcConfigSetCurrent IA__FcConfigSetCurrent
extern __typeof (FcConfigGetCurrent) IA__FcConfigGetCurrent __attribute((visibility("hidden")));
#define FcConfigGetCurrent IA__FcConfigGetCurrent
extern __typeof (FcConfigUptoDate) IA__FcConfigUptoDate __attribute((visibility("hidden")));
#define FcConfigUptoDate IA__FcConfigUptoDate
extern __typeof (FcConfigBuildFonts) IA__FcConfigBuildFonts __attribute((visibility("hidden")));
#define FcConfigBuildFonts IA__FcConfigBuildFonts
extern __typeof (FcConfigGetFontDirs) IA__FcConfigGetFontDirs __attribute((visibility("hidden")));
#define FcConfigGetFontDirs IA__FcConfigGetFontDirs
extern __typeof (FcConfigGetConfigDirs) IA__FcConfigGetConfigDirs __attribute((visibility("hidden")));
#define FcConfigGetConfigDirs IA__FcConfigGetConfigDirs
extern __typeof (FcConfigGetConfigFiles) IA__FcConfigGetConfigFiles __attribute((visibility("hidden")));
#define FcConfigGetConfigFiles IA__FcConfigGetConfigFiles
extern __typeof (FcConfigGetCache) IA__FcConfigGetCache __attribute((visibility("hidden")));
#define FcConfigGetCache IA__FcConfigGetCache
extern __typeof (FcConfigGetBlanks) IA__FcConfigGetBlanks __attribute((visibility("hidden")));
#define FcConfigGetBlanks IA__FcConfigGetBlanks
extern __typeof (FcConfigGetCacheDirs) IA__FcConfigGetCacheDirs __attribute((visibility("hidden")));
#define FcConfigGetCacheDirs IA__FcConfigGetCacheDirs
extern __typeof (FcConfigGetRescanInterval) IA__FcConfigGetRescanInterval __attribute((visibility("hidden")));
#define FcConfigGetRescanInterval IA__FcConfigGetRescanInterval
extern __typeof (FcConfigSetRescanInterval) IA__FcConfigSetRescanInterval __attribute((visibility("hidden")));
#define FcConfigSetRescanInterval IA__FcConfigSetRescanInterval
extern __typeof (FcConfigGetFonts) IA__FcConfigGetFonts __attribute((visibility("hidden")));
#define FcConfigGetFonts IA__FcConfigGetFonts
extern __typeof (FcConfigAppFontAddFile) IA__FcConfigAppFontAddFile __attribute((visibility("hidden")));
#define FcConfigAppFontAddFile IA__FcConfigAppFontAddFile
extern __typeof (FcConfigAppFontAddDir) IA__FcConfigAppFontAddDir __attribute((visibility("hidden")));
#define FcConfigAppFontAddDir IA__FcConfigAppFontAddDir
extern __typeof (FcConfigAppFontClear) IA__FcConfigAppFontClear __attribute((visibility("hidden")));
#define FcConfigAppFontClear IA__FcConfigAppFontClear
extern __typeof (FcConfigSubstituteWithPat) IA__FcConfigSubstituteWithPat __attribute((visibility("hidden")));
#define FcConfigSubstituteWithPat IA__FcConfigSubstituteWithPat
extern __typeof (FcConfigSubstitute) IA__FcConfigSubstitute __attribute((visibility("hidden")));
#define FcConfigSubstitute IA__FcConfigSubstitute
extern __typeof (FcConfigGetSysRoot) IA__FcConfigGetSysRoot __attribute((visibility("hidden")));
#define FcConfigGetSysRoot IA__FcConfigGetSysRoot
extern __typeof (FcConfigSetSysRoot) IA__FcConfigSetSysRoot __attribute((visibility("hidden")));
#define FcConfigSetSysRoot IA__FcConfigSetSysRoot
extern __typeof (FcCharSetCreate) IA__FcCharSetCreate __attribute((visibility("hidden")));
#define FcCharSetCreate IA__FcCharSetCreate
extern __typeof (FcCharSetNew) IA__FcCharSetNew __attribute((visibility("hidden")));
#define FcCharSetNew IA__FcCharSetNew
extern __typeof (FcCharSetDestroy) IA__FcCharSetDestroy __attribute((visibility("hidden")));
#define FcCharSetDestroy IA__FcCharSetDestroy
extern __typeof (FcCharSetAddChar) IA__FcCharSetAddChar __attribute((visibility("hidden")));
#define FcCharSetAddChar IA__FcCharSetAddChar
extern __typeof (FcCharSetDelChar) IA__FcCharSetDelChar __attribute((visibility("hidden")));
#define FcCharSetDelChar IA__FcCharSetDelChar
extern __typeof (FcCharSetCopy) IA__FcCharSetCopy __attribute((visibility("hidden")));
#define FcCharSetCopy IA__FcCharSetCopy
extern __typeof (FcCharSetEqual) IA__FcCharSetEqual __attribute((visibility("hidden")));
#define FcCharSetEqual IA__FcCharSetEqual
extern __typeof (FcCharSetIntersect) IA__FcCharSetIntersect __attribute((visibility("hidden")));
#define FcCharSetIntersect IA__FcCharSetIntersect
extern __typeof (FcCharSetUnion) IA__FcCharSetUnion __attribute((visibility("hidden")));
#define FcCharSetUnion IA__FcCharSetUnion
extern __typeof (FcCharSetSubtract) IA__FcCharSetSubtract __attribute((visibility("hidden")));
#define FcCharSetSubtract IA__FcCharSetSubtract
extern __typeof (FcCharSetMerge) IA__FcCharSetMerge __attribute((visibility("hidden")));
#define FcCharSetMerge IA__FcCharSetMerge
extern __typeof (FcCharSetHasChar) IA__FcCharSetHasChar __attribute((visibility("hidden")));
#define FcCharSetHasChar IA__FcCharSetHasChar
extern __typeof (FcCharSetCount) IA__FcCharSetCount __attribute((visibility("hidden")));
#define FcCharSetCount IA__FcCharSetCount
extern __typeof (FcCharSetIntersectCount) IA__FcCharSetIntersectCount __attribute((visibility("hidden")));
#define FcCharSetIntersectCount IA__FcCharSetIntersectCount
extern __typeof (FcCharSetSubtractCount) IA__FcCharSetSubtractCount __attribute((visibility("hidden")));
#define FcCharSetSubtractCount IA__FcCharSetSubtractCount
extern __typeof (FcCharSetIsSubset) IA__FcCharSetIsSubset __attribute((visibility("hidden")));
#define FcCharSetIsSubset IA__FcCharSetIsSubset
extern __typeof (FcCharSetFirstPage) IA__FcCharSetFirstPage __attribute((visibility("hidden")));
#define FcCharSetFirstPage IA__FcCharSetFirstPage
extern __typeof (FcCharSetNextPage) IA__FcCharSetNextPage __attribute((visibility("hidden")));
#define FcCharSetNextPage IA__FcCharSetNextPage
extern __typeof (FcCharSetCoverage) IA__FcCharSetCoverage __attribute((visibility("hidden")));
#define FcCharSetCoverage IA__FcCharSetCoverage
extern __typeof (FcValuePrint) IA__FcValuePrint __attribute((visibility("hidden")));
#define FcValuePrint IA__FcValuePrint
extern __typeof (FcPatternPrint) IA__FcPatternPrint __attribute((visibility("hidden")));
#define FcPatternPrint IA__FcPatternPrint
extern __typeof (FcFontSetPrint) IA__FcFontSetPrint __attribute((visibility("hidden")));
#define FcFontSetPrint IA__FcFontSetPrint
extern __typeof (FcGetDefaultLangs) IA__FcGetDefaultLangs __attribute((visibility("hidden")));
#define FcGetDefaultLangs IA__FcGetDefaultLangs
extern __typeof (FcDefaultSubstitute) IA__FcDefaultSubstitute __attribute((visibility("hidden")));
#define FcDefaultSubstitute IA__FcDefaultSubstitute
extern __typeof (FcFileIsDir) IA__FcFileIsDir __attribute((visibility("hidden")));
#define FcFileIsDir IA__FcFileIsDir
extern __typeof (FcFileScan) IA__FcFileScan __attribute((visibility("hidden")));
#define FcFileScan IA__FcFileScan
extern __typeof (FcDirScan) IA__FcDirScan __attribute((visibility("hidden")));
#define FcDirScan IA__FcDirScan
extern __typeof (FcDirSave) IA__FcDirSave __attribute((visibility("hidden")));
#define FcDirSave IA__FcDirSave
extern __typeof (FcDirCacheLoad) IA__FcDirCacheLoad __attribute((visibility("hidden")));
#define FcDirCacheLoad IA__FcDirCacheLoad
extern __typeof (FcDirCacheRescan) IA__FcDirCacheRescan __attribute((visibility("hidden")));
#define FcDirCacheRescan IA__FcDirCacheRescan
extern __typeof (FcDirCacheRead) IA__FcDirCacheRead __attribute((visibility("hidden")));
#define FcDirCacheRead IA__FcDirCacheRead
extern __typeof (FcDirCacheLoadFile) IA__FcDirCacheLoadFile __attribute((visibility("hidden")));
#define FcDirCacheLoadFile IA__FcDirCacheLoadFile
extern __typeof (FcDirCacheUnload) IA__FcDirCacheUnload __attribute((visibility("hidden")));
#define FcDirCacheUnload IA__FcDirCacheUnload
extern __typeof (FcFreeTypeQuery) IA__FcFreeTypeQuery __attribute((visibility("hidden")));
#define FcFreeTypeQuery IA__FcFreeTypeQuery
extern __typeof (FcFontSetCreate) IA__FcFontSetCreate __attribute((visibility("hidden")));
#define FcFontSetCreate IA__FcFontSetCreate
extern __typeof (FcFontSetDestroy) IA__FcFontSetDestroy __attribute((visibility("hidden")));
#define FcFontSetDestroy IA__FcFontSetDestroy
extern __typeof (FcFontSetAdd) IA__FcFontSetAdd __attribute((visibility("hidden")));
#define FcFontSetAdd IA__FcFontSetAdd
extern __typeof (FcInitLoadConfig) IA__FcInitLoadConfig __attribute((visibility("hidden")));
#define FcInitLoadConfig IA__FcInitLoadConfig
extern __typeof (FcInitLoadConfigAndFonts) IA__FcInitLoadConfigAndFonts __attribute((visibility("hidden")));
#define FcInitLoadConfigAndFonts IA__FcInitLoadConfigAndFonts
extern __typeof (FcInit) IA__FcInit __attribute((visibility("hidden")));
#define FcInit IA__FcInit
extern __typeof (FcFini) IA__FcFini __attribute((visibility("hidden")));
#define FcFini IA__FcFini
extern __typeof (FcGetVersion) IA__FcGetVersion __attribute((visibility("hidden")));
#define FcGetVersion IA__FcGetVersion
extern __typeof (FcInitReinitialize) IA__FcInitReinitialize __attribute((visibility("hidden")));
#define FcInitReinitialize IA__FcInitReinitialize
extern __typeof (FcInitBringUptoDate) IA__FcInitBringUptoDate __attribute((visibility("hidden")));
#define FcInitBringUptoDate IA__FcInitBringUptoDate
extern __typeof (FcGetLangs) IA__FcGetLangs __attribute((visibility("hidden")));
#define FcGetLangs IA__FcGetLangs
extern __typeof (FcLangNormalize) IA__FcLangNormalize __attribute((visibility("hidden")));
#define FcLangNormalize IA__FcLangNormalize
extern __typeof (FcLangGetCharSet) IA__FcLangGetCharSet __attribute((visibility("hidden")));
#define FcLangGetCharSet IA__FcLangGetCharSet
extern __typeof (FcLangSetCreate) IA__FcLangSetCreate __attribute((visibility("hidden")));
#define FcLangSetCreate IA__FcLangSetCreate
extern __typeof (FcLangSetDestroy) IA__FcLangSetDestroy __attribute((visibility("hidden")));
#define FcLangSetDestroy IA__FcLangSetDestroy
extern __typeof (FcLangSetCopy) IA__FcLangSetCopy __attribute((visibility("hidden")));
#define FcLangSetCopy IA__FcLangSetCopy
extern __typeof (FcLangSetAdd) IA__FcLangSetAdd __attribute((visibility("hidden")));
#define FcLangSetAdd IA__FcLangSetAdd
extern __typeof (FcLangSetDel) IA__FcLangSetDel __attribute((visibility("hidden")));
#define FcLangSetDel IA__FcLangSetDel
extern __typeof (FcLangSetHasLang) IA__FcLangSetHasLang __attribute((visibility("hidden")));
#define FcLangSetHasLang IA__FcLangSetHasLang
extern __typeof (FcLangSetCompare) IA__FcLangSetCompare __attribute((visibility("hidden")));
#define FcLangSetCompare IA__FcLangSetCompare
extern __typeof (FcLangSetContains) IA__FcLangSetContains __attribute((visibility("hidden")));
#define FcLangSetContains IA__FcLangSetContains
extern __typeof (FcLangSetEqual) IA__FcLangSetEqual __attribute((visibility("hidden")));
#define FcLangSetEqual IA__FcLangSetEqual
extern __typeof (FcLangSetHash) IA__FcLangSetHash __attribute((visibility("hidden")));
#define FcLangSetHash IA__FcLangSetHash
extern __typeof (FcLangSetGetLangs) IA__FcLangSetGetLangs __attribute((visibility("hidden")));
#define FcLangSetGetLangs IA__FcLangSetGetLangs
extern __typeof (FcLangSetUnion) IA__FcLangSetUnion __attribute((visibility("hidden")));
#define FcLangSetUnion IA__FcLangSetUnion
extern __typeof (FcLangSetSubtract) IA__FcLangSetSubtract __attribute((visibility("hidden")));
#define FcLangSetSubtract IA__FcLangSetSubtract
extern __typeof (FcObjectSetCreate) IA__FcObjectSetCreate __attribute((visibility("hidden")));
#define FcObjectSetCreate IA__FcObjectSetCreate
extern __typeof (FcObjectSetAdd) IA__FcObjectSetAdd __attribute((visibility("hidden")));
#define FcObjectSetAdd IA__FcObjectSetAdd
extern __typeof (FcObjectSetDestroy) IA__FcObjectSetDestroy __attribute((visibility("hidden")));
#define FcObjectSetDestroy IA__FcObjectSetDestroy
extern __typeof (FcObjectSetVaBuild) IA__FcObjectSetVaBuild __attribute((visibility("hidden")));
#define FcObjectSetVaBuild IA__FcObjectSetVaBuild
extern __typeof (FcObjectSetBuild) IA__FcObjectSetBuild __attribute((visibility("hidden")));
#define FcObjectSetBuild IA__FcObjectSetBuild
extern __typeof (FcFontSetList) IA__FcFontSetList __attribute((visibility("hidden")));
#define FcFontSetList IA__FcFontSetList
extern __typeof (FcFontList) IA__FcFontList __attribute((visibility("hidden")));
#define FcFontList IA__FcFontList
extern __typeof (FcAtomicCreate) IA__FcAtomicCreate __attribute((visibility("hidden")));
#define FcAtomicCreate IA__FcAtomicCreate
extern __typeof (FcAtomicLock) IA__FcAtomicLock __attribute((visibility("hidden")));
#define FcAtomicLock IA__FcAtomicLock
extern __typeof (FcAtomicNewFile) IA__FcAtomicNewFile __attribute((visibility("hidden")));
#define FcAtomicNewFile IA__FcAtomicNewFile
extern __typeof (FcAtomicOrigFile) IA__FcAtomicOrigFile __attribute((visibility("hidden")));
#define FcAtomicOrigFile IA__FcAtomicOrigFile
extern __typeof (FcAtomicReplaceOrig) IA__FcAtomicReplaceOrig __attribute((visibility("hidden")));
#define FcAtomicReplaceOrig IA__FcAtomicReplaceOrig
extern __typeof (FcAtomicDeleteNew) IA__FcAtomicDeleteNew __attribute((visibility("hidden")));
#define FcAtomicDeleteNew IA__FcAtomicDeleteNew
extern __typeof (FcAtomicUnlock) IA__FcAtomicUnlock __attribute((visibility("hidden")));
#define FcAtomicUnlock IA__FcAtomicUnlock
extern __typeof (FcAtomicDestroy) IA__FcAtomicDestroy __attribute((visibility("hidden")));
#define FcAtomicDestroy IA__FcAtomicDestroy
extern __typeof (FcFontSetMatch) IA__FcFontSetMatch __attribute((visibility("hidden")));
#define FcFontSetMatch IA__FcFontSetMatch
extern __typeof (FcFontMatch) IA__FcFontMatch __attribute((visibility("hidden")));
#define FcFontMatch IA__FcFontMatch
extern __typeof (FcFontRenderPrepare) IA__FcFontRenderPrepare __attribute((visibility("hidden")));
#define FcFontRenderPrepare IA__FcFontRenderPrepare
extern __typeof (FcFontSetSort) IA__FcFontSetSort __attribute((visibility("hidden")));
#define FcFontSetSort IA__FcFontSetSort
extern __typeof (FcFontSort) IA__FcFontSort __attribute((visibility("hidden")));
#define FcFontSort IA__FcFontSort
extern __typeof (FcFontSetSortDestroy) IA__FcFontSetSortDestroy __attribute((visibility("hidden")));
#define FcFontSetSortDestroy IA__FcFontSetSortDestroy
extern __typeof (FcMatrixCopy) IA__FcMatrixCopy __attribute((visibility("hidden")));
#define FcMatrixCopy IA__FcMatrixCopy
extern __typeof (FcMatrixEqual) IA__FcMatrixEqual __attribute((visibility("hidden")));
#define FcMatrixEqual IA__FcMatrixEqual
extern __typeof (FcMatrixMultiply) IA__FcMatrixMultiply __attribute((visibility("hidden")));
#define FcMatrixMultiply IA__FcMatrixMultiply
extern __typeof (FcMatrixRotate) IA__FcMatrixRotate __attribute((visibility("hidden")));
#define FcMatrixRotate IA__FcMatrixRotate
extern __typeof (FcMatrixScale) IA__FcMatrixScale __attribute((visibility("hidden")));
#define FcMatrixScale IA__FcMatrixScale
extern __typeof (FcMatrixShear) IA__FcMatrixShear __attribute((visibility("hidden")));
#define FcMatrixShear IA__FcMatrixShear
extern __typeof (FcNameRegisterObjectTypes) IA__FcNameRegisterObjectTypes __attribute((visibility("hidden")));
#define FcNameRegisterObjectTypes IA__FcNameRegisterObjectTypes
extern __typeof (FcNameUnregisterObjectTypes) IA__FcNameUnregisterObjectTypes __attribute((visibility("hidden")));
#define FcNameUnregisterObjectTypes IA__FcNameUnregisterObjectTypes
extern __typeof (FcNameGetObjectType) IA__FcNameGetObjectType __attribute((visibility("hidden")));
#define FcNameGetObjectType IA__FcNameGetObjectType
extern __typeof (FcNameRegisterConstants) IA__FcNameRegisterConstants __attribute((visibility("hidden")));
#define FcNameRegisterConstants IA__FcNameRegisterConstants
extern __typeof (FcNameUnregisterConstants) IA__FcNameUnregisterConstants __attribute((visibility("hidden")));
#define FcNameUnregisterConstants IA__FcNameUnregisterConstants
extern __typeof (FcNameGetConstant) IA__FcNameGetConstant __attribute((visibility("hidden")));
#define FcNameGetConstant IA__FcNameGetConstant
extern __typeof (FcNameConstant) IA__FcNameConstant __attribute((visibility("hidden")));
#define FcNameConstant IA__FcNameConstant
extern __typeof (FcNameParse) IA__FcNameParse __attribute((visibility("hidden")));
#define FcNameParse IA__FcNameParse
extern __typeof (FcNameUnparse) IA__FcNameUnparse __attribute((visibility("hidden")));
#define FcNameUnparse IA__FcNameUnparse
extern __typeof (FcPatternCreate) IA__FcPatternCreate __attribute((visibility("hidden")));
#define FcPatternCreate IA__FcPatternCreate
extern __typeof (FcPatternDuplicate) IA__FcPatternDuplicate __attribute((visibility("hidden")));
#define FcPatternDuplicate IA__FcPatternDuplicate
extern __typeof (FcPatternReference) IA__FcPatternReference __attribute((visibility("hidden")));
#define FcPatternReference IA__FcPatternReference
extern __typeof (FcPatternFilter) IA__FcPatternFilter __attribute((visibility("hidden")));
#define FcPatternFilter IA__FcPatternFilter
extern __typeof (FcValueDestroy) IA__FcValueDestroy __attribute((visibility("hidden")));
#define FcValueDestroy IA__FcValueDestroy
extern __typeof (FcValueEqual) IA__FcValueEqual __attribute((visibility("hidden")));
#define FcValueEqual IA__FcValueEqual
extern __typeof (FcValueSave) IA__FcValueSave __attribute((visibility("hidden")));
#define FcValueSave IA__FcValueSave
extern __typeof (FcPatternDestroy) IA__FcPatternDestroy __attribute((visibility("hidden")));
#define FcPatternDestroy IA__FcPatternDestroy
extern __typeof (FcPatternEqual) IA__FcPatternEqual __attribute((visibility("hidden")));
#define FcPatternEqual IA__FcPatternEqual
extern __typeof (FcPatternEqualSubset) IA__FcPatternEqualSubset __attribute((visibility("hidden")));
#define FcPatternEqualSubset IA__FcPatternEqualSubset
extern __typeof (FcPatternHash) IA__FcPatternHash __attribute((visibility("hidden")));
#define FcPatternHash IA__FcPatternHash
extern __typeof (FcPatternAdd) IA__FcPatternAdd __attribute((visibility("hidden")));
#define FcPatternAdd IA__FcPatternAdd
extern __typeof (FcPatternAddWeak) IA__FcPatternAddWeak __attribute((visibility("hidden")));
#define FcPatternAddWeak IA__FcPatternAddWeak
extern __typeof (FcPatternGet) IA__FcPatternGet __attribute((visibility("hidden")));
#define FcPatternGet IA__FcPatternGet
extern __typeof (FcPatternDel) IA__FcPatternDel __attribute((visibility("hidden")));
#define FcPatternDel IA__FcPatternDel
extern __typeof (FcPatternRemove) IA__FcPatternRemove __attribute((visibility("hidden")));
#define FcPatternRemove IA__FcPatternRemove
extern __typeof (FcPatternAddInteger) IA__FcPatternAddInteger __attribute((visibility("hidden")));
#define FcPatternAddInteger IA__FcPatternAddInteger
extern __typeof (FcPatternAddDouble) IA__FcPatternAddDouble __attribute((visibility("hidden")));
#define FcPatternAddDouble IA__FcPatternAddDouble
extern __typeof (FcPatternAddString) IA__FcPatternAddString __attribute((visibility("hidden")));
#define FcPatternAddString IA__FcPatternAddString
extern __typeof (FcPatternAddMatrix) IA__FcPatternAddMatrix __attribute((visibility("hidden")));
#define FcPatternAddMatrix IA__FcPatternAddMatrix
extern __typeof (FcPatternAddCharSet) IA__FcPatternAddCharSet __attribute((visibility("hidden")));
#define FcPatternAddCharSet IA__FcPatternAddCharSet
extern __typeof (FcPatternAddBool) IA__FcPatternAddBool __attribute((visibility("hidden")));
#define FcPatternAddBool IA__FcPatternAddBool
extern __typeof (FcPatternAddLangSet) IA__FcPatternAddLangSet __attribute((visibility("hidden")));
#define FcPatternAddLangSet IA__FcPatternAddLangSet
extern __typeof (FcPatternGetInteger) IA__FcPatternGetInteger __attribute((visibility("hidden")));
#define FcPatternGetInteger IA__FcPatternGetInteger
extern __typeof (FcPatternGetDouble) IA__FcPatternGetDouble __attribute((visibility("hidden")));
#define FcPatternGetDouble IA__FcPatternGetDouble
extern __typeof (FcPatternGetString) IA__FcPatternGetString __attribute((visibility("hidden")));
#define FcPatternGetString IA__FcPatternGetString
extern __typeof (FcPatternGetMatrix) IA__FcPatternGetMatrix __attribute((visibility("hidden")));
#define FcPatternGetMatrix IA__FcPatternGetMatrix
extern __typeof (FcPatternGetCharSet) IA__FcPatternGetCharSet __attribute((visibility("hidden")));
#define FcPatternGetCharSet IA__FcPatternGetCharSet
extern __typeof (FcPatternGetBool) IA__FcPatternGetBool __attribute((visibility("hidden")));
#define FcPatternGetBool IA__FcPatternGetBool
extern __typeof (FcPatternGetLangSet) IA__FcPatternGetLangSet __attribute((visibility("hidden")));
#define FcPatternGetLangSet IA__FcPatternGetLangSet
extern __typeof (FcPatternVaBuild) IA__FcPatternVaBuild __attribute((visibility("hidden")));
#define FcPatternVaBuild IA__FcPatternVaBuild
extern __typeof (FcPatternBuild) IA__FcPatternBuild __attribute((visibility("hidden")));
#define FcPatternBuild IA__FcPatternBuild
extern __typeof (FcPatternFormat) IA__FcPatternFormat __attribute((visibility("hidden")));
#define FcPatternFormat IA__FcPatternFormat
extern __typeof (FcStrCopy) IA__FcStrCopy __attribute((visibility("hidden")));
#define FcStrCopy IA__FcStrCopy
extern __typeof (FcStrCopyFilename) IA__FcStrCopyFilename __attribute((visibility("hidden")));
#define FcStrCopyFilename IA__FcStrCopyFilename
extern __typeof (FcStrPlus) IA__FcStrPlus __attribute((visibility("hidden")));
#define FcStrPlus IA__FcStrPlus
extern __typeof (FcStrFree) IA__FcStrFree __attribute((visibility("hidden")));
#define FcStrFree IA__FcStrFree
extern __typeof (FcStrDowncase) IA__FcStrDowncase __attribute((visibility("hidden")));
#define FcStrDowncase IA__FcStrDowncase
extern __typeof (FcStrCmpIgnoreCase) IA__FcStrCmpIgnoreCase __attribute((visibility("hidden")));
#define FcStrCmpIgnoreCase IA__FcStrCmpIgnoreCase
extern __typeof (FcStrCmp) IA__FcStrCmp __attribute((visibility("hidden")));
#define FcStrCmp IA__FcStrCmp
extern __typeof (FcStrStrIgnoreCase) IA__FcStrStrIgnoreCase __attribute((visibility("hidden")));
#define FcStrStrIgnoreCase IA__FcStrStrIgnoreCase
extern __typeof (FcStrStr) IA__FcStrStr __attribute((visibility("hidden")));
#define FcStrStr IA__FcStrStr
extern __typeof (FcUtf8ToUcs4) IA__FcUtf8ToUcs4 __attribute((visibility("hidden")));
#define FcUtf8ToUcs4 IA__FcUtf8ToUcs4
extern __typeof (FcUtf8Len) IA__FcUtf8Len __attribute((visibility("hidden")));
#define FcUtf8Len IA__FcUtf8Len
extern __typeof (FcUcs4ToUtf8) IA__FcUcs4ToUtf8 __attribute((visibility("hidden")));
#define FcUcs4ToUtf8 IA__FcUcs4ToUtf8
extern __typeof (FcUtf16ToUcs4) IA__FcUtf16ToUcs4 __attribute((visibility("hidden")));
#define FcUtf16ToUcs4 IA__FcUtf16ToUcs4
extern __typeof (FcUtf16Len) IA__FcUtf16Len __attribute((visibility("hidden")));
#define FcUtf16Len IA__FcUtf16Len
extern __typeof (FcStrDirname) IA__FcStrDirname __attribute((visibility("hidden")));
#define FcStrDirname IA__FcStrDirname
extern __typeof (FcStrBasename) IA__FcStrBasename __attribute((visibility("hidden")));
#define FcStrBasename IA__FcStrBasename
extern __typeof (FcStrSetCreate) IA__FcStrSetCreate __attribute((visibility("hidden")));
#define FcStrSetCreate IA__FcStrSetCreate
extern __typeof (FcStrSetMember) IA__FcStrSetMember __attribute((visibility("hidden")));
#define FcStrSetMember IA__FcStrSetMember
extern __typeof (FcStrSetEqual) IA__FcStrSetEqual __attribute((visibility("hidden")));
#define FcStrSetEqual IA__FcStrSetEqual
extern __typeof (FcStrSetAdd) IA__FcStrSetAdd __attribute((visibility("hidden")));
#define FcStrSetAdd IA__FcStrSetAdd
extern __typeof (FcStrSetAddFilename) IA__FcStrSetAddFilename __attribute((visibility("hidden")));
#define FcStrSetAddFilename IA__FcStrSetAddFilename
extern __typeof (FcStrSetDel) IA__FcStrSetDel __attribute((visibility("hidden")));
#define FcStrSetDel IA__FcStrSetDel
extern __typeof (FcStrSetDestroy) IA__FcStrSetDestroy __attribute((visibility("hidden")));
#define FcStrSetDestroy IA__FcStrSetDestroy
extern __typeof (FcStrListCreate) IA__FcStrListCreate __attribute((visibility("hidden")));
#define FcStrListCreate IA__FcStrListCreate
extern __typeof (FcStrListFirst) IA__FcStrListFirst __attribute((visibility("hidden")));
#define FcStrListFirst IA__FcStrListFirst
extern __typeof (FcStrListNext) IA__FcStrListNext __attribute((visibility("hidden")));
#define FcStrListNext IA__FcStrListNext
extern __typeof (FcStrListDone) IA__FcStrListDone __attribute((visibility("hidden")));
#define FcStrListDone IA__FcStrListDone
extern __typeof (FcConfigParseAndLoad) IA__FcConfigParseAndLoad __attribute((visibility("hidden")));
#define FcConfigParseAndLoad IA__FcConfigParseAndLoad
extern __typeof (FcConfigGetRescanInverval) IA__FcConfigGetRescanInverval __attribute((visibility("hidden")));
#define FcConfigGetRescanInverval IA__FcConfigGetRescanInverval
extern __typeof (FcConfigSetRescanInverval) IA__FcConfigSetRescanInverval __attribute((visibility("hidden")));
#define FcConfigSetRescanInverval IA__FcConfigSetRescanInverval

View File

@@ -0,0 +1,442 @@
#if HAVE_GNUC_ATTRIBUTE
#ifdef __fcblanks__
# undef FcBlanksCreate
extern __typeof (FcBlanksCreate) FcBlanksCreate __attribute((alias("IA__FcBlanksCreate"), visibility("default")));
# undef FcBlanksDestroy
extern __typeof (FcBlanksDestroy) FcBlanksDestroy __attribute((alias("IA__FcBlanksDestroy"), visibility("default")));
# undef FcBlanksAdd
extern __typeof (FcBlanksAdd) FcBlanksAdd __attribute((alias("IA__FcBlanksAdd"), visibility("default")));
# undef FcBlanksIsMember
extern __typeof (FcBlanksIsMember) FcBlanksIsMember __attribute((alias("IA__FcBlanksIsMember"), visibility("default")));
#endif /* __fcblanks__ */
#ifdef __fccache__
# undef FcCacheCopySet
extern __typeof (FcCacheCopySet) FcCacheCopySet __attribute((alias("IA__FcCacheCopySet"), visibility("default")));
# undef FcCacheNumSubdir
extern __typeof (FcCacheNumSubdir) FcCacheNumSubdir __attribute((alias("IA__FcCacheNumSubdir"), visibility("default")));
# undef FcCacheNumFont
extern __typeof (FcCacheNumFont) FcCacheNumFont __attribute((alias("IA__FcCacheNumFont"), visibility("default")));
# undef FcDirCacheUnlink
extern __typeof (FcDirCacheUnlink) FcDirCacheUnlink __attribute((alias("IA__FcDirCacheUnlink"), visibility("default")));
# undef FcDirCacheValid
extern __typeof (FcDirCacheValid) FcDirCacheValid __attribute((alias("IA__FcDirCacheValid"), visibility("default")));
# undef FcDirCacheClean
extern __typeof (FcDirCacheClean) FcDirCacheClean __attribute((alias("IA__FcDirCacheClean"), visibility("default")));
# undef FcCacheCreateTagFile
extern __typeof (FcCacheCreateTagFile) FcCacheCreateTagFile __attribute((alias("IA__FcCacheCreateTagFile"), visibility("default")));
#endif /* __fccache__ */
#ifdef __fccfg__
# undef FcConfigHome
extern __typeof (FcConfigHome) FcConfigHome __attribute((alias("IA__FcConfigHome"), visibility("default")));
# undef FcConfigEnableHome
extern __typeof (FcConfigEnableHome) FcConfigEnableHome __attribute((alias("IA__FcConfigEnableHome"), visibility("default")));
# undef FcConfigFilename
extern __typeof (FcConfigFilename) FcConfigFilename __attribute((alias("IA__FcConfigFilename"), visibility("default")));
# undef FcConfigCreate
extern __typeof (FcConfigCreate) FcConfigCreate __attribute((alias("IA__FcConfigCreate"), visibility("default")));
# undef FcConfigReference
extern __typeof (FcConfigReference) FcConfigReference __attribute((alias("IA__FcConfigReference"), visibility("default")));
# undef FcConfigDestroy
extern __typeof (FcConfigDestroy) FcConfigDestroy __attribute((alias("IA__FcConfigDestroy"), visibility("default")));
# undef FcConfigSetCurrent
extern __typeof (FcConfigSetCurrent) FcConfigSetCurrent __attribute((alias("IA__FcConfigSetCurrent"), visibility("default")));
# undef FcConfigGetCurrent
extern __typeof (FcConfigGetCurrent) FcConfigGetCurrent __attribute((alias("IA__FcConfigGetCurrent"), visibility("default")));
# undef FcConfigUptoDate
extern __typeof (FcConfigUptoDate) FcConfigUptoDate __attribute((alias("IA__FcConfigUptoDate"), visibility("default")));
# undef FcConfigBuildFonts
extern __typeof (FcConfigBuildFonts) FcConfigBuildFonts __attribute((alias("IA__FcConfigBuildFonts"), visibility("default")));
# undef FcConfigGetFontDirs
extern __typeof (FcConfigGetFontDirs) FcConfigGetFontDirs __attribute((alias("IA__FcConfigGetFontDirs"), visibility("default")));
# undef FcConfigGetConfigDirs
extern __typeof (FcConfigGetConfigDirs) FcConfigGetConfigDirs __attribute((alias("IA__FcConfigGetConfigDirs"), visibility("default")));
# undef FcConfigGetConfigFiles
extern __typeof (FcConfigGetConfigFiles) FcConfigGetConfigFiles __attribute((alias("IA__FcConfigGetConfigFiles"), visibility("default")));
# undef FcConfigGetCache
extern __typeof (FcConfigGetCache) FcConfigGetCache __attribute((alias("IA__FcConfigGetCache"), visibility("default")));
# undef FcConfigGetBlanks
extern __typeof (FcConfigGetBlanks) FcConfigGetBlanks __attribute((alias("IA__FcConfigGetBlanks"), visibility("default")));
# undef FcConfigGetCacheDirs
extern __typeof (FcConfigGetCacheDirs) FcConfigGetCacheDirs __attribute((alias("IA__FcConfigGetCacheDirs"), visibility("default")));
# undef FcConfigGetRescanInterval
extern __typeof (FcConfigGetRescanInterval) FcConfigGetRescanInterval __attribute((alias("IA__FcConfigGetRescanInterval"), visibility("default")));
# undef FcConfigSetRescanInterval
extern __typeof (FcConfigSetRescanInterval) FcConfigSetRescanInterval __attribute((alias("IA__FcConfigSetRescanInterval"), visibility("default")));
# undef FcConfigGetFonts
extern __typeof (FcConfigGetFonts) FcConfigGetFonts __attribute((alias("IA__FcConfigGetFonts"), visibility("default")));
# undef FcConfigAppFontAddFile
extern __typeof (FcConfigAppFontAddFile) FcConfigAppFontAddFile __attribute((alias("IA__FcConfigAppFontAddFile"), visibility("default")));
# undef FcConfigAppFontAddDir
extern __typeof (FcConfigAppFontAddDir) FcConfigAppFontAddDir __attribute((alias("IA__FcConfigAppFontAddDir"), visibility("default")));
# undef FcConfigAppFontClear
extern __typeof (FcConfigAppFontClear) FcConfigAppFontClear __attribute((alias("IA__FcConfigAppFontClear"), visibility("default")));
# undef FcConfigSubstituteWithPat
extern __typeof (FcConfigSubstituteWithPat) FcConfigSubstituteWithPat __attribute((alias("IA__FcConfigSubstituteWithPat"), visibility("default")));
# undef FcConfigSubstitute
extern __typeof (FcConfigSubstitute) FcConfigSubstitute __attribute((alias("IA__FcConfigSubstitute"), visibility("default")));
# undef FcConfigGetSysRoot
extern __typeof (FcConfigGetSysRoot) FcConfigGetSysRoot __attribute((alias("IA__FcConfigGetSysRoot"), visibility("default")));
# undef FcConfigSetSysRoot
extern __typeof (FcConfigSetSysRoot) FcConfigSetSysRoot __attribute((alias("IA__FcConfigSetSysRoot"), visibility("default")));
#endif /* __fccfg__ */
#ifdef __fccharset__
# undef FcCharSetCreate
extern __typeof (FcCharSetCreate) FcCharSetCreate __attribute((alias("IA__FcCharSetCreate"), visibility("default")));
# undef FcCharSetNew
extern __typeof (FcCharSetNew) FcCharSetNew __attribute((alias("IA__FcCharSetNew"), visibility("default")));
# undef FcCharSetDestroy
extern __typeof (FcCharSetDestroy) FcCharSetDestroy __attribute((alias("IA__FcCharSetDestroy"), visibility("default")));
# undef FcCharSetAddChar
extern __typeof (FcCharSetAddChar) FcCharSetAddChar __attribute((alias("IA__FcCharSetAddChar"), visibility("default")));
# undef FcCharSetDelChar
extern __typeof (FcCharSetDelChar) FcCharSetDelChar __attribute((alias("IA__FcCharSetDelChar"), visibility("default")));
# undef FcCharSetCopy
extern __typeof (FcCharSetCopy) FcCharSetCopy __attribute((alias("IA__FcCharSetCopy"), visibility("default")));
# undef FcCharSetEqual
extern __typeof (FcCharSetEqual) FcCharSetEqual __attribute((alias("IA__FcCharSetEqual"), visibility("default")));
# undef FcCharSetIntersect
extern __typeof (FcCharSetIntersect) FcCharSetIntersect __attribute((alias("IA__FcCharSetIntersect"), visibility("default")));
# undef FcCharSetUnion
extern __typeof (FcCharSetUnion) FcCharSetUnion __attribute((alias("IA__FcCharSetUnion"), visibility("default")));
# undef FcCharSetSubtract
extern __typeof (FcCharSetSubtract) FcCharSetSubtract __attribute((alias("IA__FcCharSetSubtract"), visibility("default")));
# undef FcCharSetMerge
extern __typeof (FcCharSetMerge) FcCharSetMerge __attribute((alias("IA__FcCharSetMerge"), visibility("default")));
# undef FcCharSetHasChar
extern __typeof (FcCharSetHasChar) FcCharSetHasChar __attribute((alias("IA__FcCharSetHasChar"), visibility("default")));
# undef FcCharSetCount
extern __typeof (FcCharSetCount) FcCharSetCount __attribute((alias("IA__FcCharSetCount"), visibility("default")));
# undef FcCharSetIntersectCount
extern __typeof (FcCharSetIntersectCount) FcCharSetIntersectCount __attribute((alias("IA__FcCharSetIntersectCount"), visibility("default")));
# undef FcCharSetSubtractCount
extern __typeof (FcCharSetSubtractCount) FcCharSetSubtractCount __attribute((alias("IA__FcCharSetSubtractCount"), visibility("default")));
# undef FcCharSetIsSubset
extern __typeof (FcCharSetIsSubset) FcCharSetIsSubset __attribute((alias("IA__FcCharSetIsSubset"), visibility("default")));
# undef FcCharSetFirstPage
extern __typeof (FcCharSetFirstPage) FcCharSetFirstPage __attribute((alias("IA__FcCharSetFirstPage"), visibility("default")));
# undef FcCharSetNextPage
extern __typeof (FcCharSetNextPage) FcCharSetNextPage __attribute((alias("IA__FcCharSetNextPage"), visibility("default")));
# undef FcCharSetCoverage
extern __typeof (FcCharSetCoverage) FcCharSetCoverage __attribute((alias("IA__FcCharSetCoverage"), visibility("default")));
#endif /* __fccharset__ */
#ifdef __fcdbg__
# undef FcValuePrint
extern __typeof (FcValuePrint) FcValuePrint __attribute((alias("IA__FcValuePrint"), visibility("default")));
# undef FcPatternPrint
extern __typeof (FcPatternPrint) FcPatternPrint __attribute((alias("IA__FcPatternPrint"), visibility("default")));
# undef FcFontSetPrint
extern __typeof (FcFontSetPrint) FcFontSetPrint __attribute((alias("IA__FcFontSetPrint"), visibility("default")));
#endif /* __fcdbg__ */
#ifdef __fcdefault__
# undef FcGetDefaultLangs
extern __typeof (FcGetDefaultLangs) FcGetDefaultLangs __attribute((alias("IA__FcGetDefaultLangs"), visibility("default")));
# undef FcDefaultSubstitute
extern __typeof (FcDefaultSubstitute) FcDefaultSubstitute __attribute((alias("IA__FcDefaultSubstitute"), visibility("default")));
#endif /* __fcdefault__ */
#ifdef __fcdir__
# undef FcFileIsDir
extern __typeof (FcFileIsDir) FcFileIsDir __attribute((alias("IA__FcFileIsDir"), visibility("default")));
# undef FcFileScan
extern __typeof (FcFileScan) FcFileScan __attribute((alias("IA__FcFileScan"), visibility("default")));
# undef FcDirScan
extern __typeof (FcDirScan) FcDirScan __attribute((alias("IA__FcDirScan"), visibility("default")));
# undef FcDirSave
extern __typeof (FcDirSave) FcDirSave __attribute((alias("IA__FcDirSave"), visibility("default")));
#endif /* __fcdir__ */
#ifdef __fccache__
# undef FcDirCacheLoad
extern __typeof (FcDirCacheLoad) FcDirCacheLoad __attribute((alias("IA__FcDirCacheLoad"), visibility("default")));
#endif /* __fccache__ */
#ifdef __fcdir__
# undef FcDirCacheRescan
extern __typeof (FcDirCacheRescan) FcDirCacheRescan __attribute((alias("IA__FcDirCacheRescan"), visibility("default")));
# undef FcDirCacheRead
extern __typeof (FcDirCacheRead) FcDirCacheRead __attribute((alias("IA__FcDirCacheRead"), visibility("default")));
#endif /* __fcdir__ */
#ifdef __fccache__
# undef FcDirCacheLoadFile
extern __typeof (FcDirCacheLoadFile) FcDirCacheLoadFile __attribute((alias("IA__FcDirCacheLoadFile"), visibility("default")));
# undef FcDirCacheUnload
extern __typeof (FcDirCacheUnload) FcDirCacheUnload __attribute((alias("IA__FcDirCacheUnload"), visibility("default")));
#endif /* __fccache__ */
#ifdef __fcfreetype__
# undef FcFreeTypeQuery
extern __typeof (FcFreeTypeQuery) FcFreeTypeQuery __attribute((alias("IA__FcFreeTypeQuery"), visibility("default")));
#endif /* __fcfreetype__ */
#ifdef __fcfs__
# undef FcFontSetCreate
extern __typeof (FcFontSetCreate) FcFontSetCreate __attribute((alias("IA__FcFontSetCreate"), visibility("default")));
# undef FcFontSetDestroy
extern __typeof (FcFontSetDestroy) FcFontSetDestroy __attribute((alias("IA__FcFontSetDestroy"), visibility("default")));
# undef FcFontSetAdd
extern __typeof (FcFontSetAdd) FcFontSetAdd __attribute((alias("IA__FcFontSetAdd"), visibility("default")));
#endif /* __fcfs__ */
#ifdef __fcinit__
# undef FcInitLoadConfig
extern __typeof (FcInitLoadConfig) FcInitLoadConfig __attribute((alias("IA__FcInitLoadConfig"), visibility("default")));
# undef FcInitLoadConfigAndFonts
extern __typeof (FcInitLoadConfigAndFonts) FcInitLoadConfigAndFonts __attribute((alias("IA__FcInitLoadConfigAndFonts"), visibility("default")));
# undef FcInit
extern __typeof (FcInit) FcInit __attribute((alias("IA__FcInit"), visibility("default")));
# undef FcFini
extern __typeof (FcFini) FcFini __attribute((alias("IA__FcFini"), visibility("default")));
# undef FcGetVersion
extern __typeof (FcGetVersion) FcGetVersion __attribute((alias("IA__FcGetVersion"), visibility("default")));
# undef FcInitReinitialize
extern __typeof (FcInitReinitialize) FcInitReinitialize __attribute((alias("IA__FcInitReinitialize"), visibility("default")));
# undef FcInitBringUptoDate
extern __typeof (FcInitBringUptoDate) FcInitBringUptoDate __attribute((alias("IA__FcInitBringUptoDate"), visibility("default")));
#endif /* __fcinit__ */
#ifdef __fclang__
# undef FcGetLangs
extern __typeof (FcGetLangs) FcGetLangs __attribute((alias("IA__FcGetLangs"), visibility("default")));
# undef FcLangNormalize
extern __typeof (FcLangNormalize) FcLangNormalize __attribute((alias("IA__FcLangNormalize"), visibility("default")));
# undef FcLangGetCharSet
extern __typeof (FcLangGetCharSet) FcLangGetCharSet __attribute((alias("IA__FcLangGetCharSet"), visibility("default")));
# undef FcLangSetCreate
extern __typeof (FcLangSetCreate) FcLangSetCreate __attribute((alias("IA__FcLangSetCreate"), visibility("default")));
# undef FcLangSetDestroy
extern __typeof (FcLangSetDestroy) FcLangSetDestroy __attribute((alias("IA__FcLangSetDestroy"), visibility("default")));
# undef FcLangSetCopy
extern __typeof (FcLangSetCopy) FcLangSetCopy __attribute((alias("IA__FcLangSetCopy"), visibility("default")));
# undef FcLangSetAdd
extern __typeof (FcLangSetAdd) FcLangSetAdd __attribute((alias("IA__FcLangSetAdd"), visibility("default")));
# undef FcLangSetDel
extern __typeof (FcLangSetDel) FcLangSetDel __attribute((alias("IA__FcLangSetDel"), visibility("default")));
# undef FcLangSetHasLang
extern __typeof (FcLangSetHasLang) FcLangSetHasLang __attribute((alias("IA__FcLangSetHasLang"), visibility("default")));
# undef FcLangSetCompare
extern __typeof (FcLangSetCompare) FcLangSetCompare __attribute((alias("IA__FcLangSetCompare"), visibility("default")));
# undef FcLangSetContains
extern __typeof (FcLangSetContains) FcLangSetContains __attribute((alias("IA__FcLangSetContains"), visibility("default")));
# undef FcLangSetEqual
extern __typeof (FcLangSetEqual) FcLangSetEqual __attribute((alias("IA__FcLangSetEqual"), visibility("default")));
# undef FcLangSetHash
extern __typeof (FcLangSetHash) FcLangSetHash __attribute((alias("IA__FcLangSetHash"), visibility("default")));
# undef FcLangSetGetLangs
extern __typeof (FcLangSetGetLangs) FcLangSetGetLangs __attribute((alias("IA__FcLangSetGetLangs"), visibility("default")));
# undef FcLangSetUnion
extern __typeof (FcLangSetUnion) FcLangSetUnion __attribute((alias("IA__FcLangSetUnion"), visibility("default")));
# undef FcLangSetSubtract
extern __typeof (FcLangSetSubtract) FcLangSetSubtract __attribute((alias("IA__FcLangSetSubtract"), visibility("default")));
#endif /* __fclang__ */
#ifdef __fclist__
# undef FcObjectSetCreate
extern __typeof (FcObjectSetCreate) FcObjectSetCreate __attribute((alias("IA__FcObjectSetCreate"), visibility("default")));
# undef FcObjectSetAdd
extern __typeof (FcObjectSetAdd) FcObjectSetAdd __attribute((alias("IA__FcObjectSetAdd"), visibility("default")));
# undef FcObjectSetDestroy
extern __typeof (FcObjectSetDestroy) FcObjectSetDestroy __attribute((alias("IA__FcObjectSetDestroy"), visibility("default")));
# undef FcObjectSetVaBuild
extern __typeof (FcObjectSetVaBuild) FcObjectSetVaBuild __attribute((alias("IA__FcObjectSetVaBuild"), visibility("default")));
# undef FcObjectSetBuild
extern __typeof (FcObjectSetBuild) FcObjectSetBuild __attribute((alias("IA__FcObjectSetBuild"), visibility("default")));
# undef FcFontSetList
extern __typeof (FcFontSetList) FcFontSetList __attribute((alias("IA__FcFontSetList"), visibility("default")));
# undef FcFontList
extern __typeof (FcFontList) FcFontList __attribute((alias("IA__FcFontList"), visibility("default")));
#endif /* __fclist__ */
#ifdef __fcatomic__
# undef FcAtomicCreate
extern __typeof (FcAtomicCreate) FcAtomicCreate __attribute((alias("IA__FcAtomicCreate"), visibility("default")));
# undef FcAtomicLock
extern __typeof (FcAtomicLock) FcAtomicLock __attribute((alias("IA__FcAtomicLock"), visibility("default")));
# undef FcAtomicNewFile
extern __typeof (FcAtomicNewFile) FcAtomicNewFile __attribute((alias("IA__FcAtomicNewFile"), visibility("default")));
# undef FcAtomicOrigFile
extern __typeof (FcAtomicOrigFile) FcAtomicOrigFile __attribute((alias("IA__FcAtomicOrigFile"), visibility("default")));
# undef FcAtomicReplaceOrig
extern __typeof (FcAtomicReplaceOrig) FcAtomicReplaceOrig __attribute((alias("IA__FcAtomicReplaceOrig"), visibility("default")));
# undef FcAtomicDeleteNew
extern __typeof (FcAtomicDeleteNew) FcAtomicDeleteNew __attribute((alias("IA__FcAtomicDeleteNew"), visibility("default")));
# undef FcAtomicUnlock
extern __typeof (FcAtomicUnlock) FcAtomicUnlock __attribute((alias("IA__FcAtomicUnlock"), visibility("default")));
# undef FcAtomicDestroy
extern __typeof (FcAtomicDestroy) FcAtomicDestroy __attribute((alias("IA__FcAtomicDestroy"), visibility("default")));
#endif /* __fcatomic__ */
#ifdef __fcmatch__
# undef FcFontSetMatch
extern __typeof (FcFontSetMatch) FcFontSetMatch __attribute((alias("IA__FcFontSetMatch"), visibility("default")));
# undef FcFontMatch
extern __typeof (FcFontMatch) FcFontMatch __attribute((alias("IA__FcFontMatch"), visibility("default")));
# undef FcFontRenderPrepare
extern __typeof (FcFontRenderPrepare) FcFontRenderPrepare __attribute((alias("IA__FcFontRenderPrepare"), visibility("default")));
# undef FcFontSetSort
extern __typeof (FcFontSetSort) FcFontSetSort __attribute((alias("IA__FcFontSetSort"), visibility("default")));
# undef FcFontSort
extern __typeof (FcFontSort) FcFontSort __attribute((alias("IA__FcFontSort"), visibility("default")));
# undef FcFontSetSortDestroy
extern __typeof (FcFontSetSortDestroy) FcFontSetSortDestroy __attribute((alias("IA__FcFontSetSortDestroy"), visibility("default")));
#endif /* __fcmatch__ */
#ifdef __fcmatrix__
# undef FcMatrixCopy
extern __typeof (FcMatrixCopy) FcMatrixCopy __attribute((alias("IA__FcMatrixCopy"), visibility("default")));
# undef FcMatrixEqual
extern __typeof (FcMatrixEqual) FcMatrixEqual __attribute((alias("IA__FcMatrixEqual"), visibility("default")));
# undef FcMatrixMultiply
extern __typeof (FcMatrixMultiply) FcMatrixMultiply __attribute((alias("IA__FcMatrixMultiply"), visibility("default")));
# undef FcMatrixRotate
extern __typeof (FcMatrixRotate) FcMatrixRotate __attribute((alias("IA__FcMatrixRotate"), visibility("default")));
# undef FcMatrixScale
extern __typeof (FcMatrixScale) FcMatrixScale __attribute((alias("IA__FcMatrixScale"), visibility("default")));
# undef FcMatrixShear
extern __typeof (FcMatrixShear) FcMatrixShear __attribute((alias("IA__FcMatrixShear"), visibility("default")));
#endif /* __fcmatrix__ */
#ifdef __fcname__
# undef FcNameRegisterObjectTypes
extern __typeof (FcNameRegisterObjectTypes) FcNameRegisterObjectTypes __attribute((alias("IA__FcNameRegisterObjectTypes"), visibility("default")));
# undef FcNameUnregisterObjectTypes
extern __typeof (FcNameUnregisterObjectTypes) FcNameUnregisterObjectTypes __attribute((alias("IA__FcNameUnregisterObjectTypes"), visibility("default")));
# undef FcNameGetObjectType
extern __typeof (FcNameGetObjectType) FcNameGetObjectType __attribute((alias("IA__FcNameGetObjectType"), visibility("default")));
# undef FcNameRegisterConstants
extern __typeof (FcNameRegisterConstants) FcNameRegisterConstants __attribute((alias("IA__FcNameRegisterConstants"), visibility("default")));
# undef FcNameUnregisterConstants
extern __typeof (FcNameUnregisterConstants) FcNameUnregisterConstants __attribute((alias("IA__FcNameUnregisterConstants"), visibility("default")));
# undef FcNameGetConstant
extern __typeof (FcNameGetConstant) FcNameGetConstant __attribute((alias("IA__FcNameGetConstant"), visibility("default")));
# undef FcNameConstant
extern __typeof (FcNameConstant) FcNameConstant __attribute((alias("IA__FcNameConstant"), visibility("default")));
# undef FcNameParse
extern __typeof (FcNameParse) FcNameParse __attribute((alias("IA__FcNameParse"), visibility("default")));
# undef FcNameUnparse
extern __typeof (FcNameUnparse) FcNameUnparse __attribute((alias("IA__FcNameUnparse"), visibility("default")));
#endif /* __fcname__ */
#ifdef __fcpat__
# undef FcPatternCreate
extern __typeof (FcPatternCreate) FcPatternCreate __attribute((alias("IA__FcPatternCreate"), visibility("default")));
# undef FcPatternDuplicate
extern __typeof (FcPatternDuplicate) FcPatternDuplicate __attribute((alias("IA__FcPatternDuplicate"), visibility("default")));
# undef FcPatternReference
extern __typeof (FcPatternReference) FcPatternReference __attribute((alias("IA__FcPatternReference"), visibility("default")));
# undef FcPatternFilter
extern __typeof (FcPatternFilter) FcPatternFilter __attribute((alias("IA__FcPatternFilter"), visibility("default")));
# undef FcValueDestroy
extern __typeof (FcValueDestroy) FcValueDestroy __attribute((alias("IA__FcValueDestroy"), visibility("default")));
# undef FcValueEqual
extern __typeof (FcValueEqual) FcValueEqual __attribute((alias("IA__FcValueEqual"), visibility("default")));
# undef FcValueSave
extern __typeof (FcValueSave) FcValueSave __attribute((alias("IA__FcValueSave"), visibility("default")));
# undef FcPatternDestroy
extern __typeof (FcPatternDestroy) FcPatternDestroy __attribute((alias("IA__FcPatternDestroy"), visibility("default")));
# undef FcPatternEqual
extern __typeof (FcPatternEqual) FcPatternEqual __attribute((alias("IA__FcPatternEqual"), visibility("default")));
# undef FcPatternEqualSubset
extern __typeof (FcPatternEqualSubset) FcPatternEqualSubset __attribute((alias("IA__FcPatternEqualSubset"), visibility("default")));
# undef FcPatternHash
extern __typeof (FcPatternHash) FcPatternHash __attribute((alias("IA__FcPatternHash"), visibility("default")));
# undef FcPatternAdd
extern __typeof (FcPatternAdd) FcPatternAdd __attribute((alias("IA__FcPatternAdd"), visibility("default")));
# undef FcPatternAddWeak
extern __typeof (FcPatternAddWeak) FcPatternAddWeak __attribute((alias("IA__FcPatternAddWeak"), visibility("default")));
# undef FcPatternGet
extern __typeof (FcPatternGet) FcPatternGet __attribute((alias("IA__FcPatternGet"), visibility("default")));
# undef FcPatternDel
extern __typeof (FcPatternDel) FcPatternDel __attribute((alias("IA__FcPatternDel"), visibility("default")));
# undef FcPatternRemove
extern __typeof (FcPatternRemove) FcPatternRemove __attribute((alias("IA__FcPatternRemove"), visibility("default")));
# undef FcPatternAddInteger
extern __typeof (FcPatternAddInteger) FcPatternAddInteger __attribute((alias("IA__FcPatternAddInteger"), visibility("default")));
# undef FcPatternAddDouble
extern __typeof (FcPatternAddDouble) FcPatternAddDouble __attribute((alias("IA__FcPatternAddDouble"), visibility("default")));
# undef FcPatternAddString
extern __typeof (FcPatternAddString) FcPatternAddString __attribute((alias("IA__FcPatternAddString"), visibility("default")));
# undef FcPatternAddMatrix
extern __typeof (FcPatternAddMatrix) FcPatternAddMatrix __attribute((alias("IA__FcPatternAddMatrix"), visibility("default")));
# undef FcPatternAddCharSet
extern __typeof (FcPatternAddCharSet) FcPatternAddCharSet __attribute((alias("IA__FcPatternAddCharSet"), visibility("default")));
# undef FcPatternAddBool
extern __typeof (FcPatternAddBool) FcPatternAddBool __attribute((alias("IA__FcPatternAddBool"), visibility("default")));
# undef FcPatternAddLangSet
extern __typeof (FcPatternAddLangSet) FcPatternAddLangSet __attribute((alias("IA__FcPatternAddLangSet"), visibility("default")));
# undef FcPatternGetInteger
extern __typeof (FcPatternGetInteger) FcPatternGetInteger __attribute((alias("IA__FcPatternGetInteger"), visibility("default")));
# undef FcPatternGetDouble
extern __typeof (FcPatternGetDouble) FcPatternGetDouble __attribute((alias("IA__FcPatternGetDouble"), visibility("default")));
# undef FcPatternGetString
extern __typeof (FcPatternGetString) FcPatternGetString __attribute((alias("IA__FcPatternGetString"), visibility("default")));
# undef FcPatternGetMatrix
extern __typeof (FcPatternGetMatrix) FcPatternGetMatrix __attribute((alias("IA__FcPatternGetMatrix"), visibility("default")));
# undef FcPatternGetCharSet
extern __typeof (FcPatternGetCharSet) FcPatternGetCharSet __attribute((alias("IA__FcPatternGetCharSet"), visibility("default")));
# undef FcPatternGetBool
extern __typeof (FcPatternGetBool) FcPatternGetBool __attribute((alias("IA__FcPatternGetBool"), visibility("default")));
# undef FcPatternGetLangSet
extern __typeof (FcPatternGetLangSet) FcPatternGetLangSet __attribute((alias("IA__FcPatternGetLangSet"), visibility("default")));
# undef FcPatternVaBuild
extern __typeof (FcPatternVaBuild) FcPatternVaBuild __attribute((alias("IA__FcPatternVaBuild"), visibility("default")));
# undef FcPatternBuild
extern __typeof (FcPatternBuild) FcPatternBuild __attribute((alias("IA__FcPatternBuild"), visibility("default")));
#endif /* __fcpat__ */
#ifdef __fcformat__
# undef FcPatternFormat
extern __typeof (FcPatternFormat) FcPatternFormat __attribute((alias("IA__FcPatternFormat"), visibility("default")));
#endif /* __fcformat__ */
#ifdef __fcstr__
# undef FcStrCopy
extern __typeof (FcStrCopy) FcStrCopy __attribute((alias("IA__FcStrCopy"), visibility("default")));
# undef FcStrCopyFilename
extern __typeof (FcStrCopyFilename) FcStrCopyFilename __attribute((alias("IA__FcStrCopyFilename"), visibility("default")));
# undef FcStrPlus
extern __typeof (FcStrPlus) FcStrPlus __attribute((alias("IA__FcStrPlus"), visibility("default")));
# undef FcStrFree
extern __typeof (FcStrFree) FcStrFree __attribute((alias("IA__FcStrFree"), visibility("default")));
# undef FcStrDowncase
extern __typeof (FcStrDowncase) FcStrDowncase __attribute((alias("IA__FcStrDowncase"), visibility("default")));
# undef FcStrCmpIgnoreCase
extern __typeof (FcStrCmpIgnoreCase) FcStrCmpIgnoreCase __attribute((alias("IA__FcStrCmpIgnoreCase"), visibility("default")));
# undef FcStrCmp
extern __typeof (FcStrCmp) FcStrCmp __attribute((alias("IA__FcStrCmp"), visibility("default")));
# undef FcStrStrIgnoreCase
extern __typeof (FcStrStrIgnoreCase) FcStrStrIgnoreCase __attribute((alias("IA__FcStrStrIgnoreCase"), visibility("default")));
# undef FcStrStr
extern __typeof (FcStrStr) FcStrStr __attribute((alias("IA__FcStrStr"), visibility("default")));
# undef FcUtf8ToUcs4
extern __typeof (FcUtf8ToUcs4) FcUtf8ToUcs4 __attribute((alias("IA__FcUtf8ToUcs4"), visibility("default")));
# undef FcUtf8Len
extern __typeof (FcUtf8Len) FcUtf8Len __attribute((alias("IA__FcUtf8Len"), visibility("default")));
# undef FcUcs4ToUtf8
extern __typeof (FcUcs4ToUtf8) FcUcs4ToUtf8 __attribute((alias("IA__FcUcs4ToUtf8"), visibility("default")));
# undef FcUtf16ToUcs4
extern __typeof (FcUtf16ToUcs4) FcUtf16ToUcs4 __attribute((alias("IA__FcUtf16ToUcs4"), visibility("default")));
# undef FcUtf16Len
extern __typeof (FcUtf16Len) FcUtf16Len __attribute((alias("IA__FcUtf16Len"), visibility("default")));
# undef FcStrDirname
extern __typeof (FcStrDirname) FcStrDirname __attribute((alias("IA__FcStrDirname"), visibility("default")));
# undef FcStrBasename
extern __typeof (FcStrBasename) FcStrBasename __attribute((alias("IA__FcStrBasename"), visibility("default")));
# undef FcStrSetCreate
extern __typeof (FcStrSetCreate) FcStrSetCreate __attribute((alias("IA__FcStrSetCreate"), visibility("default")));
# undef FcStrSetMember
extern __typeof (FcStrSetMember) FcStrSetMember __attribute((alias("IA__FcStrSetMember"), visibility("default")));
# undef FcStrSetEqual
extern __typeof (FcStrSetEqual) FcStrSetEqual __attribute((alias("IA__FcStrSetEqual"), visibility("default")));
# undef FcStrSetAdd
extern __typeof (FcStrSetAdd) FcStrSetAdd __attribute((alias("IA__FcStrSetAdd"), visibility("default")));
# undef FcStrSetAddFilename
extern __typeof (FcStrSetAddFilename) FcStrSetAddFilename __attribute((alias("IA__FcStrSetAddFilename"), visibility("default")));
# undef FcStrSetDel
extern __typeof (FcStrSetDel) FcStrSetDel __attribute((alias("IA__FcStrSetDel"), visibility("default")));
# undef FcStrSetDestroy
extern __typeof (FcStrSetDestroy) FcStrSetDestroy __attribute((alias("IA__FcStrSetDestroy"), visibility("default")));
# undef FcStrListCreate
extern __typeof (FcStrListCreate) FcStrListCreate __attribute((alias("IA__FcStrListCreate"), visibility("default")));
# undef FcStrListFirst
extern __typeof (FcStrListFirst) FcStrListFirst __attribute((alias("IA__FcStrListFirst"), visibility("default")));
# undef FcStrListNext
extern __typeof (FcStrListNext) FcStrListNext __attribute((alias("IA__FcStrListNext"), visibility("default")));
# undef FcStrListDone
extern __typeof (FcStrListDone) FcStrListDone __attribute((alias("IA__FcStrListDone"), visibility("default")));
#endif /* __fcstr__ */
#ifdef __fcxml__
# undef FcConfigParseAndLoad
extern __typeof (FcConfigParseAndLoad) FcConfigParseAndLoad __attribute((alias("IA__FcConfigParseAndLoad"), visibility("default")));
#endif /* __fcxml__ */
#ifdef __fccfg__
# undef FcConfigGetRescanInverval
extern __typeof (FcConfigGetRescanInverval) FcConfigGetRescanInverval __attribute((alias("IA__FcConfigGetRescanInverval"), visibility("default")));
# undef FcConfigSetRescanInverval
extern __typeof (FcConfigSetRescanInverval) FcConfigSetRescanInverval __attribute((alias("IA__FcConfigSetRescanInverval"), visibility("default")));
#endif /* */
#endif /* HAVE_GNUC_ATTRIBUTE */

View File

@@ -0,0 +1,60 @@
/*
* Copyright © 2002 Keith Packard
* Copyright © 2010 Behdad Esfahbod
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include <stdio.h>
#include "fcint.h"
#include "fcarch.h"
FC_ASSERT_STATIC (1 == sizeof (char));
FC_ASSERT_STATIC (2 == sizeof (FcChar16));
FC_ASSERT_STATIC (4 == sizeof (int));
FC_ASSERT_STATIC (4 == sizeof (FcChar32));
FC_ASSERT_STATIC (4 == sizeof (FcObject));
FC_ASSERT_STATIC (4 == sizeof (FcValueBinding));
FC_ASSERT_STATIC (8 == sizeof (FcAlign));
FC_ASSERT_STATIC (0x20 == sizeof (FcCharLeaf));
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (intptr_t));
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcPatternEltPtr));
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueListPtr));
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (char *));
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (struct FcPatternElt *));
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueList *));
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcStrSet *));
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcCharLeaf **));
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcChar16 *));
FC_ASSERT_STATIC (0x08 + 1*FC_MAX(SIZEOF_VOID_P,ALIGNOF_DOUBLE) == sizeof (FcValue));
FC_ASSERT_STATIC (0x00 + 2*SIZEOF_VOID_P == sizeof (FcPatternElt));
FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcPattern));
FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcCharSet));
FC_ASSERT_STATIC (0x08 + 6*SIZEOF_VOID_P == sizeof (FcCache));
int
main (int argc FC_UNUSED, char **argv FC_UNUSED)
{
printf ("%s\n", FC_ARCHITECTURE);
return 0;
}

View File

@@ -0,0 +1,76 @@
/*
* Copyright © 2006 Keith Packard
* Copyright © 2010 Behdad Esfahbod
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _FCARCH_H_
#define _FCARCH_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/*
* Each unique machine architecture needs an entry in this file
* So far the differences boil down to: endianness, 32 vs 64 bit pointers,
* and on 32bit ones, whether double is aligned to one word or two words.
* Those result in the 6 formats listed below.
*
* If any of the assertion errors in fcarch.c fail, you need to add a new
* architecture. Contact the fontconfig mailing list in that case.
*
* name endianness pointer-size double-alignment
*
* le32d4 4321 4 4
* le32d8 4321 4 8
* le64 4321 8 8
* be32d4 1234 4 4
* be32d8 1234 4 8
* be64 1234 8 8
*/
#if defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
# define FC_ARCH_ENDIAN "le"
#elif defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
# define FC_ARCH_ENDIAN "be"
#elif defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_PDP_ENDIAN
# define FC_ARCH_ENDIAN "pe"
#elif defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN
# define FC_ARCH_ENDIAN "be"
#else
# define FC_ARCH_ENDIAN "le"
#endif
#if SIZEOF_VOID_P == 4
# if ALIGNOF_DOUBLE == 4
# define FC_ARCH_SIZE_ALIGN "32d4"
# else /* ALIGNOF_DOUBLE != 4 */
# define FC_ARCH_SIZE_ALIGN "32d8"
# endif
#else /* SIZEOF_VOID_P != 4 */
# define FC_ARCH_SIZE_ALIGN "64"
#endif
/* config.h might override this */
#ifndef FC_ARCHITECTURE
# define FC_ARCHITECTURE FC_ARCH_ENDIAN FC_ARCH_SIZE_ALIGN
#endif
#endif /* _FCARCH_H_ */

View File

@@ -0,0 +1,229 @@
/*
* fontconfig/src/fcatomic.c
*
* Copyright © 2002 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
* fcatomic.c
*
* Lock cache and configuration files for atomic update
*
* Uses only regular filesystem calls so it should
* work even in the absense of functioning file locking
*
* On Unix, four files are used:
* file - the data file accessed by other apps.
* new - a new version of the data file while it's being written
* lck - the lock file
* tmp - a temporary file made unique with mkstemp
*
* Here's how it works:
* Create 'tmp' and store our PID in it
* Attempt to link it to 'lck'
* Unlink 'tmp'
* If the link succeeded, the lock is held
*
* On Windows, where there are no links, no tmp file is used, and lck
* is a directory that's mkdir'ed. If the mkdir succeeds, the lock is
* held.
*/
#include "fcint.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#ifdef _WIN32
#include <direct.h>
#define mkdir(path,mode) _mkdir(path)
#endif
#define NEW_NAME ".NEW"
#define LCK_NAME ".LCK"
#define TMP_NAME ".TMP-XXXXXX"
FcAtomic *
FcAtomicCreate (const FcChar8 *file)
{
int file_len = strlen ((char *) file);
int new_len = file_len + sizeof (NEW_NAME);
int lck_len = file_len + sizeof (LCK_NAME);
int tmp_len = file_len + sizeof (TMP_NAME);
int total_len = (sizeof (FcAtomic) +
file_len + 1 +
new_len + 1 +
lck_len + 1 +
tmp_len + 1);
FcAtomic *atomic = malloc (total_len);
if (!atomic)
return 0;
atomic->file = (FcChar8 *) (atomic + 1);
strcpy ((char *) atomic->file, (char *) file);
atomic->new = atomic->file + file_len + 1;
strcpy ((char *) atomic->new, (char *) file);
strcat ((char *) atomic->new, NEW_NAME);
atomic->lck = atomic->new + new_len + 1;
strcpy ((char *) atomic->lck, (char *) file);
strcat ((char *) atomic->lck, LCK_NAME);
atomic->tmp = atomic->lck + lck_len + 1;
return atomic;
}
FcBool
FcAtomicLock (FcAtomic *atomic)
{
int ret;
struct stat lck_stat;
#ifdef HAVE_LINK
int fd = -1;
FILE *f = 0;
FcBool no_link = FcFalse;
strcpy ((char *) atomic->tmp, (char *) atomic->file);
strcat ((char *) atomic->tmp, TMP_NAME);
fd = FcMakeTempfile ((char *) atomic->tmp);
if (fd < 0)
return FcFalse;
f = fdopen (fd, "w");
if (!f)
{
close (fd);
unlink ((char *) atomic->tmp);
return FcFalse;
}
ret = fprintf (f, "%ld\n", (long)getpid());
if (ret <= 0)
{
fclose (f);
unlink ((char *) atomic->tmp);
return FcFalse;
}
if (fclose (f) == EOF)
{
unlink ((char *) atomic->tmp);
return FcFalse;
}
ret = link ((char *) atomic->tmp, (char *) atomic->lck);
if (ret < 0 && errno == EPERM)
{
/* the filesystem where atomic->lck points to may not supports
* the hard link. so better try to fallback
*/
ret = mkdir ((char *) atomic->lck, 0600);
no_link = FcTrue;
}
(void) unlink ((char *) atomic->tmp);
#else
ret = mkdir ((char *) atomic->lck, 0600);
#endif
if (ret < 0)
{
/*
* If the file is around and old (> 10 minutes),
* assume the lock is stale. This assumes that any
* machines sharing the same filesystem will have clocks
* reasonably close to each other.
*/
if (FcStat (atomic->lck, &lck_stat) >= 0)
{
time_t now = time (0);
if ((long int) (now - lck_stat.st_mtime) > 10 * 60)
{
#ifdef HAVE_LINK
if (no_link)
{
if (rmdir ((char *) atomic->lck) == 0)
return FcAtomicLock (atomic);
}
else
{
if (unlink ((char *) atomic->lck) == 0)
return FcAtomicLock (atomic);
}
#else
if (rmdir ((char *) atomic->lck) == 0)
return FcAtomicLock (atomic);
#endif
}
}
return FcFalse;
}
(void) unlink ((char *) atomic->new);
return FcTrue;
}
FcChar8 *
FcAtomicNewFile (FcAtomic *atomic)
{
return atomic->new;
}
FcChar8 *
FcAtomicOrigFile (FcAtomic *atomic)
{
return atomic->file;
}
FcBool
FcAtomicReplaceOrig (FcAtomic *atomic)
{
#ifdef _WIN32
unlink ((const char *) atomic->file);
#endif
if (rename ((char *) atomic->new, (char *) atomic->file) < 0)
return FcFalse;
return FcTrue;
}
void
FcAtomicDeleteNew (FcAtomic *atomic)
{
unlink ((char *) atomic->new);
}
void
FcAtomicUnlock (FcAtomic *atomic)
{
#ifdef HAVE_LINK
if (unlink ((char *) atomic->lck) == -1)
rmdir ((char *) atomic->lck);
#else
rmdir ((char *) atomic->lck);
#endif
}
void
FcAtomicDestroy (FcAtomic *atomic)
{
free (atomic);
}
#define __fcatomic__
#include "fcaliastail.h"
#undef __fcatomic__

View File

@@ -0,0 +1,145 @@
/*
* Mutex operations. Originally copied from HarfBuzz.
*
* Copyright © 2007 Chris Wilson
* Copyright © 2009,2010 Red Hat, Inc.
* Copyright © 2011,2012,2013 Google, Inc.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Contributor(s):
* Chris Wilson <chris@chris-wilson.co.uk>
* Red Hat Author(s): Behdad Esfahbod
* Google Author(s): Behdad Esfahbod
*/
#ifndef _FCATOMIC_H_
#define _FCATOMIC_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* atomic_int */
/* We need external help for these */
#if 0
#elif !defined(FC_NO_MT) && defined(_MSC_VER) || defined(__MINGW32__)
#include "fcwindows.h"
/* mingw32 does not have MemoryBarrier.
* MemoryBarrier may be defined as a macro or a function.
* Just make a failsafe version for ourselves. */
#ifdef MemoryBarrier
#define HBMemoryBarrier MemoryBarrier
#else
static inline void HBMemoryBarrier (void) {
long dummy = 0;
InterlockedExchange (&dummy, 1);
}
#endif
typedef LONG fc_atomic_int_t;
#define fc_atomic_int_add(AI, V) InterlockedExchangeAdd (&(AI), (V))
#define fc_atomic_ptr_get(P) (HBMemoryBarrier (), (void *) *(P))
#define fc_atomic_ptr_cmpexch(P,O,N) (InterlockedCompareExchangePointer ((void **) (P), (void *) (N), (void *) (O)) == (void *) (O))
#elif !defined(FC_NO_MT) && defined(__APPLE__)
#include <libkern/OSAtomic.h>
#ifdef __MAC_OS_X_MIN_REQUIRED
#include <AvailabilityMacros.h>
#elif defined(__IPHONE_OS_MIN_REQUIRED)
#include <Availability.h>
#endif
typedef int fc_atomic_int_t;
#define fc_atomic_int_add(AI, V) (OSAtomicAdd32Barrier ((V), &(AI)) - (V))
#define fc_atomic_ptr_get(P) (OSMemoryBarrier (), (void *) *(P))
#if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4 || __IPHONE_VERSION_MIN_REQUIRED >= 20100)
#define fc_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P))
#else
#if __ppc64__ || __x86_64__
#define fc_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwap64Barrier ((int64_t) (O), (int64_t) (N), (int64_t*) (P))
#else
#define fc_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwap32Barrier ((int32_t) (O), (int32_t) (N), (int32_t*) (P))
#endif
#endif
#elif !defined(FC_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES)
typedef int fc_atomic_int_t;
#define fc_atomic_int_add(AI, V) __sync_fetch_and_add (&(AI), (V))
#define fc_atomic_ptr_get(P) (void *) (__sync_synchronize (), *(P))
#define fc_atomic_ptr_cmpexch(P,O,N) __sync_bool_compare_and_swap ((P), (O), (N))
#elif !defined(FC_NO_MT) && defined(HAVE_SOLARIS_ATOMIC_OPS)
#include <atomic.h>
#include <mbarrier.h>
typedef unsigned int fc_atomic_int_t;
#define fc_atomic_int_add(AI, V) ( ({__machine_rw_barrier ();}), atomic_add_int_nv (&(AI), (V)) - (V))
#define fc_atomic_ptr_get(P) ( ({__machine_rw_barrier ();}), (void *) *(P))
#define fc_atomic_ptr_cmpexch(P,O,N) ( ({__machine_rw_barrier ();}), atomic_cas_ptr ((P), (O), (N)) == (void *) (O) ? FcTrue : FcFalse)
#elif !defined(FC_NO_MT)
#define FC_ATOMIC_INT_NIL 1 /* Warn that fallback implementation is in use. */
typedef volatile int fc_atomic_int_t;
#define fc_atomic_int_add(AI, V) (((AI) += (V)) - (V))
#define fc_atomic_ptr_get(P) ((void *) *(P))
#define fc_atomic_ptr_cmpexch(P,O,N) (* (void * volatile *) (P) == (void *) (O) ? (* (void * volatile *) (P) = (void *) (N), FcTrue) : FcFalse)
#else /* FC_NO_MT */
typedef int fc_atomic_int_t;
#define fc_atomic_int_add(AI, V) (((AI) += (V)) - (V))
#define fc_atomic_ptr_get(P) ((void *) *(P))
#define fc_atomic_ptr_cmpexch(P,O,N) (* (void **) (P) == (void *) (O) ? (* (void **) (P) = (void *) (N), FcTrue) : FcFalse)
#endif
/* reference count */
#define FC_REF_CONSTANT_VALUE ((fc_atomic_int_t) -1)
#define FC_REF_CONSTANT {FC_REF_CONSTANT_VALUE}
typedef struct _FcRef { fc_atomic_int_t count; } FcRef;
static inline void FcRefInit (FcRef *r, int v) { r->count = v; }
static inline int FcRefInc (FcRef *r) { return fc_atomic_int_add (r->count, +1); }
static inline int FcRefDec (FcRef *r) { return fc_atomic_int_add (r->count, -1); }
static inline int FcRefAdd (FcRef *r, int v) { return fc_atomic_int_add (r->count, v); }
static inline void FcRefSetConst (FcRef *r) { r->count = FC_REF_CONSTANT_VALUE; }
static inline FcBool FcRefIsConst (const FcRef *r) { return r->count == FC_REF_CONSTANT_VALUE; }
#endif /* _FCATOMIC_H_ */

View File

@@ -0,0 +1,87 @@
/*
* fontconfig/src/fcblanks.c
*
* Copyright © 2002 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
FcBlanks *
FcBlanksCreate (void)
{
FcBlanks *b;
b = malloc (sizeof (FcBlanks));
if (!b)
return 0;
b->nblank = 0;
b->sblank = 0;
b->blanks = 0;
return b;
}
void
FcBlanksDestroy (FcBlanks *b)
{
if (b->blanks)
free (b->blanks);
free (b);
}
FcBool
FcBlanksAdd (FcBlanks *b, FcChar32 ucs4)
{
FcChar32 *c;
int sblank;
for (sblank = 0; sblank < b->nblank; sblank++)
if (b->blanks[sblank] == ucs4)
return FcTrue;
if (b->nblank == b->sblank)
{
sblank = b->sblank + 32;
if (b->blanks)
c = (FcChar32 *) realloc (b->blanks, sblank * sizeof (FcChar32));
else
c = (FcChar32 *) malloc (sblank * sizeof (FcChar32));
if (!c)
return FcFalse;
b->sblank = sblank;
b->blanks = c;
}
b->blanks[b->nblank++] = ucs4;
return FcTrue;
}
FcBool
FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4)
{
int i;
for (i = 0; i < b->nblank; i++)
if (b->blanks[i] == ucs4)
return FcTrue;
return FcFalse;
}
#define __fcblanks__
#include "fcaliastail.h"
#undef __fcblanks__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,257 @@
/*
* fontconfig/src/fccompat.c
*
* Copyright © 2012 Red Hat, Inc.
*
* Author(s):
* Akira TAGOH
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
#include <errno.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#ifdef O_CLOEXEC
#define FC_O_CLOEXEC O_CLOEXEC
#else
#define FC_O_CLOEXEC 0
#endif
#ifdef O_LARGEFILE
#define FC_O_LARGEFILE O_LARGEFILE
#else
#define FC_O_LARGEFILE 0
#endif
#ifdef O_BINARY
#define FC_O_BINARY O_BINARY
#else
#define FC_O_BINARY 0
#endif
#ifdef O_TEMPORARY
#define FC_O_TEMPORARY O_TEMPORARY
#else
#define FC_O_TEMPORARY 0
#endif
#ifdef O_NOINHERIT
#define FC_O_NOINHERIT O_NOINHERIT
#else
#define FC_O_NOINHERIT 0
#endif
#if !defined (HAVE_MKOSTEMP) && !defined(HAVE_MKSTEMP) && !defined(HAVE__MKTEMP_S)
static int
mkstemp (char *template)
{
static const char s[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
int fd, i;
size_t l;
if (template == NULL)
{
errno = EINVAL;
return -1;
}
l = strlen (template);
if (l < 6 || strcmp (&template[l - 6], "XXXXXX") != 0)
{
errno = EINVAL;
return -1;
}
do
{
errno = 0;
for (i = l - 6; i < l; i++)
{
int r = FcRandom ();
template[i] = s[r % 62];
}
fd = FcOpen (template, FC_O_BINARY | O_CREAT | O_EXCL | FC_O_TEMPORARY | FC_O_NOINHERIT | O_RDWR, 0600);
} while (fd < 0 && errno == EEXIST);
if (fd >= 0)
errno = 0;
return fd;
}
#define HAVE_MKSTEMP 1
#endif
int
FcOpen(const char *pathname, int flags, ...)
{
int fd = -1;
if (flags & O_CREAT)
{
va_list ap;
mode_t mode;
va_start(ap, flags);
mode = (mode_t) va_arg(ap, int);
va_end(ap);
fd = open(pathname, flags | FC_O_CLOEXEC | FC_O_LARGEFILE, mode);
}
else
{
fd = open(pathname, flags | FC_O_CLOEXEC | FC_O_LARGEFILE);
}
return fd;
}
int
FcMakeTempfile (char *template)
{
int fd = -1;
#if HAVE_MKOSTEMP
fd = mkostemp (template, FC_O_CLOEXEC);
#elif HAVE_MKSTEMP
fd = mkstemp (template);
# ifdef F_DUPFD_CLOEXEC
if (fd != -1)
{
int newfd = fcntl(fd, F_DUPFD_CLOEXEC, STDIN_FILENO);
close(fd);
fd = newfd;
}
# elif defined(FD_CLOEXEC)
if (fd != -1)
{
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
}
# endif
#elif HAVE__MKTEMP_S
if (_mktemp_s(template, strlen(template) + 1) != 0)
return -1;
fd = FcOpen(template, O_RDWR | O_EXCL | O_CREAT, 0600);
#endif
return fd;
}
int32_t
FcRandom(void)
{
int32_t result;
#if HAVE_RANDOM_R
static struct random_data fcrandbuf;
static char statebuf[256];
static FcBool initialized = FcFalse;
#ifdef _AIX
static char *retval;
long res;
#endif
if (initialized != FcTrue)
{
#ifdef _AIX
initstate_r (time (NULL), statebuf, 256, &retval, &fcrandbuf);
#else
initstate_r (time (NULL), statebuf, 256, &fcrandbuf);
#endif
initialized = FcTrue;
}
#ifdef _AIX
random_r (&res, &fcrandbuf);
result = (int32_t)res;
#else
random_r (&fcrandbuf, &result);
#endif
#elif HAVE_RANDOM
static char statebuf[256];
char *state;
static FcBool initialized = FcFalse;
if (initialized != FcTrue)
{
state = initstate (time (NULL), statebuf, 256);
initialized = FcTrue;
}
else
state = setstate (statebuf);
result = random ();
setstate (state);
#elif HAVE_LRAND48
result = lrand48 ();
#elif HAVE_RAND_R
static unsigned int seed = time (NULL);
result = rand_r (&seed);
#elif HAVE_RAND
static FcBool initialized = FcFalse;
if (initialized != FcTrue)
{
srand (time (NULL));
initialized = FcTrue;
}
result = rand ();
#else
# error no random number generator function available.
#endif
return result;
}
#ifdef _WIN32
#include <direct.h>
#define mkdir(path,mode) _mkdir(path)
#endif
FcBool
FcMakeDirectory (const FcChar8 *dir)
{
FcChar8 *parent;
FcBool ret;
if (strlen ((char *) dir) == 0)
return FcFalse;
parent = FcStrDirname (dir);
if (!parent)
return FcFalse;
if (access ((char *) parent, F_OK) == 0)
ret = mkdir ((char *) dir, 0755) == 0 && chmod ((char *) dir, 0755) == 0;
else if (access ((char *) parent, F_OK) == -1)
ret = FcMakeDirectory (parent) && (mkdir ((char *) dir, 0755) == 0) && chmod ((char *) dir, 0755) == 0;
else
ret = FcFalse;
FcStrFree (parent);
return ret;
}

View File

@@ -0,0 +1,499 @@
/*
* fontconfig/src/fcdbg.c
*
* Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
#include <stdio.h>
#include <stdlib.h>
static void
_FcValuePrintFile (FILE *f, const FcValue v)
{
switch (v.type) {
case FcTypeUnknown:
fprintf (f, "<unknown>");
break;
case FcTypeVoid:
fprintf (f, "<void>");
break;
case FcTypeInteger:
fprintf (f, "%d(i)", v.u.i);
break;
case FcTypeDouble:
fprintf (f, "%g(f)", v.u.d);
break;
case FcTypeString:
fprintf (f, "\"%s\"", v.u.s);
break;
case FcTypeBool:
fprintf (f, "%s", v.u.b ? "True" : "False");
break;
case FcTypeMatrix:
fprintf (f, "[%g %g; %g %g]", v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy);
break;
case FcTypeCharSet: /* XXX */
if (f == stdout)
FcCharSetPrint (v.u.c);
break;
case FcTypeLangSet:
FcLangSetPrint (v.u.l);
break;
case FcTypeFTFace:
fprintf (f, "face");
break;
}
}
void
FcValuePrintFile (FILE *f, const FcValue v)
{
fprintf (f, " ");
_FcValuePrintFile (f, v);
}
void
FcValuePrint (const FcValue v)
{
printf (" ");
_FcValuePrintFile (stdout, v);
}
void
FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark)
{
if (show_pos_mark)
printf (" [marker] ");
else
printf (" ");
_FcValuePrintFile (stdout, v);
}
static void
FcValueBindingPrint (const FcValueListPtr l)
{
switch (l->binding) {
case FcValueBindingWeak:
printf ("(w)");
break;
case FcValueBindingStrong:
printf ("(s)");
break;
case FcValueBindingSame:
printf ("(=)");
break;
default:
/* shouldn't be reached */
printf ("(?)");
break;
}
}
void
FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos)
{
for (; l != NULL; l = FcValueListNext(l))
{
FcValuePrintWithPosition (FcValueCanonicalize (&l->value), pos != NULL && l == pos);
FcValueBindingPrint (l);
}
if (!pos)
printf (" [marker]");
}
void
FcValueListPrint (FcValueListPtr l)
{
for (; l != NULL; l = FcValueListNext(l))
{
FcValuePrint (FcValueCanonicalize (&l->value));
FcValueBindingPrint (l);
}
}
void
FcLangSetPrint (const FcLangSet *ls)
{
FcStrBuf buf;
FcChar8 init_buf[1024];
FcStrBufInit (&buf, init_buf, sizeof (init_buf));
if (FcNameUnparseLangSet (&buf, ls) && FcStrBufChar (&buf,'\0'))
printf ("%s", buf.buf);
else
printf ("langset (alloc error)");
FcStrBufDestroy (&buf);
}
void
FcCharSetPrint (const FcCharSet *c)
{
int i, j;
intptr_t *leaves = FcCharSetLeaves (c);
FcChar16 *numbers = FcCharSetNumbers (c);
#if 0
printf ("CharSet 0x%x\n", (intptr_t) c);
printf ("Leaves: +%d = 0x%x\n", c->leaves_offset, (intptr_t) leaves);
printf ("Numbers: +%d = 0x%x\n", c->numbers_offset, (intptr_t) numbers);
for (i = 0; i < c->num; i++)
{
printf ("Page %d: %04x +%d = 0x%x\n",
i, numbers[i], leaves[i],
(intptr_t) FcOffsetToPtr (leaves, leaves[i], FcCharLeaf));
}
#endif
printf ("\n");
for (i = 0; i < c->num; i++)
{
intptr_t leaf_offset = leaves[i];
FcCharLeaf *leaf = FcOffsetToPtr (leaves, leaf_offset, FcCharLeaf);
printf ("\t");
printf ("%04x:", numbers[i]);
for (j = 0; j < 256/32; j++)
printf (" %08x", leaf->map[j]);
printf ("\n");
}
}
void
FcPatternPrint (const FcPattern *p)
{
int i;
FcPatternElt *e;
if (!p)
{
printf ("Null pattern\n");
return;
}
printf ("Pattern has %d elts (size %d)\n", p->num, p->size);
for (i = 0; i < p->num; i++)
{
e = &FcPatternElts(p)[i];
printf ("\t%s:", FcObjectName(e->object));
FcValueListPrint (FcPatternEltValues(e));
printf ("\n");
}
printf ("\n");
}
#define FcOpFlagsPrint(_o_) \
{ \
int f = FC_OP_GET_FLAGS (_o_); \
if (f & FcOpFlagIgnoreBlanks) \
printf ("(ignore blanks)"); \
}
void
FcOpPrint (FcOp op_)
{
FcOp op = FC_OP_GET_OP (op_);
switch (op) {
case FcOpInteger: printf ("Integer"); break;
case FcOpDouble: printf ("Double"); break;
case FcOpString: printf ("String"); break;
case FcOpMatrix: printf ("Matrix"); break;
case FcOpRange: printf ("Range"); break;
case FcOpBool: printf ("Bool"); break;
case FcOpCharSet: printf ("CharSet"); break;
case FcOpLangSet: printf ("LangSet"); break;
case FcOpField: printf ("Field"); break;
case FcOpConst: printf ("Const"); break;
case FcOpAssign: printf ("Assign"); break;
case FcOpAssignReplace: printf ("AssignReplace"); break;
case FcOpPrepend: printf ("Prepend"); break;
case FcOpPrependFirst: printf ("PrependFirst"); break;
case FcOpAppend: printf ("Append"); break;
case FcOpAppendLast: printf ("AppendLast"); break;
case FcOpDelete: printf ("Delete"); break;
case FcOpDeleteAll: printf ("DeleteAll"); break;
case FcOpQuest: printf ("Quest"); break;
case FcOpOr: printf ("Or"); break;
case FcOpAnd: printf ("And"); break;
case FcOpEqual: printf ("Equal"); FcOpFlagsPrint (op_); break;
case FcOpNotEqual: printf ("NotEqual"); FcOpFlagsPrint (op_); break;
case FcOpLess: printf ("Less"); break;
case FcOpLessEqual: printf ("LessEqual"); break;
case FcOpMore: printf ("More"); break;
case FcOpMoreEqual: printf ("MoreEqual"); break;
case FcOpContains: printf ("Contains"); break;
case FcOpNotContains: printf ("NotContains"); break;
case FcOpPlus: printf ("Plus"); break;
case FcOpMinus: printf ("Minus"); break;
case FcOpTimes: printf ("Times"); break;
case FcOpDivide: printf ("Divide"); break;
case FcOpNot: printf ("Not"); break;
case FcOpNil: printf ("Nil"); break;
case FcOpComma: printf ("Comma"); break;
case FcOpFloor: printf ("Floor"); break;
case FcOpCeil: printf ("Ceil"); break;
case FcOpRound: printf ("Round"); break;
case FcOpTrunc: printf ("Trunc"); break;
case FcOpListing: printf ("Listing"); FcOpFlagsPrint (op_); break;
case FcOpInvalid: printf ("Invalid"); break;
}
}
void
FcExprPrint (const FcExpr *expr)
{
if (!expr) printf ("none");
else switch (FC_OP_GET_OP (expr->op)) {
case FcOpInteger: printf ("%d", expr->u.ival); break;
case FcOpDouble: printf ("%g", expr->u.dval); break;
case FcOpString: printf ("\"%s\"", expr->u.sval); break;
case FcOpMatrix:
printf ("[");
FcExprPrint (expr->u.mexpr->xx);
printf (" ");
FcExprPrint (expr->u.mexpr->xy);
printf ("; ");
FcExprPrint (expr->u.mexpr->yx);
printf (" ");
FcExprPrint (expr->u.mexpr->yy);
printf ("]");
break;
case FcOpRange: break;
case FcOpBool: printf ("%s", expr->u.bval ? "true" : "false"); break;
case FcOpCharSet: printf ("charset\n"); break;
case FcOpLangSet:
printf ("langset:");
FcLangSetPrint(expr->u.lval);
printf ("\n");
break;
case FcOpNil: printf ("nil\n"); break;
case FcOpField: printf ("%s ", FcObjectName(expr->u.name.object));
switch ((int) expr->u.name.kind) {
case FcMatchPattern:
printf ("(pattern) ");
break;
case FcMatchFont:
printf ("(font) ");
break;
}
break;
case FcOpConst: printf ("%s", expr->u.constant); break;
case FcOpQuest:
FcExprPrint (expr->u.tree.left);
printf (" quest ");
FcExprPrint (expr->u.tree.right->u.tree.left);
printf (" colon ");
FcExprPrint (expr->u.tree.right->u.tree.right);
break;
case FcOpAssign:
case FcOpAssignReplace:
case FcOpPrependFirst:
case FcOpPrepend:
case FcOpAppend:
case FcOpAppendLast:
case FcOpOr:
case FcOpAnd:
case FcOpEqual:
case FcOpNotEqual:
case FcOpLess:
case FcOpLessEqual:
case FcOpMore:
case FcOpMoreEqual:
case FcOpContains:
case FcOpListing:
case FcOpNotContains:
case FcOpPlus:
case FcOpMinus:
case FcOpTimes:
case FcOpDivide:
case FcOpComma:
FcExprPrint (expr->u.tree.left);
printf (" ");
switch (FC_OP_GET_OP (expr->op)) {
case FcOpAssign: printf ("Assign"); break;
case FcOpAssignReplace: printf ("AssignReplace"); break;
case FcOpPrependFirst: printf ("PrependFirst"); break;
case FcOpPrepend: printf ("Prepend"); break;
case FcOpAppend: printf ("Append"); break;
case FcOpAppendLast: printf ("AppendLast"); break;
case FcOpOr: printf ("Or"); break;
case FcOpAnd: printf ("And"); break;
case FcOpEqual: printf ("Equal"); FcOpFlagsPrint (expr->op); break;
case FcOpNotEqual: printf ("NotEqual"); FcOpFlagsPrint (expr->op); break;
case FcOpLess: printf ("Less"); break;
case FcOpLessEqual: printf ("LessEqual"); break;
case FcOpMore: printf ("More"); break;
case FcOpMoreEqual: printf ("MoreEqual"); break;
case FcOpContains: printf ("Contains"); break;
case FcOpListing: printf ("Listing"); FcOpFlagsPrint (expr->op); break;
case FcOpNotContains: printf ("NotContains"); break;
case FcOpPlus: printf ("Plus"); break;
case FcOpMinus: printf ("Minus"); break;
case FcOpTimes: printf ("Times"); break;
case FcOpDivide: printf ("Divide"); break;
case FcOpComma: printf ("Comma"); break;
default: break;
}
printf (" ");
FcExprPrint (expr->u.tree.right);
break;
case FcOpNot:
printf ("Not ");
FcExprPrint (expr->u.tree.left);
break;
case FcOpFloor:
printf ("Floor ");
FcExprPrint (expr->u.tree.left);
break;
case FcOpCeil:
printf ("Ceil ");
FcExprPrint (expr->u.tree.left);
break;
case FcOpRound:
printf ("Round ");
FcExprPrint (expr->u.tree.left);
break;
case FcOpTrunc:
printf ("Trunc ");
FcExprPrint (expr->u.tree.left);
break;
case FcOpInvalid: printf ("Invalid"); break;
}
}
void
FcTestPrint (const FcTest *test)
{
switch (test->kind) {
case FcMatchPattern:
printf ("pattern ");
break;
case FcMatchFont:
printf ("font ");
break;
case FcMatchScan:
printf ("scan ");
break;
}
switch (test->qual) {
case FcQualAny:
printf ("any ");
break;
case FcQualAll:
printf ("all ");
break;
case FcQualFirst:
printf ("first ");
break;
case FcQualNotFirst:
printf ("not_first ");
break;
}
printf ("%s ", FcObjectName (test->object));
FcOpPrint (test->op);
printf (" ");
FcExprPrint (test->expr);
printf ("\n");
}
void
FcEditPrint (const FcEdit *edit)
{
printf ("Edit %s ", FcObjectName (edit->object));
FcOpPrint (edit->op);
printf (" ");
FcExprPrint (edit->expr);
}
void
FcSubstPrint (const FcSubst *subst)
{
FcRule *r;
FcRuleType last_type = FcRuleUnknown;
printf ("match\n");
for (r = subst->rule; r; r = r->next)
{
if (last_type != r->type)
{
switch (r->type) {
case FcRuleTest:
printf ("[test]\n");
break;
case FcRuleEdit:
printf ("[edit]\n");
break;
default:
break;
}
last_type = r->type;
}
printf ("\t");
switch (r->type) {
case FcRuleTest:
FcTestPrint (r->u.test);
break;
case FcRuleEdit:
FcEditPrint (r->u.edit);
printf (";\n");
break;
default:
break;
}
}
printf ("\n");
}
void
FcFontSetPrint (const FcFontSet *s)
{
int i;
printf ("FontSet %d of %d\n", s->nfont, s->sfont);
for (i = 0; i < s->nfont; i++)
{
printf ("Font %d ", i);
FcPatternPrint (s->fonts[i]);
}
}
int FcDebugVal;
void
FcInitDebug (void)
{
if (!FcDebugVal) {
char *e;
e = getenv ("FC_DEBUG");
if (e)
{
printf ("FC_DEBUG=%s\n", e);
FcDebugVal = atoi (e);
if (FcDebugVal < 0)
FcDebugVal = 0;
}
}
}
#define __fcdbg__
#include "fcaliastail.h"
#undef __fcdbg__

View File

@@ -0,0 +1,316 @@
/*
* fontconfig/src/fcdefault.c
*
* Copyright © 2001 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
#include <limits.h>
#include <string.h>
/* MT-safe */
static const struct {
FcObject field;
FcBool value;
} FcBoolDefaults[] = {
{ FC_HINTING_OBJECT, FcTrue }, /* !FT_LOAD_NO_HINTING */
{ FC_VERTICAL_LAYOUT_OBJECT, FcFalse }, /* FC_LOAD_VERTICAL_LAYOUT */
{ FC_AUTOHINT_OBJECT, FcFalse }, /* FC_LOAD_FORCE_AUTOHINT */
{ FC_GLOBAL_ADVANCE_OBJECT, FcTrue }, /* !FC_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
{ FC_EMBEDDED_BITMAP_OBJECT, FcTrue }, /* !FC_LOAD_NO_BITMAP */
{ FC_DECORATIVE_OBJECT, FcFalse },
};
#define NUM_FC_BOOL_DEFAULTS (int) (sizeof FcBoolDefaults / sizeof FcBoolDefaults[0])
FcStrSet *default_langs;
FcStrSet *
FcGetDefaultLangs (void)
{
FcStrSet *result;
retry:
result = (FcStrSet *) fc_atomic_ptr_get (&default_langs);
if (!result)
{
char *langs;
result = FcStrSetCreate ();
langs = getenv ("FC_LANG");
if (!langs || !langs[0])
langs = getenv ("LC_ALL");
if (!langs || !langs[0])
langs = getenv ("LC_CTYPE");
if (!langs || !langs[0])
langs = getenv ("LANG");
if (langs && langs[0])
{
if (!FcStrSetAddLangs (result, langs))
FcStrSetAdd (result, (const FcChar8 *) "en");
}
else
FcStrSetAdd (result, (const FcChar8 *) "en");
FcRefSetConst (&result->ref);
if (!fc_atomic_ptr_cmpexch (&default_langs, NULL, result)) {
FcRefInit (&result->ref, 1);
FcStrSetDestroy (result);
goto retry;
}
}
return result;
}
static FcChar8 *default_lang; /* MT-safe */
FcChar8 *
FcGetDefaultLang (void)
{
FcChar8 *lang;
retry:
lang = fc_atomic_ptr_get (&default_lang);
if (!lang)
{
FcStrSet *langs = FcGetDefaultLangs ();
lang = FcStrdup (langs->strs[0]);
FcStrSetDestroy (langs);
if (!fc_atomic_ptr_cmpexch (&default_lang, NULL, lang)) {
free (lang);
goto retry;
}
}
return lang;
}
static FcChar8 *default_prgname;
FcChar8 *
FcGetPrgname (void)
{
FcChar8 *prgname;
retry:
prgname = fc_atomic_ptr_get (&default_prgname);
if (!prgname)
{
#ifdef _WIN32
char buf[MAX_PATH+1];
/* TODO This is ASCII-only; fix it. */
if (GetModuleFileNameA (GetModuleHandle (NULL), buf, sizeof (buf) / sizeof (buf[0])) > 0)
{
char *p;
unsigned int len;
p = strrchr (buf, '\\');
if (p)
p++;
else
p = buf;
len = strlen (p);
if (len > 4 && 0 == strcmp (p + len - 4, ".exe"))
{
len -= 4;
buf[len] = '\0';
}
prgname = FcStrdup (p);
}
#elif defined (HAVE_GETPROGNAME)
const char *q = getprogname ();
if (q)
prgname = FcStrdup (q);
else
prgname = FcStrdup ("");
#else
# if defined (HAVE_GETEXECNAME)
const char *p = getexecname ();
# elif defined (HAVE_READLINK)
char buf[PATH_MAX + 1];
int len;
char *p = NULL;
len = readlink ("/proc/self/exe", buf, sizeof (buf) - 1);
if (len != -1)
{
buf[len] = '\0';
p = buf;
}
# else
char *p = NULL;
# endif
if (p)
{
char *r = strrchr (p, '/');
if (r)
r++;
else
r = p;
prgname = FcStrdup (r);
}
if (!prgname)
prgname = FcStrdup ("");
#endif
if (!fc_atomic_ptr_cmpexch (&default_prgname, NULL, prgname)) {
free (prgname);
goto retry;
}
}
if (prgname && !prgname[0])
return NULL;
return prgname;
}
void
FcDefaultFini (void)
{
FcChar8 *lang;
FcStrSet *langs;
FcChar8 *prgname;
lang = fc_atomic_ptr_get (&default_lang);
if (lang && fc_atomic_ptr_cmpexch (&default_lang, lang, NULL)) {
free (lang);
}
langs = fc_atomic_ptr_get (&default_langs);
if (langs && fc_atomic_ptr_cmpexch (&default_langs, langs, NULL)) {
FcRefInit (&langs->ref, 1);
FcStrSetDestroy (langs);
}
prgname = fc_atomic_ptr_get (&default_prgname);
if (prgname && fc_atomic_ptr_cmpexch (&default_prgname, prgname, NULL)) {
free (prgname);
}
}
void
FcDefaultSubstitute (FcPattern *pattern)
{
FcValue v, namelang, v2;
int i;
if (FcPatternObjectGet (pattern, FC_WEIGHT_OBJECT, 0, &v) == FcResultNoMatch )
FcPatternObjectAddInteger (pattern, FC_WEIGHT_OBJECT, FC_WEIGHT_NORMAL);
if (FcPatternObjectGet (pattern, FC_SLANT_OBJECT, 0, &v) == FcResultNoMatch)
FcPatternObjectAddInteger (pattern, FC_SLANT_OBJECT, FC_SLANT_ROMAN);
if (FcPatternObjectGet (pattern, FC_WIDTH_OBJECT, 0, &v) == FcResultNoMatch)
FcPatternObjectAddInteger (pattern, FC_WIDTH_OBJECT, FC_WIDTH_NORMAL);
for (i = 0; i < NUM_FC_BOOL_DEFAULTS; i++)
if (FcPatternObjectGet (pattern, FcBoolDefaults[i].field, 0, &v) == FcResultNoMatch)
FcPatternObjectAddBool (pattern, FcBoolDefaults[i].field, FcBoolDefaults[i].value);
if (FcPatternObjectGet (pattern, FC_PIXEL_SIZE_OBJECT, 0, &v) == FcResultNoMatch)
{
double dpi, size, scale;
if (FcPatternObjectGetDouble (pattern, FC_SIZE_OBJECT, 0, &size) != FcResultMatch)
{
size = 12.0;
(void) FcPatternObjectDel (pattern, FC_SIZE_OBJECT);
FcPatternObjectAddDouble (pattern, FC_SIZE_OBJECT, size);
}
if (FcPatternObjectGetDouble (pattern, FC_SCALE_OBJECT, 0, &scale) != FcResultMatch)
{
scale = 1.0;
(void) FcPatternObjectDel (pattern, FC_SCALE_OBJECT);
FcPatternObjectAddDouble (pattern, FC_SCALE_OBJECT, scale);
}
size *= scale;
if (FcPatternObjectGetDouble (pattern, FC_DPI_OBJECT, 0, &dpi) != FcResultMatch)
{
dpi = 75.0;
(void) FcPatternObjectDel (pattern, FC_DPI_OBJECT);
FcPatternObjectAddDouble (pattern, FC_DPI_OBJECT, dpi);
}
size *= dpi / 72.0;
FcPatternObjectAddDouble (pattern, FC_PIXEL_SIZE_OBJECT, size);
}
if (FcPatternObjectGet (pattern, FC_FONTVERSION_OBJECT, 0, &v) == FcResultNoMatch)
{
FcPatternObjectAddInteger (pattern, FC_FONTVERSION_OBJECT, 0x7fffffff);
}
if (FcPatternObjectGet (pattern, FC_HINT_STYLE_OBJECT, 0, &v) == FcResultNoMatch)
{
FcPatternObjectAddInteger (pattern, FC_HINT_STYLE_OBJECT, FC_HINT_FULL);
}
if (FcPatternObjectGet (pattern, FC_NAMELANG_OBJECT, 0, &v) == FcResultNoMatch)
{
FcPatternObjectAddString (pattern, FC_NAMELANG_OBJECT, FcGetDefaultLang ());
}
/* shouldn't be failed. */
FcPatternObjectGet (pattern, FC_NAMELANG_OBJECT, 0, &namelang);
/* Add a fallback to ensure the english name when the requested language
* isn't available. this would helps for the fonts that have non-English
* name at the beginning.
*/
/* Set "en-us" instead of "en" to avoid giving higher score to "en".
* This is a hack for the case that the orth is not like ll-cc, because,
* if no namelang isn't explicitly set, it will has something like ll-cc
* according to current locale. which may causes FcLangDifferentTerritory
* at FcLangCompare(). thus, the English name is selected so that
* exact matched "en" has higher score than ll-cc.
*/
v2.type = FcTypeString;
v2.u.s = (FcChar8 *) "en-us";
if (FcPatternObjectGet (pattern, FC_FAMILYLANG_OBJECT, 0, &v) == FcResultNoMatch)
{
FcPatternObjectAdd (pattern, FC_FAMILYLANG_OBJECT, namelang, FcTrue);
FcPatternObjectAddWithBinding (pattern, FC_FAMILYLANG_OBJECT, v2, FcValueBindingWeak, FcTrue);
}
if (FcPatternObjectGet (pattern, FC_STYLELANG_OBJECT, 0, &v) == FcResultNoMatch)
{
FcPatternObjectAdd (pattern, FC_STYLELANG_OBJECT, namelang, FcTrue);
FcPatternObjectAddWithBinding (pattern, FC_STYLELANG_OBJECT, v2, FcValueBindingWeak, FcTrue);
}
if (FcPatternObjectGet (pattern, FC_FULLNAMELANG_OBJECT, 0, &v) == FcResultNoMatch)
{
FcPatternObjectAdd (pattern, FC_FULLNAMELANG_OBJECT, namelang, FcTrue);
FcPatternObjectAddWithBinding (pattern, FC_FULLNAMELANG_OBJECT, v2, FcValueBindingWeak, FcTrue);
}
if (FcPatternObjectGet (pattern, FC_PRGNAME_OBJECT, 0, &v) == FcResultNoMatch)
{
FcChar8 *prgname = FcGetPrgname ();
if (prgname)
FcPatternObjectAddString (pattern, FC_PRGNAME_OBJECT, prgname);
}
}
#define __fcdefault__
#include "fcaliastail.h"
#undef __fcdefault__

View File

@@ -0,0 +1,36 @@
/*
* Copyright © 2007 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no representations
* about the suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
/*
* These APIs are deprecated; still exported by the library, but not
* declared in the public header file
*/
#ifndef _FCDEPRECATE_H_
#define _FCDEPRECATE_H_
FcPublic int
FcConfigGetRescanInverval (FcConfig *config);
FcPublic FcBool
FcConfigSetRescanInverval (FcConfig *config, int rescanInterval);
#endif /* _FCDEPRECATE_H_ */

View File

@@ -0,0 +1,379 @@
/*
* fontconfig/src/fcdir.c
*
* Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
#include <dirent.h>
FcBool
FcFileIsDir (const FcChar8 *file)
{
struct stat statb;
if (FcStat (file, &statb) != 0)
return FcFalse;
return S_ISDIR(statb.st_mode);
}
FcBool
FcFileIsLink (const FcChar8 *file)
{
#if HAVE_LSTAT
struct stat statb;
if (lstat ((const char *)file, &statb) != 0)
return FcFalse;
return S_ISLNK (statb.st_mode);
#else
return FcFalse;
#endif
}
FcBool
FcFileIsFile (const FcChar8 *file)
{
struct stat statb;
if (FcStat (file, &statb) != 0)
return FcFalse;
return S_ISREG (statb.st_mode);
}
static FcBool
FcFileScanFontConfig (FcFontSet *set,
FcBlanks *blanks,
const FcChar8 *file,
FcConfig *config)
{
FcPattern *font;
FcBool ret = FcTrue;
int id;
int count = 0;
id = 0;
do
{
font = 0;
/*
* Nothing in the cache, scan the file
*/
if (FcDebug () & FC_DBG_SCAN)
{
printf ("\tScanning file %s...", file);
fflush (stdout);
}
font = FcFreeTypeQuery (file, id, blanks, &count);
if (FcDebug () & FC_DBG_SCAN)
printf ("done\n");
/*
* Edit pattern with user-defined rules
*/
if (font && config && !FcConfigSubstitute (config, font, FcMatchScan))
{
FcPatternDestroy (font);
font = NULL;
ret = FcFalse;
}
/*
* Add the font
*/
if (font)
{
if (FcDebug() & FC_DBG_SCANV)
{
printf ("Final font pattern:\n");
FcPatternPrint (font);
}
if (!FcFontSetAdd (set, font))
{
FcPatternDestroy (font);
font = NULL;
ret = FcFalse;
}
}
else if (font)
FcPatternDestroy (font);
id++;
} while (font && ret && id < count);
return ret;
}
FcBool
FcFileScanConfig (FcFontSet *set,
FcStrSet *dirs,
FcBlanks *blanks,
const FcChar8 *file,
FcConfig *config)
{
if (FcFileIsDir (file))
return FcStrSetAdd (dirs, file);
else
{
if (set)
return FcFileScanFontConfig (set, blanks, file, config);
else
return FcTrue;
}
}
FcBool
FcFileScan (FcFontSet *set,
FcStrSet *dirs,
FcFileCache *cache FC_UNUSED,
FcBlanks *blanks,
const FcChar8 *file,
FcBool force FC_UNUSED)
{
return FcFileScanConfig (set, dirs, blanks, file, FcConfigGetCurrent ());
}
/*
* Strcmp helper that takes pointers to pointers, copied from qsort(3) manpage
*/
static int
cmpstringp(const void *p1, const void *p2)
{
return strcmp(* (char **) p1, * (char **) p2);
}
FcBool
FcDirScanConfig (FcFontSet *set,
FcStrSet *dirs,
FcBlanks *blanks,
const FcChar8 *dir,
FcBool force, /* XXX unused */
FcConfig *config)
{
DIR *d;
struct dirent *e;
FcStrSet *files;
FcChar8 *file;
FcChar8 *base;
FcBool ret = FcTrue;
int i;
if (!force)
return FcFalse;
if (!set && !dirs)
return FcTrue;
if (!blanks)
blanks = FcConfigGetBlanks (config);
/* freed below */
file = (FcChar8 *) malloc (strlen ((char *) dir) + 1 + FC_MAX_FILE_LEN + 1);
if (!file) {
ret = FcFalse;
goto bail;
}
strcpy ((char *) file, (char *) dir);
strcat ((char *) file, "/");
base = file + strlen ((char *) file);
if (FcDebug () & FC_DBG_SCAN)
printf ("\tScanning dir %s\n", dir);
d = opendir ((char *) dir);
if (!d)
{
/* Don't complain about missing directories */
if (errno != ENOENT)
ret = FcFalse;
goto bail;
}
files = FcStrSetCreate ();
if (!files)
{
ret = FcFalse;
goto bail1;
}
while ((e = readdir (d)))
{
if (e->d_name[0] != '.' && strlen (e->d_name) < FC_MAX_FILE_LEN)
{
strcpy ((char *) base, (char *) e->d_name);
if (!FcStrSetAdd (files, file)) {
ret = FcFalse;
goto bail2;
}
}
}
/*
* Sort files to make things prettier
*/
qsort(files->strs, files->num, sizeof(FcChar8 *), cmpstringp);
/*
* Scan file files to build font patterns
*/
for (i = 0; i < files->num; i++)
FcFileScanConfig (set, dirs, blanks, files->strs[i], config);
bail2:
FcStrSetDestroy (files);
bail1:
closedir (d);
bail:
if (file)
free (file);
return ret;
}
FcBool
FcDirScan (FcFontSet *set,
FcStrSet *dirs,
FcFileCache *cache, /* XXX unused */
FcBlanks *blanks,
const FcChar8 *dir,
FcBool force /* XXX unused */)
{
if (cache || !force)
return FcFalse;
return FcDirScanConfig (set, dirs, blanks, dir, force, FcConfigGetCurrent ());
}
/*
* Scan the specified directory and construct a cache of its contents
*/
FcCache *
FcDirCacheScan (const FcChar8 *dir, FcConfig *config)
{
FcStrSet *dirs;
FcFontSet *set;
FcCache *cache = NULL;
struct stat dir_stat;
if (FcDebug () & FC_DBG_FONTSET)
printf ("cache scan dir %s\n", dir);
if (FcStatChecksum (dir, &dir_stat) < 0)
goto bail;
set = FcFontSetCreate();
if (!set)
goto bail;
dirs = FcStrSetCreate ();
if (!dirs)
goto bail1;
/*
* Scan the dir
*/
if (!FcDirScanConfig (set, dirs, NULL, dir, FcTrue, config))
goto bail2;
/*
* Build the cache object
*/
cache = FcDirCacheBuild (set, dir, &dir_stat, dirs);
if (!cache)
goto bail2;
/*
* Write out the cache file, ignoring any troubles
*/
FcDirCacheWrite (cache, config);
bail2:
FcStrSetDestroy (dirs);
bail1:
FcFontSetDestroy (set);
bail:
return cache;
}
FcCache *
FcDirCacheRescan (const FcChar8 *dir, FcConfig *config)
{
FcCache *cache = FcDirCacheLoad (dir, config, NULL);
FcCache *new = NULL;
struct stat dir_stat;
FcStrSet *dirs;
if (!cache)
return NULL;
if (FcStatChecksum (dir, &dir_stat) < 0)
goto bail;
dirs = FcStrSetCreate ();
if (!dirs)
goto bail;
/*
* Scan the dir
*/
if (!FcDirScanConfig (NULL, dirs, NULL, dir, FcTrue, config))
goto bail1;
/*
* Rebuild the cache object
*/
new = FcDirCacheRebuild (cache, &dir_stat, dirs);
if (!new)
goto bail1;
FcDirCacheUnload (cache);
/*
* Write out the cache file, ignoring any troubles
*/
FcDirCacheWrite (new, config);
bail1:
FcStrSetDestroy (dirs);
bail:
return new;
}
/*
* Read (or construct) the cache for a directory
*/
FcCache *
FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config)
{
FcCache *cache = NULL;
/* Try to use existing cache file */
if (!force)
cache = FcDirCacheLoad (dir, config, NULL);
/* Not using existing cache file, construct new cache */
if (!cache)
cache = FcDirCacheScan (dir, config);
return cache;
}
FcBool
FcDirSave (FcFontSet *set FC_UNUSED, FcStrSet * dirs FC_UNUSED, const FcChar8 *dir FC_UNUSED)
{
return FcFalse; /* XXX deprecated */
}
#define __fcdir__
#include "fcaliastail.h"
#undef __fcdir__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,149 @@
/*
* fontconfig/src/fcfs.c
*
* Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
#include <stdlib.h>
FcFontSet *
FcFontSetCreate (void)
{
FcFontSet *s;
s = (FcFontSet *) malloc (sizeof (FcFontSet));
if (!s)
return 0;
s->nfont = 0;
s->sfont = 0;
s->fonts = 0;
return s;
}
void
FcFontSetDestroy (FcFontSet *s)
{
int i;
for (i = 0; i < s->nfont; i++)
FcPatternDestroy (s->fonts[i]);
if (s->fonts)
free (s->fonts);
free (s);
}
FcBool
FcFontSetAdd (FcFontSet *s, FcPattern *font)
{
FcPattern **f;
int sfont;
if (s->nfont == s->sfont)
{
sfont = s->sfont + 32;
if (s->fonts)
f = (FcPattern **) realloc (s->fonts, sfont * sizeof (FcPattern *));
else
f = (FcPattern **) malloc (sfont * sizeof (FcPattern *));
if (!f)
return FcFalse;
s->sfont = sfont;
s->fonts = f;
}
s->fonts[s->nfont++] = font;
return FcTrue;
}
FcBool
FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s)
{
int i;
if (!FcSerializeAlloc (serialize, s, sizeof (FcFontSet)))
return FcFalse;
if (!FcSerializeAlloc (serialize, s->fonts, s->nfont * sizeof (FcPattern *)))
return FcFalse;
for (i = 0; i < s->nfont; i++)
{
if (!FcPatternSerializeAlloc (serialize, s->fonts[i]))
return FcFalse;
}
return FcTrue;
}
FcFontSet *
FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s)
{
int i;
FcFontSet *s_serialize;
FcPattern **fonts_serialize;
FcPattern *p_serialize;
s_serialize = FcSerializePtr (serialize, s);
if (!s_serialize)
return NULL;
*s_serialize = *s;
s_serialize->sfont = s_serialize->nfont;
fonts_serialize = FcSerializePtr (serialize, s->fonts);
if (!fonts_serialize)
return NULL;
s_serialize->fonts = FcPtrToEncodedOffset (s_serialize,
fonts_serialize, FcPattern *);
for (i = 0; i < s->nfont; i++)
{
p_serialize = FcPatternSerialize (serialize, s->fonts[i]);
if (!p_serialize)
return NULL;
fonts_serialize[i] = FcPtrToEncodedOffset (s_serialize,
p_serialize,
FcPattern);
}
return s_serialize;
}
FcFontSet *
FcFontSetDeserialize (const FcFontSet *set)
{
int i;
FcFontSet *new = FcFontSetCreate ();
if (!new)
return NULL;
for (i = 0; i < set->nfont; i++)
{
if (!FcFontSetAdd (new, FcPatternDuplicate (FcFontSetFont (set, i))))
goto bail;
}
return new;
bail:
FcFontSetDestroy (new);
return NULL;
}
#define __fcfs__
#include "fcaliastail.h"
#undef __fcfs__

View File

@@ -0,0 +1,12 @@
extern __typeof (FcFreeTypeCharIndex) IA__FcFreeTypeCharIndex __attribute((visibility("hidden")));
#define FcFreeTypeCharIndex IA__FcFreeTypeCharIndex
extern __typeof (FcFreeTypeCharSetAndSpacing) IA__FcFreeTypeCharSetAndSpacing __attribute((visibility("hidden")));
#define FcFreeTypeCharSetAndSpacing IA__FcFreeTypeCharSetAndSpacing
extern __typeof (FcFreeTypeCharSet) IA__FcFreeTypeCharSet __attribute((visibility("hidden")));
#define FcFreeTypeCharSet IA__FcFreeTypeCharSet
extern __typeof (FcPatternGetFTFace) IA__FcPatternGetFTFace __attribute((visibility("hidden")));
#define FcPatternGetFTFace IA__FcPatternGetFTFace
extern __typeof (FcPatternAddFTFace) IA__FcPatternAddFTFace __attribute((visibility("hidden")));
#define FcPatternAddFTFace IA__FcPatternAddFTFace
extern __typeof (FcFreeTypeQueryFace) IA__FcFreeTypeQueryFace __attribute((visibility("hidden")));
#define FcFreeTypeQueryFace IA__FcFreeTypeQueryFace

View File

@@ -0,0 +1,20 @@
#if HAVE_GNUC_ATTRIBUTE
#ifdef __fcfreetype__
# undef FcFreeTypeCharIndex
extern __typeof (FcFreeTypeCharIndex) FcFreeTypeCharIndex __attribute((alias("IA__FcFreeTypeCharIndex"), visibility("default")));
# undef FcFreeTypeCharSetAndSpacing
extern __typeof (FcFreeTypeCharSetAndSpacing) FcFreeTypeCharSetAndSpacing __attribute((alias("IA__FcFreeTypeCharSetAndSpacing"), visibility("default")));
# undef FcFreeTypeCharSet
extern __typeof (FcFreeTypeCharSet) FcFreeTypeCharSet __attribute((alias("IA__FcFreeTypeCharSet"), visibility("default")));
#endif /* __fcfreetype__ */
#ifdef __fcpat__
# undef FcPatternGetFTFace
extern __typeof (FcPatternGetFTFace) FcPatternGetFTFace __attribute((alias("IA__FcPatternGetFTFace"), visibility("default")));
# undef FcPatternAddFTFace
extern __typeof (FcPatternAddFTFace) FcPatternAddFTFace __attribute((alias("IA__FcPatternAddFTFace"), visibility("default")));
#endif /* __fcpat__ */
#ifdef __fcfreetype__
# undef FcFreeTypeQueryFace
extern __typeof (FcFreeTypeQueryFace) FcFreeTypeQueryFace __attribute((alias("IA__FcFreeTypeQueryFace"), visibility("default")));
#endif /* */
#endif /* HAVE_GNUC_ATTRIBUTE */

View File

@@ -0,0 +1,54 @@
/*
* Copyright © 2007 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no representations
* about the suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#ifndef _FCFTINT_H_
#define _FCFTINT_H_
#include <fontconfig/fcfreetype.h>
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun)
#define FcPrivate __attribute__((__visibility__("hidden")))
#define HAVE_GNUC_ATTRIBUTE 1
#include "fcftalias.h"
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
#define FcPrivate __hidden
#else /* not gcc >= 3.3 and not Sun Studio >= 8 */
#define FcPrivate
#endif
/* fcfreetype.c */
FcPrivate FcBool
FcFreeTypeIsExclusiveLang (const FcChar8 *lang);
FcPrivate FcBool
FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
FcPrivate FcChar32
FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
FcPrivate FcChar32
FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
FcPrivate const FcCharMap *
FcFreeTypeGetPrivateMap (FT_Encoding encoding);
#endif /* _FCFTINT_H_ */

View File

@@ -0,0 +1,317 @@
/*
* fontconfig/src/fchash.c
*
* Copyright © 2003 Keith Packard
* Copyright © 2013 Red Hat, Inc.
* Red Hat Author(s): Akira TAGOH
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
#include <stdio.h>
#include <string.h>
#define ROTRN(w, v, n) ((((FcChar32)v) >> n) | (((FcChar32)v) << (w - n)))
#define ROTR32(v, n) ROTRN(32, v, n)
#define SHR(v, n) (v >> n)
#define Ch(x, y, z) ((x & y) ^ (~x & z))
#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
#define SS0(x) (ROTR32(x, 2) ^ ROTR32(x, 13) ^ ROTR32(x, 22))
#define SS1(x) (ROTR32(x, 6) ^ ROTR32(x, 11) ^ ROTR32(x, 25))
#define ss0(x) (ROTR32(x, 7) ^ ROTR32(x, 18) ^ SHR(x, 3))
#define ss1(x) (ROTR32(x, 17) ^ ROTR32(x, 19) ^ SHR(x, 10))
static FcChar32 *
FcHashInitSHA256Digest (void)
{
int i;
static const FcChar32 h[] = {
0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL,
0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL
};
FcChar32 *ret = malloc (sizeof (FcChar32) * 8);
if (!ret)
return NULL;
for (i = 0; i < 8; i++)
ret[i] = h[i];
return ret;
}
static void
FcHashComputeSHA256Digest (FcChar32 *hash,
const char *block)
{
static const FcChar32 k[] = {
0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL,
0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL,
0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL,
0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL,
0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL,
0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL,
0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL,
0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL,
0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL,
0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL,
0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL,
0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL,
0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL,
0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL,
0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL,
0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL
};
FcChar32 w[64], i, j, t1, t2;
FcChar32 a, b, c, d, e, f, g, h;
#define H(n) (hash[n])
a = H(0);
b = H(1);
c = H(2);
d = H(3);
e = H(4);
f = H(5);
g = H(6);
h = H(7);
for (i = 0; i < 16; i++)
{
j = (block[(i * 4) + 0] & 0xff) << (8 * 3);
j |= (block[(i * 4) + 1] & 0xff) << (8 * 2);
j |= (block[(i * 4) + 2] & 0xff) << (8 * 1);
j |= (block[(i * 4) + 3] & 0xff);
w[i] = j;
}
for (i = 16; i < 64; i++)
w[i] = ss1(w[i - 2]) + w[i - 7] + ss0(w[i - 15]) + w[i - 16];
for (i = 0; i < 64; i++)
{
t1 = h + SS1(e) + Ch(e, f, g) + k[i] + w[i];
t2 = SS0(a) + Maj(a, b, c);
h = g;
g = f;
f = e;
e = d + t1;
d = c;
c = b;
b = a;
a = t1 + t2;
}
H(0) += a;
H(1) += b;
H(2) += c;
H(3) += d;
H(4) += e;
H(5) += f;
H(6) += g;
H(7) += h;
#undef H
}
static FcChar8 *
FcHashSHA256ToString (FcChar32 *hash)
{
FcChar8 *ret = NULL;
static const char hex[] = "0123456789abcdef";
int i, j;
if (hash)
{
ret = malloc (sizeof (FcChar8) * (8 * 8 + 7 + 1));
if (!ret)
return NULL;
memcpy (ret, "sha256:", 7);
#define H(n) hash[n]
for (i = 0; i < 8; i++)
{
FcChar32 v = H(i);
for (j = 0; j < 8; j++)
ret[7 + (i * 8) + j] = hex[(v >> (28 - j * 4)) & 0xf];
}
ret[7 + i * 8] = 0;
#undef H
free (hash);
}
return ret;
}
FcChar8 *
FcHashGetSHA256Digest (const FcChar8 *input_strings,
size_t len)
{
size_t i, round_len = len / 64;
char block[64];
FcChar32 *ret = FcHashInitSHA256Digest ();
if (!ret)
return NULL;
for (i = 0; i < round_len; i++)
{
FcHashComputeSHA256Digest (ret, (const char *)&input_strings[i * 64]);
}
/* padding */
if ((len % 64) != 0)
memcpy (block, &input_strings[len / 64], len % 64);
memset (&block[len % 64], 0, 64 - (len % 64));
block[len % 64] = 0x80;
if ((64 - (len % 64)) < 9)
{
/* process a block once */
FcHashComputeSHA256Digest (ret, block);
memset (block, 0, 64);
}
/* set input size at the end */
len *= 8;
block[63 - 0] = (uint64_t)len & 0xff;
block[63 - 1] = ((uint64_t)len >> 8) & 0xff;
block[63 - 2] = ((uint64_t)len >> 16) & 0xff;
block[63 - 3] = ((uint64_t)len >> 24) & 0xff;
block[63 - 4] = ((uint64_t)len >> 32) & 0xff;
block[63 - 5] = ((uint64_t)len >> 40) & 0xff;
block[63 - 6] = ((uint64_t)len >> 48) & 0xff;
block[63 - 7] = ((uint64_t)len >> 56) & 0xff;
FcHashComputeSHA256Digest (ret, block);
return FcHashSHA256ToString (ret);
}
FcChar8 *
FcHashGetSHA256DigestFromFile (const FcChar8 *filename)
{
FILE *fp = fopen ((const char *)filename, "rb");
char ibuf[64];
FcChar32 *ret;
size_t len;
struct stat st;
if (!fp)
return NULL;
if (FcStat (filename, &st))
goto bail0;
ret = FcHashInitSHA256Digest ();
if (!ret)
goto bail0;
while (!feof (fp))
{
if ((len = fread (ibuf, sizeof (char), 64, fp)) < 64)
{
uint64_t v;
/* add a padding */
memset (&ibuf[len], 0, 64 - len);
ibuf[len] = 0x80;
if ((64 - len) < 9)
{
/* process a block once */
FcHashComputeSHA256Digest (ret, ibuf);
memset (ibuf, 0, 64);
}
/* set input size at the end */
v = (long)st.st_size * 8;
ibuf[63 - 0] = v & 0xff;
ibuf[63 - 1] = (v >> 8) & 0xff;
ibuf[63 - 2] = (v >> 16) & 0xff;
ibuf[63 - 3] = (v >> 24) & 0xff;
ibuf[63 - 4] = (v >> 32) & 0xff;
ibuf[63 - 5] = (v >> 40) & 0xff;
ibuf[63 - 6] = (v >> 48) & 0xff;
ibuf[63 - 7] = (v >> 56) & 0xff;
FcHashComputeSHA256Digest (ret, ibuf);
break;
}
else
{
FcHashComputeSHA256Digest (ret, ibuf);
}
}
fclose (fp);
return FcHashSHA256ToString (ret);
bail0:
fclose (fp);
return NULL;
}
FcChar8 *
FcHashGetSHA256DigestFromMemory (const char *fontdata,
size_t length)
{
char ibuf[64];
FcChar32 *ret;
size_t i = 0;
ret = FcHashInitSHA256Digest ();
if (!ret)
return NULL;
while (i <= length)
{
if ((length - i) < 64)
{
uint64_t v;
size_t n;
/* add a padding */
n = length - i;
if (n > 0)
memcpy (ibuf, &fontdata[i], n);
memset (&ibuf[n], 0, 64 - n);
ibuf[n] = 0x80;
if ((64 - n) < 9)
{
/* process a block once */
FcHashComputeSHA256Digest (ret, ibuf);
memset (ibuf, 0, 64);
}
/* set input size at the end */
v = length * 8;
ibuf[63 - 0] = v & 0xff;
ibuf[63 - 1] = (v >> 8) & 0xff;
ibuf[63 - 2] = (v >> 16) & 0xff;
ibuf[63 - 3] = (v >> 24) & 0xff;
ibuf[63 - 4] = (v >> 32) & 0xff;
ibuf[63 - 5] = (v >> 40) & 0xff;
ibuf[63 - 6] = (v >> 48) & 0xff;
ibuf[63 - 7] = (v >> 56) & 0xff;
FcHashComputeSHA256Digest (ret, ibuf);
break;
}
else
{
FcHashComputeSHA256Digest (ret, &fontdata[i]);
}
i += 64;
}
return FcHashSHA256ToString (ret);
}

View File

@@ -0,0 +1,215 @@
/*
* fontconfig/src/fcinit.c
*
* Copyright © 2001 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
#include <stdlib.h>
#if defined(FC_ATOMIC_INT_NIL)
#pragma message("Could not find any system to define atomic_int macros, library may NOT be thread-safe.")
#endif
#if defined(FC_MUTEX_IMPL_NIL)
#pragma message("Could not find any system to define mutex macros, library may NOT be thread-safe.")
#endif
#if defined(FC_ATOMIC_INT_NIL) || defined(FC_MUTEX_IMPL_NIL)
#pragma message("To suppress these warnings, define FC_NO_MT.")
#endif
static FcConfig *
FcInitFallbackConfig (void)
{
FcConfig *config;
config = FcConfigCreate ();
if (!config)
goto bail0;
if (!FcConfigAddDir (config, (FcChar8 *) FC_DEFAULT_FONTS))
goto bail1;
if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR))
goto bail1;
return config;
bail1:
FcConfigDestroy (config);
bail0:
return 0;
}
int
FcGetVersion (void)
{
return FC_VERSION;
}
/*
* Load the configuration files
*/
FcConfig *
FcInitLoadOwnConfig (FcConfig *config)
{
if (!config)
{
config = FcConfigCreate ();
if (!config)
return NULL;
}
FcInitDebug ();
if (!FcConfigParseAndLoad (config, 0, FcTrue))
{
FcConfigDestroy (config);
return FcInitFallbackConfig ();
}
if (config->cacheDirs && config->cacheDirs->num == 0)
{
FcChar8 *prefix, *p;
size_t plen;
fprintf (stderr,
"Fontconfig warning: no <cachedir> elements found. Check configuration.\n");
fprintf (stderr,
"Fontconfig warning: adding <cachedir>%s</cachedir>\n",
FC_CACHEDIR);
prefix = FcConfigXdgCacheHome ();
if (!prefix)
goto bail;
plen = strlen ((const char *)prefix);
p = realloc (prefix, plen + 12);
if (!p)
goto bail;
prefix = p;
memcpy (&prefix[plen], FC_DIR_SEPARATOR_S "fontconfig", 11);
prefix[plen + 11] = 0;
fprintf (stderr,
"Fontconfig warning: adding <cachedir prefix=\"xdg\">fontconfig</cachedir>\n");
if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR) ||
!FcConfigAddCacheDir (config, (FcChar8 *) prefix))
{
bail:
fprintf (stderr,
"Fontconfig error: out of memory");
if (prefix)
FcStrFree (prefix);
FcConfigDestroy (config);
return FcInitFallbackConfig ();
}
FcStrFree (prefix);
}
return config;
}
FcConfig *
FcInitLoadConfig (void)
{
return FcInitLoadOwnConfig (NULL);
}
/*
* Load the configuration files and scan for available fonts
*/
FcConfig *
FcInitLoadOwnConfigAndFonts (FcConfig *config)
{
config = FcInitLoadOwnConfig (config);
if (!config)
return 0;
if (!FcConfigBuildFonts (config))
{
FcConfigDestroy (config);
return 0;
}
return config;
}
FcConfig *
FcInitLoadConfigAndFonts (void)
{
return FcInitLoadOwnConfigAndFonts (NULL);
}
/*
* Initialize the default library configuration
*/
FcBool
FcInit (void)
{
return FcConfigInit ();
}
/*
* Free all library-allocated data structures.
*/
void
FcFini (void)
{
FcConfigFini ();
FcCacheFini ();
FcDefaultFini ();
}
/*
* Reread the configuration and available font lists
*/
FcBool
FcInitReinitialize (void)
{
FcConfig *config;
config = FcInitLoadConfigAndFonts ();
if (!config)
return FcFalse;
return FcConfigSetCurrent (config);
}
FcBool
FcInitBringUptoDate (void)
{
FcConfig *config = FcConfigGetCurrent ();
time_t now;
/*
* rescanInterval == 0 disables automatic up to date
*/
if (config->rescanInterval == 0)
return FcTrue;
/*
* Check no more often than rescanInterval seconds
*/
now = time (0);
if (config->rescanTime + config->rescanInterval - now > 0)
return FcTrue;
/*
* If up to date, don't reload configuration
*/
if (FcConfigUptoDate (0))
return FcTrue;
return FcInitReinitialize ();
}
#define __fcinit__
#include "fcaliastail.h"
#undef __fcinit__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,607 @@
/*
* fontconfig/src/fclist.c
*
* Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
#include <stdlib.h>
FcObjectSet *
FcObjectSetCreate (void)
{
FcObjectSet *os;
os = (FcObjectSet *) malloc (sizeof (FcObjectSet));
if (!os)
return 0;
os->nobject = 0;
os->sobject = 0;
os->objects = 0;
return os;
}
FcBool
FcObjectSetAdd (FcObjectSet *os, const char *object)
{
int s;
const char **objects;
int high, low, mid, c;
if (os->nobject == os->sobject)
{
s = os->sobject + 4;
if (os->objects)
objects = (const char **) realloc ((void *) os->objects,
s * sizeof (const char *));
else
objects = (const char **) malloc (s * sizeof (const char *));
if (!objects)
return FcFalse;
os->objects = objects;
os->sobject = s;
}
high = os->nobject - 1;
low = 0;
mid = 0;
c = 1;
object = strdup (object);
while (low <= high)
{
mid = (low + high) >> 1;
c = os->objects[mid] - object;
if (c == 0)
{
FcFree (object);
return FcTrue;
}
if (c < 0)
low = mid + 1;
else
high = mid - 1;
}
if (c < 0)
mid++;
memmove (os->objects + mid + 1, os->objects + mid,
(os->nobject - mid) * sizeof (const char *));
os->objects[mid] = object;
os->nobject++;
return FcTrue;
}
void
FcObjectSetDestroy (FcObjectSet *os)
{
int i;
if (os->objects)
{
for (i = 0; i < os->nobject; i++)
FcFree (os->objects[i]);
free ((void *) os->objects);
}
free (os);
}
FcObjectSet *
FcObjectSetVaBuild (const char *first, va_list va)
{
FcObjectSet *ret;
FcObjectSetVapBuild (ret, first, va);
return ret;
}
FcObjectSet *
FcObjectSetBuild (const char *first, ...)
{
va_list va;
FcObjectSet *os;
va_start (va, first);
FcObjectSetVapBuild (os, first, va);
va_end (va);
return os;
}
/*
* Font must have a containing value for every value in the pattern
*/
static FcBool
FcListValueListMatchAny (FcValueListPtr patOrig, /* pattern */
FcValueListPtr fntOrig) /* font */
{
FcValueListPtr pat, fnt;
for (pat = patOrig; pat != NULL; pat = FcValueListNext(pat))
{
for (fnt = fntOrig; fnt != NULL; fnt = FcValueListNext(fnt))
{
/*
* make sure the font 'contains' the pattern.
* (OpListing is OpContains except for strings
* where it requires an exact match)
*/
if (FcConfigCompareValue (&fnt->value,
FC_OP (FcOpListing, FcOpFlagIgnoreBlanks),
&pat->value))
break;
}
if (fnt == NULL)
return FcFalse;
}
return FcTrue;
}
static FcBool
FcListValueListEqual (FcValueListPtr v1orig,
FcValueListPtr v2orig)
{
FcValueListPtr v1, v2;
for (v1 = v1orig; v1 != NULL; v1 = FcValueListNext(v1))
{
for (v2 = v2orig; v2 != NULL; v2 = FcValueListNext(v2))
if (FcValueEqual (FcValueCanonicalize(&(v1)->value),
FcValueCanonicalize(&(v2)->value)))
break;
if (v2 == NULL)
return FcFalse;
}
for (v2 = v2orig; v2 != NULL; v2 = FcValueListNext(v2))
{
for (v1 = v1orig; v1 != NULL; v1 = FcValueListNext(v1))
if (FcValueEqual (FcValueCanonicalize(&v1->value),
FcValueCanonicalize(&v2->value)))
break;
if (v1 == NULL)
return FcFalse;
}
return FcTrue;
}
static FcBool
FcListPatternEqual (FcPattern *p1,
FcPattern *p2,
FcObjectSet *os)
{
int i;
FcPatternElt *e1, *e2;
for (i = 0; i < os->nobject; i++)
{
e1 = FcPatternObjectFindElt (p1, FcObjectFromName (os->objects[i]));
e2 = FcPatternObjectFindElt (p2, FcObjectFromName (os->objects[i]));
if (!e1 && !e2)
continue;
if (!e1 || !e2)
return FcFalse;
if (!FcListValueListEqual (FcPatternEltValues(e1),
FcPatternEltValues(e2)))
return FcFalse;
}
return FcTrue;
}
/*
* FcTrue iff all objects in "p" match "font"
*/
FcBool
FcListPatternMatchAny (const FcPattern *p,
const FcPattern *font)
{
int i;
if (!p)
return FcFalse;
for (i = 0; i < p->num; i++)
{
FcPatternElt *pe = &FcPatternElts(p)[i];
FcPatternElt *fe;
if (pe->object == FC_NAMELANG_OBJECT)
{
/* "namelang" object is the alias object to change "familylang",
* "stylelang" and "fullnamelang" object alltogether. it won't be
* available on the font pattern. so checking its availability
* causes no results. we should ignore it here.
*/
continue;
}
fe = FcPatternObjectFindElt (font, pe->object);
if (!fe)
return FcFalse;
if (!FcListValueListMatchAny (FcPatternEltValues(pe), /* pat elts */
FcPatternEltValues(fe))) /* font elts */
return FcFalse;
}
return FcTrue;
}
static FcChar32
FcListMatrixHash (const FcMatrix *m)
{
int xx = (int) (m->xx * 100),
xy = (int) (m->xy * 100),
yx = (int) (m->yx * 100),
yy = (int) (m->yy * 100);
return ((FcChar32) xx) ^ ((FcChar32) xy) ^ ((FcChar32) yx) ^ ((FcChar32) yy);
}
static FcChar32
FcListValueHash (FcValue *value)
{
FcValue v = FcValueCanonicalize(value);
switch (v.type) {
case FcTypeUnknown:
case FcTypeVoid:
return 0;
case FcTypeInteger:
return (FcChar32) v.u.i;
case FcTypeDouble:
return (FcChar32) (int) v.u.d;
case FcTypeString:
return FcStrHashIgnoreCase (v.u.s);
case FcTypeBool:
return (FcChar32) v.u.b;
case FcTypeMatrix:
return FcListMatrixHash (v.u.m);
case FcTypeCharSet:
return FcCharSetCount (v.u.c);
case FcTypeFTFace:
return (long) v.u.f;
case FcTypeLangSet:
return FcLangSetHash (v.u.l);
}
return 0;
}
static FcChar32
FcListValueListHash (FcValueListPtr list)
{
FcChar32 h = 0;
while (list != NULL)
{
h = h ^ FcListValueHash (&list->value);
list = FcValueListNext(list);
}
return h;
}
static FcChar32
FcListPatternHash (FcPattern *font,
FcObjectSet *os)
{
int n;
FcPatternElt *e;
FcChar32 h = 0;
for (n = 0; n < os->nobject; n++)
{
e = FcPatternObjectFindElt (font, FcObjectFromName (os->objects[n]));
if (e)
h = h ^ FcListValueListHash (FcPatternEltValues(e));
}
return h;
}
typedef struct _FcListBucket {
struct _FcListBucket *next;
FcChar32 hash;
FcPattern *pattern;
} FcListBucket;
#define FC_LIST_HASH_SIZE 4099
typedef struct _FcListHashTable {
int entries;
FcListBucket *buckets[FC_LIST_HASH_SIZE];
} FcListHashTable;
static void
FcListHashTableInit (FcListHashTable *table)
{
table->entries = 0;
memset (table->buckets, '\0', sizeof (table->buckets));
}
static void
FcListHashTableCleanup (FcListHashTable *table)
{
int i;
FcListBucket *bucket, *next;
for (i = 0; i < FC_LIST_HASH_SIZE; i++)
{
for (bucket = table->buckets[i]; bucket; bucket = next)
{
next = bucket->next;
FcPatternDestroy (bucket->pattern);
free (bucket);
}
table->buckets[i] = 0;
}
table->entries = 0;
}
static int
FcGetDefaultObjectLangIndex (FcPattern *font, FcObject object, const FcChar8 *lang)
{
FcPatternElt *e = FcPatternObjectFindElt (font, object);
FcValueListPtr v;
FcValue value;
int idx = -1;
int defidx = -1;
int i;
if (e)
{
for (v = FcPatternEltValues(e), i = 0; v; v = FcValueListNext(v), ++i)
{
value = FcValueCanonicalize (&v->value);
if (value.type == FcTypeString)
{
FcLangResult res = FcLangCompare (value.u.s, lang);
if (res == FcLangEqual)
return i;
if (res == FcLangDifferentCountry && idx < 0)
idx = i;
if (defidx < 0)
{
/* workaround for fonts that has non-English value
* at the head of values.
*/
res = FcLangCompare (value.u.s, (FcChar8 *)"en");
if (res == FcLangEqual)
defidx = i;
}
}
}
}
return (idx > 0) ? idx : (defidx > 0) ? defidx : 0;
}
static FcBool
FcListAppend (FcListHashTable *table,
FcPattern *font,
FcObjectSet *os,
const FcChar8 *lang)
{
int o;
FcPatternElt *e;
FcValueListPtr v;
FcChar32 hash;
FcListBucket **prev, *bucket;
int familyidx = -1;
int fullnameidx = -1;
int styleidx = -1;
int defidx = 0;
int idx;
hash = FcListPatternHash (font, os);
for (prev = &table->buckets[hash % FC_LIST_HASH_SIZE];
(bucket = *prev); prev = &(bucket->next))
{
if (bucket->hash == hash &&
FcListPatternEqual (bucket->pattern, font, os))
return FcTrue;
}
bucket = (FcListBucket *) malloc (sizeof (FcListBucket));
if (!bucket)
goto bail0;
bucket->next = 0;
bucket->hash = hash;
bucket->pattern = FcPatternCreate ();
if (!bucket->pattern)
goto bail1;
for (o = 0; o < os->nobject; o++)
{
if (!strcmp (os->objects[o], FC_FAMILY) || !strcmp (os->objects[o], FC_FAMILYLANG))
{
if (familyidx < 0)
familyidx = FcGetDefaultObjectLangIndex (font, FC_FAMILYLANG_OBJECT, lang);
defidx = familyidx;
}
else if (!strcmp (os->objects[o], FC_FULLNAME) || !strcmp (os->objects[o], FC_FULLNAMELANG))
{
if (fullnameidx < 0)
fullnameidx = FcGetDefaultObjectLangIndex (font, FC_FULLNAMELANG_OBJECT, lang);
defidx = fullnameidx;
}
else if (!strcmp (os->objects[o], FC_STYLE) || !strcmp (os->objects[o], FC_STYLELANG))
{
if (styleidx < 0)
styleidx = FcGetDefaultObjectLangIndex (font, FC_STYLELANG_OBJECT, lang);
defidx = styleidx;
}
else
defidx = 0;
e = FcPatternObjectFindElt (font, FcObjectFromName (os->objects[o]));
if (e)
{
for (v = FcPatternEltValues(e), idx = 0; v;
v = FcValueListNext(v), ++idx)
{
if (!FcPatternAdd (bucket->pattern,
os->objects[o],
FcValueCanonicalize(&v->value), defidx != idx))
goto bail2;
}
}
}
*prev = bucket;
++table->entries;
return FcTrue;
bail2:
FcPatternDestroy (bucket->pattern);
bail1:
free (bucket);
bail0:
return FcFalse;
}
FcFontSet *
FcFontSetList (FcConfig *config,
FcFontSet **sets,
int nsets,
FcPattern *p,
FcObjectSet *os)
{
FcFontSet *ret;
FcFontSet *s;
int f;
int set;
FcListHashTable table;
int i;
FcListBucket *bucket;
int destroy_os = 0;
if (!config)
{
if (!FcInitBringUptoDate ())
goto bail0;
config = FcConfigGetCurrent ();
if (!config)
goto bail0;
}
FcListHashTableInit (&table);
if (!os)
{
os = FcObjectGetSet ();
destroy_os = 1;
}
/*
* Walk all available fonts adding those that
* match to the hash table
*/
for (set = 0; set < nsets; set++)
{
s = sets[set];
if (!s)
continue;
for (f = 0; f < s->nfont; f++)
if (FcListPatternMatchAny (p, /* pattern */
s->fonts[f])) /* font */
{
FcChar8 *lang;
if (FcPatternObjectGetString (p, FC_NAMELANG_OBJECT, 0, &lang) != FcResultMatch)
{
lang = FcGetDefaultLang ();
}
if (!FcListAppend (&table, s->fonts[f], os, lang))
goto bail1;
}
}
#if 0
{
int max = 0;
int full = 0;
int ents = 0;
int len;
for (i = 0; i < FC_LIST_HASH_SIZE; i++)
{
if ((bucket = table.buckets[i]))
{
len = 0;
for (; bucket; bucket = bucket->next)
{
ents++;
len++;
}
if (len > max)
max = len;
full++;
}
}
printf ("used: %d max: %d avg: %g\n", full, max,
(double) ents / FC_LIST_HASH_SIZE);
}
#endif
/*
* Walk the hash table and build
* a font set
*/
ret = FcFontSetCreate ();
if (!ret)
goto bail0;
for (i = 0; i < FC_LIST_HASH_SIZE; i++)
while ((bucket = table.buckets[i]))
{
if (!FcFontSetAdd (ret, bucket->pattern))
goto bail2;
table.buckets[i] = bucket->next;
free (bucket);
}
return ret;
bail2:
FcFontSetDestroy (ret);
bail1:
FcListHashTableCleanup (&table);
bail0:
if (destroy_os)
FcObjectSetDestroy (os);
return 0;
}
FcFontSet *
FcFontList (FcConfig *config,
FcPattern *p,
FcObjectSet *os)
{
FcFontSet *sets[2];
int nsets;
if (!config)
{
if (!FcInitBringUptoDate ())
return 0;
config = FcConfigGetCurrent ();
if (!config)
return 0;
}
nsets = 0;
if (config->fonts[FcSetSystem])
sets[nsets++] = config->fonts[FcSetSystem];
if (config->fonts[FcSetApplication])
sets[nsets++] = config->fonts[FcSetApplication];
return FcFontSetList (config, sets, nsets, p, os);
}
#define __fclist__
#include "fcaliastail.h"
#undef __fclist__

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,116 @@
/*
* fontconfig/src/fcmatrix.c
*
* Copyright © 2000 Tuomas J. Lukka
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Tuomas Lukka not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Tuomas Lukka makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* TUOMAS LUKKA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL TUOMAS LUKKA BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
const FcMatrix FcIdentityMatrix = { 1, 0, 0, 1 };
FcMatrix *
FcMatrixCopy (const FcMatrix *mat)
{
FcMatrix *r;
if(!mat)
return 0;
r = (FcMatrix *) malloc (sizeof (*r) );
if (!r)
return 0;
*r = *mat;
return r;
}
void
FcMatrixFree (FcMatrix *mat)
{
if (mat != &FcIdentityMatrix)
free (mat);
}
FcBool
FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2)
{
if(mat1 == mat2) return FcTrue;
if(mat1 == 0 || mat2 == 0) return FcFalse;
return mat1->xx == mat2->xx &&
mat1->xy == mat2->xy &&
mat1->yx == mat2->yx &&
mat1->yy == mat2->yy;
}
void
FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b)
{
FcMatrix r;
r.xx = a->xx * b->xx + a->xy * b->yx;
r.xy = a->xx * b->xy + a->xy * b->yy;
r.yx = a->yx * b->xx + a->yy * b->yx;
r.yy = a->yx * b->xy + a->yy * b->yy;
*result = r;
}
void
FcMatrixRotate (FcMatrix *m, double c, double s)
{
FcMatrix r;
/*
* X Coordinate system is upside down, swap to make
* rotations counterclockwise
*/
r.xx = c;
r.xy = -s;
r.yx = s;
r.yy = c;
FcMatrixMultiply (m, &r, m);
}
void
FcMatrixScale (FcMatrix *m, double sx, double sy)
{
FcMatrix r;
r.xx = sx;
r.xy = 0;
r.yx = 0;
r.yy = sy;
FcMatrixMultiply (m, &r, m);
}
void
FcMatrixShear (FcMatrix *m, double sh, double sv)
{
FcMatrix r;
r.xx = 1;
r.xy = sh;
r.yx = sv;
r.yy = 1;
FcMatrixMultiply (m, &r, m);
}
#define __fcmatrix__
#include "fcaliastail.h"
#undef __fcmatrix__

View File

@@ -0,0 +1,127 @@
/*
* Atomic int and pointer operations. Originally copied from HarfBuzz.
*
* Copyright © 2007 Chris Wilson
* Copyright © 2009,2010 Red Hat, Inc.
* Copyright © 2011,2012,2013 Google, Inc.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Contributor(s):
* Chris Wilson <chris@chris-wilson.co.uk>
* Red Hat Author(s): Behdad Esfahbod
* Google Author(s): Behdad Esfahbod
*/
#ifndef _FCMUTEX_H_
#define _FCMUTEX_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#define FC_STMT_START do
#define FC_STMT_END while (0)
/* mutex */
/* We need external help for these */
#if 0
#elif !defined(FC_NO_MT) && defined(_MSC_VER) || defined(__MINGW32__)
#include "fcwindows.h"
typedef CRITICAL_SECTION fc_mutex_impl_t;
#define FC_MUTEX_IMPL_INIT { NULL, 0, 0, NULL, NULL, 0 }
#define fc_mutex_impl_init(M) InitializeCriticalSection (M)
#define fc_mutex_impl_lock(M) EnterCriticalSection (M)
#define fc_mutex_impl_unlock(M) LeaveCriticalSection (M)
#define fc_mutex_impl_finish(M) DeleteCriticalSection (M)
#elif !defined(FC_NO_MT) && (defined(HAVE_PTHREAD) || defined(__APPLE__))
#include <pthread.h>
typedef pthread_mutex_t fc_mutex_impl_t;
#define FC_MUTEX_IMPL_INIT PTHREAD_MUTEX_INITIALIZER
#define fc_mutex_impl_init(M) pthread_mutex_init (M, NULL)
#define fc_mutex_impl_lock(M) pthread_mutex_lock (M)
#define fc_mutex_impl_unlock(M) pthread_mutex_unlock (M)
#define fc_mutex_impl_finish(M) pthread_mutex_destroy (M)
#elif !defined(FC_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES)
#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_YIELD)
# include <sched.h>
# define FC_SCHED_YIELD() sched_yield ()
#else
# define FC_SCHED_YIELD() FC_STMT_START {} FC_STMT_END
#endif
/* This actually is not a totally awful implementation. */
typedef volatile int fc_mutex_impl_t;
#define FC_MUTEX_IMPL_INIT 0
#define fc_mutex_impl_init(M) *(M) = 0
#define fc_mutex_impl_lock(M) FC_STMT_START { while (__sync_lock_test_and_set((M), 1)) FC_SCHED_YIELD (); } FC_STMT_END
#define fc_mutex_impl_unlock(M) __sync_lock_release (M)
#define fc_mutex_impl_finish(M) FC_STMT_START {} FC_STMT_END
#elif !defined(FC_NO_MT)
#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_YIELD)
# include <sched.h>
# define FC_SCHED_YIELD() sched_yield ()
#else
# define FC_SCHED_YIELD() FC_STMT_START {} FC_STMT_END
#endif
#define FC_MUTEX_INT_NIL 1 /* Warn that fallback implementation is in use. */
typedef volatile int fc_mutex_impl_t;
#define FC_MUTEX_IMPL_INIT 0
#define fc_mutex_impl_init(M) *(M) = 0
#define fc_mutex_impl_lock(M) FC_STMT_START { while (*(M)) FC_SCHED_YIELD (); (*(M))++; } FC_STMT_END
#define fc_mutex_impl_unlock(M) (*(M))--;
#define fc_mutex_impl_finish(M) FC_STMT_START {} FC_STMT_END
#else /* FC_NO_MT */
typedef int fc_mutex_impl_t;
#define FC_MUTEX_IMPL_INIT 0
#define fc_mutex_impl_init(M) FC_STMT_START {} FC_STMT_END
#define fc_mutex_impl_lock(M) FC_STMT_START {} FC_STMT_END
#define fc_mutex_impl_unlock(M) FC_STMT_START {} FC_STMT_END
#define fc_mutex_impl_finish(M) FC_STMT_START {} FC_STMT_END
#endif
#define FC_MUTEX_INIT {FC_MUTEX_IMPL_INIT}
typedef fc_mutex_impl_t FcMutex;
static inline void FcMutexInit (FcMutex *m) { fc_mutex_impl_init (m); }
static inline void FcMutexLock (FcMutex *m) { fc_mutex_impl_lock (m); }
static inline void FcMutexUnlock (FcMutex *m) { fc_mutex_impl_unlock (m); }
static inline void FcMutexFinish (FcMutex *m) { fc_mutex_impl_finish (m); }
#endif /* _FCMUTEX_H_ */

View File

@@ -0,0 +1,586 @@
/*
* fontconfig/src/fcname.c
*
* Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
static const FcObjectType FcObjects[] = {
#define FC_OBJECT(NAME, Type, Cmp) { FC_##NAME, Type },
#include "fcobjs.h"
#undef FC_OBJECT
};
#define NUM_OBJECT_TYPES ((int) (sizeof FcObjects / sizeof FcObjects[0]))
static const FcObjectType *
FcObjectFindById (FcObject object)
{
if (1 <= object && object <= NUM_OBJECT_TYPES)
return &FcObjects[object - 1];
return FcObjectLookupOtherTypeById (object);
}
FcBool
FcNameRegisterObjectTypes (const FcObjectType *types, int ntypes)
{
/* Deprecated. */
return FcFalse;
}
FcBool
FcNameUnregisterObjectTypes (const FcObjectType *types, int ntypes)
{
/* Deprecated. */
return FcFalse;
}
const FcObjectType *
FcNameGetObjectType (const char *object)
{
int id = FcObjectLookupBuiltinIdByName (object);
if (!id)
return FcObjectLookupOtherTypeByName (object);
return &FcObjects[id - 1];
}
FcBool
FcObjectValidType (FcObject object, FcType type)
{
const FcObjectType *t = FcObjectFindById (object);
if (t) {
switch ((int) t->type) {
case FcTypeUnknown:
return FcTrue;
case FcTypeDouble:
case FcTypeInteger:
if (type == FcTypeDouble || type == FcTypeInteger)
return FcTrue;
break;
case FcTypeLangSet:
if (type == FcTypeLangSet || type == FcTypeString)
return FcTrue;
break;
default:
if (type == t->type)
return FcTrue;
break;
}
return FcFalse;
}
return FcTrue;
}
FcObject
FcObjectFromName (const char * name)
{
return FcObjectLookupIdByName (name);
}
FcObjectSet *
FcObjectGetSet (void)
{
int i;
FcObjectSet *os = NULL;
os = FcObjectSetCreate ();
for (i = 0; i < NUM_OBJECT_TYPES; i++)
FcObjectSetAdd (os, FcObjects[i].object);
return os;
}
const char *
FcObjectName (FcObject object)
{
const FcObjectType *o = FcObjectFindById (object);
if (o)
return o->object;
return FcObjectLookupOtherNameById (object);
}
static const FcConstant _FcBaseConstants[] = {
{ (FcChar8 *) "thin", "weight", FC_WEIGHT_THIN, },
{ (FcChar8 *) "extralight", "weight", FC_WEIGHT_EXTRALIGHT, },
{ (FcChar8 *) "ultralight", "weight", FC_WEIGHT_EXTRALIGHT, },
{ (FcChar8 *) "light", "weight", FC_WEIGHT_LIGHT, },
{ (FcChar8 *) "book", "weight", FC_WEIGHT_BOOK, },
{ (FcChar8 *) "regular", "weight", FC_WEIGHT_REGULAR, },
{ (FcChar8 *) "medium", "weight", FC_WEIGHT_MEDIUM, },
{ (FcChar8 *) "demibold", "weight", FC_WEIGHT_DEMIBOLD, },
{ (FcChar8 *) "semibold", "weight", FC_WEIGHT_DEMIBOLD, },
{ (FcChar8 *) "bold", "weight", FC_WEIGHT_BOLD, },
{ (FcChar8 *) "extrabold", "weight", FC_WEIGHT_EXTRABOLD, },
{ (FcChar8 *) "ultrabold", "weight", FC_WEIGHT_EXTRABOLD, },
{ (FcChar8 *) "black", "weight", FC_WEIGHT_BLACK, },
{ (FcChar8 *) "heavy", "weight", FC_WEIGHT_HEAVY, },
{ (FcChar8 *) "roman", "slant", FC_SLANT_ROMAN, },
{ (FcChar8 *) "italic", "slant", FC_SLANT_ITALIC, },
{ (FcChar8 *) "oblique", "slant", FC_SLANT_OBLIQUE, },
{ (FcChar8 *) "ultracondensed", "width", FC_WIDTH_ULTRACONDENSED },
{ (FcChar8 *) "extracondensed", "width", FC_WIDTH_EXTRACONDENSED },
{ (FcChar8 *) "condensed", "width", FC_WIDTH_CONDENSED },
{ (FcChar8 *) "semicondensed", "width", FC_WIDTH_SEMICONDENSED },
{ (FcChar8 *) "normal", "width", FC_WIDTH_NORMAL },
{ (FcChar8 *) "semiexpanded", "width", FC_WIDTH_SEMIEXPANDED },
{ (FcChar8 *) "expanded", "width", FC_WIDTH_EXPANDED },
{ (FcChar8 *) "extraexpanded", "width", FC_WIDTH_EXTRAEXPANDED },
{ (FcChar8 *) "ultraexpanded", "width", FC_WIDTH_ULTRAEXPANDED },
{ (FcChar8 *) "proportional", "spacing", FC_PROPORTIONAL, },
{ (FcChar8 *) "dual", "spacing", FC_DUAL, },
{ (FcChar8 *) "mono", "spacing", FC_MONO, },
{ (FcChar8 *) "charcell", "spacing", FC_CHARCELL, },
{ (FcChar8 *) "unknown", "rgba", FC_RGBA_UNKNOWN },
{ (FcChar8 *) "rgb", "rgba", FC_RGBA_RGB, },
{ (FcChar8 *) "bgr", "rgba", FC_RGBA_BGR, },
{ (FcChar8 *) "vrgb", "rgba", FC_RGBA_VRGB },
{ (FcChar8 *) "vbgr", "rgba", FC_RGBA_VBGR },
{ (FcChar8 *) "none", "rgba", FC_RGBA_NONE },
{ (FcChar8 *) "hintnone", "hintstyle", FC_HINT_NONE },
{ (FcChar8 *) "hintslight", "hintstyle", FC_HINT_SLIGHT },
{ (FcChar8 *) "hintmedium", "hintstyle", FC_HINT_MEDIUM },
{ (FcChar8 *) "hintfull", "hintstyle", FC_HINT_FULL },
{ (FcChar8 *) "antialias", "antialias", FcTrue },
{ (FcChar8 *) "hinting", "hinting", FcTrue },
{ (FcChar8 *) "verticallayout", "verticallayout", FcTrue },
{ (FcChar8 *) "autohint", "autohint", FcTrue },
{ (FcChar8 *) "globaladvance", "globaladvance", FcTrue }, /* deprecated */
{ (FcChar8 *) "outline", "outline", FcTrue },
{ (FcChar8 *) "scalable", "scalable", FcTrue },
{ (FcChar8 *) "minspace", "minspace", FcTrue },
{ (FcChar8 *) "embolden", "embolden", FcTrue },
{ (FcChar8 *) "embeddedbitmap", "embeddedbitmap", FcTrue },
{ (FcChar8 *) "decorative", "decorative", FcTrue },
{ (FcChar8 *) "lcdnone", "lcdfilter", FC_LCD_NONE },
{ (FcChar8 *) "lcddefault", "lcdfilter", FC_LCD_DEFAULT },
{ (FcChar8 *) "lcdlight", "lcdfilter", FC_LCD_LIGHT },
{ (FcChar8 *) "lcdlegacy", "lcdfilter", FC_LCD_LEGACY },
};
#define NUM_FC_CONSTANTS (sizeof _FcBaseConstants/sizeof _FcBaseConstants[0])
FcBool
FcNameRegisterConstants (const FcConstant *consts, int nconsts)
{
/* Deprecated. */
return FcFalse;
}
FcBool
FcNameUnregisterConstants (const FcConstant *consts, int nconsts)
{
/* Deprecated. */
return FcFalse;
}
const FcConstant *
FcNameGetConstant (const FcChar8 *string)
{
unsigned int i;
for (i = 0; i < NUM_FC_CONSTANTS; i++)
if (!FcStrCmpIgnoreCase (string, _FcBaseConstants[i].name))
return &_FcBaseConstants[i];
return 0;
}
FcBool
FcNameConstant (const FcChar8 *string, int *result)
{
const FcConstant *c;
if ((c = FcNameGetConstant(string)))
{
*result = c->value;
return FcTrue;
}
return FcFalse;
}
FcBool
FcNameBool (const FcChar8 *v, FcBool *result)
{
char c0, c1;
c0 = *v;
c0 = FcToLower (c0);
if (c0 == 't' || c0 == 'y' || c0 == '1')
{
*result = FcTrue;
return FcTrue;
}
if (c0 == 'f' || c0 == 'n' || c0 == '0')
{
*result = FcFalse;
return FcTrue;
}
if (c0 == 'o')
{
c1 = v[1];
c1 = FcToLower (c1);
if (c1 == 'n')
{
*result = FcTrue;
return FcTrue;
}
if (c1 == 'f')
{
*result = FcFalse;
return FcTrue;
}
}
return FcFalse;
}
static FcValue
FcNameConvert (FcType type, FcChar8 *string)
{
FcValue v;
FcMatrix m;
v.type = type;
switch ((int) v.type) {
case FcTypeInteger:
if (!FcNameConstant (string, &v.u.i))
v.u.i = atoi ((char *) string);
break;
case FcTypeString:
v.u.s = FcStrdup (string);
if (!v.u.s)
v.type = FcTypeVoid;
break;
case FcTypeBool:
if (!FcNameBool (string, &v.u.b))
v.u.b = FcFalse;
break;
case FcTypeDouble:
v.u.d = strtod ((char *) string, 0);
break;
case FcTypeMatrix:
FcMatrixInit (&m);
sscanf ((char *) string, "%lg %lg %lg %lg", &m.xx, &m.xy, &m.yx, &m.yy);
v.u.m = FcMatrixCopy (&m);
break;
case FcTypeCharSet:
v.u.c = FcNameParseCharSet (string);
if (!v.u.c)
v.type = FcTypeVoid;
break;
case FcTypeLangSet:
v.u.l = FcNameParseLangSet (string);
if (!v.u.l)
v.type = FcTypeVoid;
break;
default:
break;
}
return v;
}
static const FcChar8 *
FcNameFindNext (const FcChar8 *cur, const char *delim, FcChar8 *save, FcChar8 *last)
{
FcChar8 c;
while ((c = *cur))
{
if (!isspace (c))
break;
++cur;
}
while ((c = *cur))
{
if (c == '\\')
{
++cur;
if (!(c = *cur))
break;
}
else if (strchr (delim, c))
break;
++cur;
*save++ = c;
}
*save = 0;
*last = *cur;
if (*cur)
cur++;
return cur;
}
FcPattern *
FcNameParse (const FcChar8 *name)
{
FcChar8 *save;
FcPattern *pat;
double d;
FcChar8 *e;
FcChar8 delim;
FcValue v;
const FcObjectType *t;
const FcConstant *c;
/* freed below */
save = malloc (strlen ((char *) name) + 1);
if (!save)
goto bail0;
pat = FcPatternCreate ();
if (!pat)
goto bail1;
for (;;)
{
name = FcNameFindNext (name, "-,:", save, &delim);
if (save[0])
{
if (!FcPatternAddString (pat, FC_FAMILY, save))
goto bail2;
}
if (delim != ',')
break;
}
if (delim == '-')
{
for (;;)
{
name = FcNameFindNext (name, "-,:", save, &delim);
d = strtod ((char *) save, (char **) &e);
if (e != save)
{
if (!FcPatternAddDouble (pat, FC_SIZE, d))
goto bail2;
}
if (delim != ',')
break;
}
}
while (delim == ':')
{
name = FcNameFindNext (name, "=_:", save, &delim);
if (save[0])
{
if (delim == '=' || delim == '_')
{
t = FcNameGetObjectType ((char *) save);
for (;;)
{
name = FcNameFindNext (name, ":,", save, &delim);
if (t)
{
v = FcNameConvert (t->type, save);
if (!FcPatternAdd (pat, t->object, v, FcTrue))
{
FcValueDestroy (v);
goto bail2;
}
FcValueDestroy (v);
}
if (delim != ',')
break;
}
}
else
{
if ((c = FcNameGetConstant (save)))
{
t = FcNameGetObjectType ((char *) c->object);
if (t == NULL)
goto bail2;
switch ((int) t->type) {
case FcTypeInteger:
case FcTypeDouble:
if (!FcPatternAddInteger (pat, c->object, c->value))
goto bail2;
break;
case FcTypeBool:
if (!FcPatternAddBool (pat, c->object, c->value))
goto bail2;
break;
default:
break;
}
}
}
}
}
free (save);
return pat;
bail2:
FcPatternDestroy (pat);
bail1:
free (save);
bail0:
return 0;
}
static FcBool
FcNameUnparseString (FcStrBuf *buf,
const FcChar8 *string,
const FcChar8 *escape)
{
FcChar8 c;
while ((c = *string++))
{
if (escape && strchr ((char *) escape, (char) c))
{
if (!FcStrBufChar (buf, escape[0]))
return FcFalse;
}
if (!FcStrBufChar (buf, c))
return FcFalse;
}
return FcTrue;
}
FcBool
FcNameUnparseValue (FcStrBuf *buf,
FcValue *v0,
FcChar8 *escape)
{
FcChar8 temp[1024];
FcValue v = FcValueCanonicalize(v0);
switch (v.type) {
case FcTypeUnknown:
case FcTypeVoid:
return FcTrue;
case FcTypeInteger:
sprintf ((char *) temp, "%d", v.u.i);
return FcNameUnparseString (buf, temp, 0);
case FcTypeDouble:
sprintf ((char *) temp, "%g", v.u.d);
return FcNameUnparseString (buf, temp, 0);
case FcTypeString:
return FcNameUnparseString (buf, v.u.s, escape);
case FcTypeBool:
return FcNameUnparseString (buf, v.u.b ? (FcChar8 *) "True" : (FcChar8 *) "False", 0);
case FcTypeMatrix:
sprintf ((char *) temp, "%g %g %g %g",
v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy);
return FcNameUnparseString (buf, temp, 0);
case FcTypeCharSet:
return FcNameUnparseCharSet (buf, v.u.c);
case FcTypeLangSet:
return FcNameUnparseLangSet (buf, v.u.l);
case FcTypeFTFace:
return FcTrue;
}
return FcFalse;
}
FcBool
FcNameUnparseValueList (FcStrBuf *buf,
FcValueListPtr v,
FcChar8 *escape)
{
while (v)
{
if (!FcNameUnparseValue (buf, &v->value, escape))
return FcFalse;
if ((v = FcValueListNext(v)) != NULL)
if (!FcNameUnparseString (buf, (FcChar8 *) ",", 0))
return FcFalse;
}
return FcTrue;
}
#define FC_ESCAPE_FIXED "\\-:,"
#define FC_ESCAPE_VARIABLE "\\=_:,"
FcChar8 *
FcNameUnparse (FcPattern *pat)
{
return FcNameUnparseEscaped (pat, FcTrue);
}
FcChar8 *
FcNameUnparseEscaped (FcPattern *pat, FcBool escape)
{
FcStrBuf buf;
FcChar8 buf_static[8192];
int i;
FcPatternElt *e;
FcStrBufInit (&buf, buf_static, sizeof (buf_static));
e = FcPatternObjectFindElt (pat, FC_FAMILY_OBJECT);
if (e)
{
if (!FcNameUnparseValueList (&buf, FcPatternEltValues(e), escape ? (FcChar8 *) FC_ESCAPE_FIXED : 0))
goto bail0;
}
e = FcPatternObjectFindElt (pat, FC_SIZE_OBJECT);
if (e)
{
if (!FcNameUnparseString (&buf, (FcChar8 *) "-", 0))
goto bail0;
if (!FcNameUnparseValueList (&buf, FcPatternEltValues(e), escape ? (FcChar8 *) FC_ESCAPE_FIXED : 0))
goto bail0;
}
for (i = 0; i < NUM_OBJECT_TYPES; i++)
{
FcObject id = i + 1;
const FcObjectType *o;
o = &FcObjects[i];
if (!strcmp (o->object, FC_FAMILY) ||
!strcmp (o->object, FC_SIZE))
continue;
e = FcPatternObjectFindElt (pat, id);
if (e)
{
if (!FcNameUnparseString (&buf, (FcChar8 *) ":", 0))
goto bail0;
if (!FcNameUnparseString (&buf, (FcChar8 *) o->object, escape ? (FcChar8 *) FC_ESCAPE_VARIABLE : 0))
goto bail0;
if (!FcNameUnparseString (&buf, (FcChar8 *) "=", 0))
goto bail0;
if (!FcNameUnparseValueList (&buf, FcPatternEltValues(e), escape ?
(FcChar8 *) FC_ESCAPE_VARIABLE : 0))
goto bail0;
}
}
return FcStrBufDone (&buf);
bail0:
FcStrBufDestroy (&buf);
return 0;
}
#define __fcname__
#include "fcaliastail.h"
#undef __fcname__

View File

@@ -0,0 +1,139 @@
/*
* fontconfig/src/fclist.c
*
* Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
static unsigned int
FcObjectTypeHash (register const char *str, register unsigned int len);
static const struct FcObjectTypeInfo *
FcObjectTypeLookup (register const char *str, register unsigned int len);
#include "fcobjshash.h"
#include <string.h>
/* The 1000 is to leave some room for future added internal objects, such
* that caches from newer fontconfig can still be used with older fontconfig
* without getting confused. */
static fc_atomic_int_t next_id = FC_MAX_BASE_OBJECT + FC_EXT_OBJ_INDEX;
struct FcObjectOtherTypeInfo {
struct FcObjectOtherTypeInfo *next;
FcObjectType object;
FcObject id;
} *other_types;
static FcObjectType *
_FcObjectLookupOtherTypeByName (const char *str, FcObject *id)
{
struct FcObjectOtherTypeInfo *ots, *ot;
retry:
ots = fc_atomic_ptr_get (&other_types);
for (ot = ots; ot; ot = ot->next)
if (0 == strcmp (ot->object.object, str))
break;
if (!ot)
{
ot = malloc (sizeof (*ot));
if (!ot)
return NULL;
ot->object.object = (const char *) FcStrdup (str);
ot->object.type = FcTypeUnknown;
ot->id = fc_atomic_int_add (next_id, +1);
ot->next = ots;
if (!fc_atomic_ptr_cmpexch (&other_types, ots, ot)) {
free (ot);
goto retry;
}
}
if (id)
*id = ot->id;
return &ot->object;
}
FcObject
FcObjectLookupBuiltinIdByName (const char *str)
{
const struct FcObjectTypeInfo *o = FcObjectTypeLookup (str, strlen (str));
if (o)
return o->id;
return 0;
}
FcObject
FcObjectLookupIdByName (const char *str)
{
const struct FcObjectTypeInfo *o = FcObjectTypeLookup (str, strlen (str));
FcObject id;
if (o)
return o->id;
if (_FcObjectLookupOtherTypeByName (str, &id))
return id;
return 0;
}
const char *
FcObjectLookupOtherNameById (FcObject id)
{
struct FcObjectOtherTypeInfo *ot;
for (ot = fc_atomic_ptr_get (&other_types); ot; ot = ot->next)
if (ot->id == id)
return ot->object.object;
return NULL;
}
const FcObjectType *
FcObjectLookupOtherTypeByName (const char *str)
{
return _FcObjectLookupOtherTypeByName (str, NULL);
}
FcPrivate const FcObjectType *
FcObjectLookupOtherTypeById (FcObject id)
{
struct FcObjectOtherTypeInfo *ot;
for (ot = fc_atomic_ptr_get (&other_types); ot; ot = ot->next)
if (ot->id == id)
return &ot->object;
return NULL;
}
#include "fcaliastail.h"
#undef __fcobjs__

View File

@@ -0,0 +1,71 @@
/*
* fontconfig/src/fcobjs.h
*
* Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* DON'T REORDER! The order is part of the cache signature. */
FC_OBJECT (FAMILY, FcTypeString, FcCompareFamily)
FC_OBJECT (FAMILYLANG, FcTypeString, NULL)
FC_OBJECT (STYLE, FcTypeString, FcCompareString)
FC_OBJECT (STYLELANG, FcTypeString, NULL)
FC_OBJECT (FULLNAME, FcTypeString, NULL)
FC_OBJECT (FULLNAMELANG, FcTypeString, NULL)
FC_OBJECT (SLANT, FcTypeInteger, FcCompareNumber)
FC_OBJECT (WEIGHT, FcTypeInteger, FcCompareNumber)
FC_OBJECT (WIDTH, FcTypeInteger, FcCompareNumber)
FC_OBJECT (SIZE, FcTypeDouble, NULL)
FC_OBJECT (ASPECT, FcTypeDouble, NULL)
FC_OBJECT (PIXEL_SIZE, FcTypeDouble, FcCompareSize)
FC_OBJECT (SPACING, FcTypeInteger, FcCompareNumber)
FC_OBJECT (FOUNDRY, FcTypeString, FcCompareString)
FC_OBJECT (ANTIALIAS, FcTypeBool, FcCompareBool)
FC_OBJECT (HINT_STYLE, FcTypeInteger, NULL)
FC_OBJECT (HINTING, FcTypeBool, NULL)
FC_OBJECT (VERTICAL_LAYOUT, FcTypeBool, NULL)
FC_OBJECT (AUTOHINT, FcTypeBool, NULL)
FC_OBJECT (GLOBAL_ADVANCE, FcTypeBool, NULL) /* deprecated */
FC_OBJECT (FILE, FcTypeString, FcCompareFilename)
FC_OBJECT (INDEX, FcTypeInteger, NULL)
FC_OBJECT (RASTERIZER, FcTypeString, FcCompareString)
FC_OBJECT (OUTLINE, FcTypeBool, FcCompareBool)
FC_OBJECT (SCALABLE, FcTypeBool, FcCompareBool)
FC_OBJECT (DPI, FcTypeDouble, NULL)
FC_OBJECT (RGBA, FcTypeInteger, NULL)
FC_OBJECT (SCALE, FcTypeDouble, NULL)
FC_OBJECT (MINSPACE, FcTypeBool, NULL)
FC_OBJECT (CHAR_WIDTH, FcTypeInteger, NULL)
FC_OBJECT (CHAR_HEIGHT, FcTypeInteger, NULL)
FC_OBJECT (MATRIX, FcTypeMatrix, NULL)
FC_OBJECT (CHARSET, FcTypeCharSet, FcCompareCharSet)
FC_OBJECT (LANG, FcTypeLangSet, FcCompareLang)
FC_OBJECT (FONTVERSION, FcTypeInteger, FcCompareNumber)
FC_OBJECT (CAPABILITY, FcTypeString, NULL)
FC_OBJECT (FONTFORMAT, FcTypeString, FcCompareString)
FC_OBJECT (EMBOLDEN, FcTypeBool, NULL)
FC_OBJECT (EMBEDDED_BITMAP, FcTypeBool, NULL)
FC_OBJECT (DECORATIVE, FcTypeBool, FcCompareBool)
FC_OBJECT (LCD_FILTER, FcTypeInteger, NULL)
FC_OBJECT (NAMELANG, FcTypeString, NULL)
FC_OBJECT (FONT_FEATURES, FcTypeString, NULL)
FC_OBJECT (PRGNAME, FcTypeString, NULL)
FC_OBJECT (HASH, FcTypeString, FcCompareHash)
FC_OBJECT (POSTSCRIPT_NAME, FcTypeString, FcComparePostScript)
/* ^-------------- Add new objects here. */

View File

@@ -0,0 +1,317 @@
/* ANSI-C code produced by gperf version 3.0.3 */
/* Command-line: gperf -m 100 fcobjshash.gperf */
/* Computed positions: -k'2-3' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
#line 1 "fcobjshash.gperf"
#line 13 "fcobjshash.gperf"
struct FcObjectTypeInfo {
int name;
int id;
};
#include <string.h>
/* maximum key range = 52, duplicates = 0 */
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
static unsigned int
FcObjectTypeHash (register const char *str, register unsigned int len)
{
static const unsigned char asso_values[] =
{
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 17, 12, 1,
35, 0, 56, 27, 15, 0, 56, 56, 0, 7,
7, 0, 22, 56, 21, 10, 13, 0, 56, 56,
0, 26, 1, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56
};
return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[1]];
}
struct FcObjectTypeNamePool_t
{
char FcObjectTypeNamePool_str4[sizeof("file")];
char FcObjectTypeNamePool_str5[sizeof("size")];
char FcObjectTypeNamePool_str6[sizeof("weight")];
char FcObjectTypeNamePool_str7[sizeof("foundry")];
char FcObjectTypeNamePool_str8[sizeof("fullname")];
char FcObjectTypeNamePool_str9[sizeof("pixelsize")];
char FcObjectTypeNamePool_str11[sizeof("decorative")];
char FcObjectTypeNamePool_str12[sizeof("fullnamelang")];
char FcObjectTypeNamePool_str13[sizeof("globaladvance")];
char FcObjectTypeNamePool_str14[sizeof("hinting")];
char FcObjectTypeNamePool_str15[sizeof("minspace")];
char FcObjectTypeNamePool_str16[sizeof("hintstyle")];
char FcObjectTypeNamePool_str17[sizeof("fontformat")];
char FcObjectTypeNamePool_str18[sizeof("fontversion")];
char FcObjectTypeNamePool_str19[sizeof("fontfeatures")];
char FcObjectTypeNamePool_str20[sizeof("outline")];
char FcObjectTypeNamePool_str21[sizeof("autohint")];
char FcObjectTypeNamePool_str22[sizeof("slant")];
char FcObjectTypeNamePool_str23[sizeof("scale")];
char FcObjectTypeNamePool_str24[sizeof("postscriptname")];
char FcObjectTypeNamePool_str25[sizeof("dpi")];
char FcObjectTypeNamePool_str26[sizeof("scalable")];
char FcObjectTypeNamePool_str27[sizeof("embolden")];
char FcObjectTypeNamePool_str28[sizeof("lang")];
char FcObjectTypeNamePool_str29[sizeof("antialias")];
char FcObjectTypeNamePool_str30[sizeof("family")];
char FcObjectTypeNamePool_str31[sizeof("hash")];
char FcObjectTypeNamePool_str32[sizeof("namelang")];
char FcObjectTypeNamePool_str33[sizeof("embeddedbitmap")];
char FcObjectTypeNamePool_str34[sizeof("familylang")];
char FcObjectTypeNamePool_str35[sizeof("verticallayout")];
char FcObjectTypeNamePool_str36[sizeof("matrix")];
char FcObjectTypeNamePool_str37[sizeof("rasterizer")];
char FcObjectTypeNamePool_str38[sizeof("aspect")];
char FcObjectTypeNamePool_str39[sizeof("charset")];
char FcObjectTypeNamePool_str40[sizeof("width")];
char FcObjectTypeNamePool_str41[sizeof("charwidth")];
char FcObjectTypeNamePool_str42[sizeof("charheight")];
char FcObjectTypeNamePool_str43[sizeof("rgba")];
char FcObjectTypeNamePool_str44[sizeof("style")];
char FcObjectTypeNamePool_str45[sizeof("lcdfilter")];
char FcObjectTypeNamePool_str46[sizeof("spacing")];
char FcObjectTypeNamePool_str47[sizeof("index")];
char FcObjectTypeNamePool_str48[sizeof("stylelang")];
char FcObjectTypeNamePool_str49[sizeof("capability")];
char FcObjectTypeNamePool_str55[sizeof("prgname")];
};
static const struct FcObjectTypeNamePool_t FcObjectTypeNamePool_contents =
{
"file",
"size",
"weight",
"foundry",
"fullname",
"pixelsize",
"decorative",
"fullnamelang",
"globaladvance",
"hinting",
"minspace",
"hintstyle",
"fontformat",
"fontversion",
"fontfeatures",
"outline",
"autohint",
"slant",
"scale",
"postscriptname",
"dpi",
"scalable",
"embolden",
"lang",
"antialias",
"family",
"hash",
"namelang",
"embeddedbitmap",
"familylang",
"verticallayout",
"matrix",
"rasterizer",
"aspect",
"charset",
"width",
"charwidth",
"charheight",
"rgba",
"style",
"lcdfilter",
"spacing",
"index",
"stylelang",
"capability",
"prgname"
};
#define FcObjectTypeNamePool ((const char *) &FcObjectTypeNamePool_contents)
#ifdef __GNUC__
__inline
#ifdef __GNUC_STDC_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
const struct FcObjectTypeInfo *
FcObjectTypeLookup (register const char *str, register unsigned int len)
{
enum
{
TOTAL_KEYWORDS = 46,
MIN_WORD_LENGTH = 3,
MAX_WORD_LENGTH = 14,
MIN_HASH_VALUE = 4,
MAX_HASH_VALUE = 55
};
static const struct FcObjectTypeInfo wordlist[] =
{
{-1}, {-1}, {-1}, {-1},
#line 38 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str4,FC_FILE_OBJECT},
#line 27 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str5,FC_SIZE_OBJECT},
#line 25 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str6,FC_WEIGHT_OBJECT},
#line 31 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str7,FC_FOUNDRY_OBJECT},
#line 22 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str8,FC_FULLNAME_OBJECT},
#line 29 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str9,FC_PIXEL_SIZE_OBJECT},
{-1},
#line 57 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str11,FC_DECORATIVE_OBJECT},
#line 23 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str12,FC_FULLNAMELANG_OBJECT},
#line 37 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str13,FC_GLOBAL_ADVANCE_OBJECT},
#line 34 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str14,FC_HINTING_OBJECT},
#line 46 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str15,FC_MINSPACE_OBJECT},
#line 33 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str16,FC_HINT_STYLE_OBJECT},
#line 54 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str17,FC_FONTFORMAT_OBJECT},
#line 52 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str18,FC_FONTVERSION_OBJECT},
#line 60 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str19,FC_FONT_FEATURES_OBJECT},
#line 41 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str20,FC_OUTLINE_OBJECT},
#line 36 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str21,FC_AUTOHINT_OBJECT},
#line 24 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str22,FC_SLANT_OBJECT},
#line 45 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str23,FC_SCALE_OBJECT},
#line 63 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str24,FC_POSTSCRIPT_NAME_OBJECT},
#line 43 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str25,FC_DPI_OBJECT},
#line 42 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str26,FC_SCALABLE_OBJECT},
#line 55 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str27,FC_EMBOLDEN_OBJECT},
#line 51 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str28,FC_LANG_OBJECT},
#line 32 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str29,FC_ANTIALIAS_OBJECT},
#line 18 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str30,FC_FAMILY_OBJECT},
#line 62 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str31,FC_HASH_OBJECT},
#line 59 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str32,FC_NAMELANG_OBJECT},
#line 56 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str33,FC_EMBEDDED_BITMAP_OBJECT},
#line 19 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str34,FC_FAMILYLANG_OBJECT},
#line 35 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str35,FC_VERTICAL_LAYOUT_OBJECT},
#line 49 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str36,FC_MATRIX_OBJECT},
#line 40 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str37,FC_RASTERIZER_OBJECT},
#line 28 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str38,FC_ASPECT_OBJECT},
#line 50 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str39,FC_CHARSET_OBJECT},
#line 26 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str40,FC_WIDTH_OBJECT},
#line 47 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str41,FC_CHAR_WIDTH_OBJECT},
#line 48 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str42,FC_CHAR_HEIGHT_OBJECT},
#line 44 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str43,FC_RGBA_OBJECT},
#line 20 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str44,FC_STYLE_OBJECT},
#line 58 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str45,FC_LCD_FILTER_OBJECT},
#line 30 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str46,FC_SPACING_OBJECT},
#line 39 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str47,FC_INDEX_OBJECT},
#line 21 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str48,FC_STYLELANG_OBJECT},
#line 53 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str49,FC_CAPABILITY_OBJECT},
{-1}, {-1}, {-1}, {-1}, {-1},
#line 61 "fcobjshash.gperf"
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str55,FC_PRGNAME_OBJECT}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = FcObjectTypeHash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register int o = wordlist[key].name;
if (o >= 0)
{
register const char *s = o + FcObjectTypeNamePool;
if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key];
}
}
}
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,155 @@
/*
* Copyright © 2006 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no representations
* about the suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#include "fcint.h"
intptr_t
FcAlignSize (intptr_t size)
{
intptr_t rem = size % sizeof (FcAlign);
if (rem)
size += sizeof (FcAlign) - rem;
return size;
}
/*
* Serialization helper object -- allocate space in the
* yet-to-be-created linear array for a serialized font set
*/
FcSerialize *
FcSerializeCreate (void)
{
FcSerialize *serialize;
serialize = malloc (sizeof (FcSerialize));
if (!serialize)
return NULL;
serialize->size = 0;
serialize->linear = NULL;
serialize->cs_freezer = NULL;
memset (serialize->buckets, '\0', sizeof (serialize->buckets));
return serialize;
}
void
FcSerializeDestroy (FcSerialize *serialize)
{
uintptr_t bucket;
for (bucket = 0; bucket < FC_SERIALIZE_HASH_SIZE; bucket++)
{
FcSerializeBucket *buck, *next;
for (buck = serialize->buckets[bucket]; buck; buck = next) {
next = buck->next;
free (buck);
}
}
if (serialize->cs_freezer)
FcCharSetFreezerDestroy (serialize->cs_freezer);
free (serialize);
}
/*
* Allocate space for an object in the serialized array. Keep track
* of where the object is placed and only allocate one copy of each object
*/
FcBool
FcSerializeAlloc (FcSerialize *serialize, const void *object, int size)
{
uintptr_t bucket = ((uintptr_t) object) % FC_SERIALIZE_HASH_SIZE;
FcSerializeBucket *buck;
for (buck = serialize->buckets[bucket]; buck; buck = buck->next)
if (buck->object == object)
return FcTrue;
buck = malloc (sizeof (FcSerializeBucket));
if (!buck)
return FcFalse;
buck->object = object;
buck->offset = serialize->size;
buck->next = serialize->buckets[bucket];
serialize->buckets[bucket] = buck;
serialize->size += FcAlignSize (size);
return FcTrue;
}
/*
* Reserve space in the serialization array
*/
intptr_t
FcSerializeReserve (FcSerialize *serialize, int size)
{
intptr_t offset = serialize->size;
serialize->size += FcAlignSize (size);
return offset;
}
/*
* Given an object, return the offset in the serialized array where
* the serialized copy of the object is stored
*/
intptr_t
FcSerializeOffset (FcSerialize *serialize, const void *object)
{
uintptr_t bucket = ((uintptr_t) object) % FC_SERIALIZE_HASH_SIZE;
FcSerializeBucket *buck;
for (buck = serialize->buckets[bucket]; buck; buck = buck->next)
if (buck->object == object)
return buck->offset;
return 0;
}
/*
* Given a cache and an object, return a pointer to where
* the serialized copy of the object is stored
*/
void *
FcSerializePtr (FcSerialize *serialize, const void *object)
{
intptr_t offset = FcSerializeOffset (serialize, object);
if (!offset)
return NULL;
return (void *) ((char *) serialize->linear + offset);
}
FcBool
FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str)
{
return FcSerializeAlloc (serialize, str, strlen ((const char *) str) + 1);
}
FcChar8 *
FcStrSerialize (FcSerialize *serialize, const FcChar8 *str)
{
FcChar8 *str_serialize = FcSerializePtr (serialize, str);
if (!str_serialize)
return NULL;
strcpy ((char *) str_serialize, (const char *) str);
return str_serialize;
}
#include "fcaliastail.h"
#undef __fcserialize__

View File

@@ -0,0 +1,362 @@
/*
* Copyright © 2000 Keith Packard
* Copyright © 2005 Patrick Lam
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "fcint.h"
#include "fcarch.h"
#include <dirent.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
#ifdef HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
#endif
#ifdef HAVE_SYS_STATFS_H
#include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#ifdef _WIN32
#ifdef __GNUC__
typedef long long INT64;
#define EPOCH_OFFSET 11644473600ll
#else
#define EPOCH_OFFSET 11644473600i64
typedef __int64 INT64;
#endif
/* Workaround for problems in the stat() in the Microsoft C library:
*
* 1) stat() uses FindFirstFile() to get the file
* attributes. Unfortunately this API doesn't return correct values
* for modification time of a directory until some time after a file
* or subdirectory has been added to the directory. (This causes
* run-test.sh to fail, for instance.) GetFileAttributesEx() is
* better, it returns the updated timestamp right away.
*
* 2) stat() does some strange things related to backward
* compatibility with the local time timestamps on FAT volumes and
* daylight saving time. This causes problems after the switches
* to/from daylight saving time. See
* http://bugzilla.gnome.org/show_bug.cgi?id=154968 , especially
* comment #30, and http://www.codeproject.com/datetime/dstbugs.asp .
* We don't need any of that, FAT and Win9x are as good as dead. So
* just use the UTC timestamps from NTFS, converted to the Unix epoch.
*/
int
FcStat (const FcChar8 *file, struct stat *statb)
{
WIN32_FILE_ATTRIBUTE_DATA wfad;
char full_path_name[MAX_PATH];
char *basename;
DWORD rc;
if (!GetFileAttributesEx ((LPCSTR) file, GetFileExInfoStandard, &wfad))
return -1;
statb->st_dev = 0;
/* Calculate a pseudo inode number as a hash of the full path name.
* Call GetLongPathName() to get the spelling of the path name as it
* is on disk.
*/
rc = GetFullPathName ((LPCSTR) file, sizeof (full_path_name), full_path_name, &basename);
if (rc == 0 || rc > sizeof (full_path_name))
return -1;
rc = GetLongPathName (full_path_name, full_path_name, sizeof (full_path_name));
statb->st_ino = FcStringHash ((const FcChar8 *) full_path_name);
statb->st_mode = _S_IREAD | _S_IWRITE;
statb->st_mode |= (statb->st_mode >> 3) | (statb->st_mode >> 6);
if (wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
statb->st_mode |= _S_IFDIR;
else
statb->st_mode |= _S_IFREG;
statb->st_nlink = 1;
statb->st_uid = statb->st_gid = 0;
statb->st_rdev = 0;
if (wfad.nFileSizeHigh > 0)
return -1;
statb->st_size = wfad.nFileSizeLow;
statb->st_atime = (*(INT64 *)&wfad.ftLastAccessTime)/10000000 - EPOCH_OFFSET;
statb->st_mtime = (*(INT64 *)&wfad.ftLastWriteTime)/10000000 - EPOCH_OFFSET;
statb->st_ctime = statb->st_mtime;
return 0;
}
#else
int
FcStat (const FcChar8 *file, struct stat *statb)
{
return stat ((char *) file, statb);
}
/* Adler-32 checksum implementation */
struct Adler32 {
int a;
int b;
};
static void
Adler32Init (struct Adler32 *ctx)
{
ctx->a = 1;
ctx->b = 0;
}
static void
Adler32Update (struct Adler32 *ctx, const char *data, int data_len)
{
while (data_len--)
{
ctx->a = (ctx->a + *data++) % 65521;
ctx->b = (ctx->b + ctx->a) % 65521;
}
}
static int
Adler32Finish (struct Adler32 *ctx)
{
return ctx->a + (ctx->b << 16);
}
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
/* dirent.d_type can be relied upon on FAT filesystem */
static FcBool
FcDirChecksumScandirFilter(const struct dirent *entry)
{
return entry->d_type != DT_DIR;
}
#endif
#ifdef HAVE_SCANDIR
static int
FcDirChecksumScandirSorter(const struct dirent **lhs, const struct dirent **rhs)
{
return strcmp((*lhs)->d_name, (*rhs)->d_name);
}
#elif HAVE_SCANDIR_VOID_P
static int
FcDirChecksumScandirSorter(const void *a, const void *b)
{
const struct dirent *lhs = a, *rhs = b;
return strcmp(lhs->d_name, rhs->d_name);
}
#endif
static int
FcDirChecksum (const FcChar8 *dir, time_t *checksum)
{
struct Adler32 ctx;
struct dirent **files;
int n;
int ret = 0;
size_t len = strlen ((const char *)dir);
Adler32Init (&ctx);
n = scandir ((const char *)dir, &files,
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
&FcDirChecksumScandirFilter,
#else
NULL,
#endif
&FcDirChecksumScandirSorter);
if (n == -1)
return -1;
while (n--)
{
size_t dlen = strlen (files[n]->d_name);
int dtype;
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
dtype = files[n]->d_type;
if (dtype == DT_UNKNOWN)
{
#endif
struct stat statb;
char f[PATH_MAX + 1];
memcpy (f, dir, len);
f[len] = FC_DIR_SEPARATOR;
memcpy (&f[len + 1], files[n]->d_name, dlen);
f[len + 1 + dlen] = 0;
if (lstat (f, &statb) < 0)
{
ret = -1;
goto bail;
}
if (S_ISDIR (statb.st_mode))
goto bail;
dtype = statb.st_mode;
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
}
#endif
Adler32Update (&ctx, files[n]->d_name, dlen + 1);
Adler32Update (&ctx, (char *)&dtype, sizeof (int));
bail:
free (files[n]);
}
free (files);
if (ret == -1)
return -1;
*checksum = Adler32Finish (&ctx);
return 0;
}
#endif /* _WIN32 */
int
FcStatChecksum (const FcChar8 *file, struct stat *statb)
{
if (FcStat (file, statb) == -1)
return -1;
#ifndef _WIN32
/* We have a workaround of the broken stat() in FcStat() for Win32.
* No need to do something further more.
*/
if (FcIsFsMtimeBroken (file))
{
if (FcDirChecksum (file, &statb->st_mtime) == -1)
return -1;
}
#endif
return 0;
}
static int
FcFStatFs (int fd, FcStatFS *statb)
{
const char *p = NULL;
int ret = -1;
FcBool flag = FcFalse;
#if defined(HAVE_FSTATVFS) && (defined(HAVE_STRUCT_STATVFS_F_BASETYPE) || defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME))
struct statvfs buf;
memset (statb, 0, sizeof (FcStatFS));
if ((ret = fstatvfs (fd, &buf)) == 0)
{
# if defined(HAVE_STRUCT_STATVFS_F_BASETYPE)
p = buf.f_basetype;
# elif defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME)
p = buf.f_fstypename;
# endif
}
#elif defined(HAVE_FSTATFS) && (defined(HAVE_STRUCT_STATFS_F_FLAGS) || defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(__linux__))
struct statfs buf;
memset (statb, 0, sizeof (FcStatFS));
if ((ret = fstatfs (fd, &buf)) == 0)
{
# if defined(HAVE_STRUCT_STATFS_F_FLAGS) && defined(MNT_LOCAL)
statb->is_remote_fs = !(buf.f_flags & MNT_LOCAL);
flag = FcTrue;
# endif
# if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME)
p = buf.f_fstypename;
# elif defined(__linux__)
switch (buf.f_type)
{
case 0x6969: /* nfs */
statb->is_remote_fs = FcTrue;
break;
case 0x4d44: /* fat */
statb->is_mtime_broken = FcTrue;
break;
default:
break;
}
return ret;
# else
# error "BUG: No way to figure out with fstatfs()"
# endif
}
#endif
if (p)
{
if (!flag && strcmp (p, "nfs") == 0)
statb->is_remote_fs = FcTrue;
if (strcmp (p, "msdosfs") == 0 ||
strcmp (p, "pcfs") == 0)
statb->is_mtime_broken = FcTrue;
}
return ret;
}
FcBool
FcIsFsMmapSafe (int fd)
{
FcStatFS statb;
if (FcFStatFs (fd, &statb) < 0)
return FcTrue;
return !statb.is_remote_fs;
}
FcBool
FcIsFsMtimeBroken (const FcChar8 *dir)
{
int fd = FcOpen ((const char *) dir, O_RDONLY);
if (fd != -1)
{
FcStatFS statb;
int ret = FcFStatFs (fd, &statb);
close (fd);
if (ret < 0)
return FcFalse;
return statb.is_mtime_broken;
}
return FcFalse;
}

View File

@@ -0,0 +1,9 @@
#ifndef _FONTCONFIG_SRC_FCSTDINT_H
#define _FONTCONFIG_SRC_FCSTDINT_H 1
#ifndef _GENERATED_STDINT_H
#define _GENERATED_STDINT_H "fontconfig 2.11.0"
/* generated using gnu compiler gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 */
#define _STDINT_HAVE_STDINT_H 1
#include <stdint.h>
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,44 @@
/*
* fontconfig/src/fcwindows.h
*
* Copyright © 2013 Google, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* Google Author(s): Behdad Esfahbod
*/
#ifndef _FCWINDOWS_H_
#define _FCWINDOWS_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef _WIN32
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
# endif
# define WIN32_LEAN_AND_MEAN
# define WIN32_EXTRA_LEAN
# define STRICT
# include <windows.h>
#endif
#endif /* _FCWINDOWS_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,261 @@
/* ftglue.c: Glue code for compiling the OpenType code from
* FreeType 1 using only the public API of FreeType 2
*
* By David Turner, The FreeType Project (www.freetype.org)
*
* This code is explicitely put in the public domain
*
* See ftglue.h for more information.
*/
#include "ftglue.h"
#if 0
#include <stdio.h>
#define LOG(x) ftglue_log x
static void
ftglue_log( const char* format, ... )
{
va_list ap;
va_start( ap, format );
vfprintf( stderr, format, ap );
va_end( ap );
}
#else
#define LOG(x) do {} while (0)
#endif
/* only used internally */
static FT_Pointer
ftglue_qalloc( FT_Memory memory,
FT_ULong size,
FT_Error *perror )
{
FT_Error error = 0;
FT_Pointer block = NULL;
if ( size > 0 )
{
block = memory->alloc( memory, size );
if ( !block )
error = FT_Err_Out_Of_Memory;
}
*perror = error;
return block;
}
#undef QALLOC /* just in case */
#define QALLOC(ptr,size) ( (ptr) = ftglue_qalloc( memory, (size), &error ), error != 0 )
#define FREE(_ptr) \
do { \
if ( (_ptr) ) \
{ \
ftglue_free( memory, _ptr ); \
_ptr = NULL; \
} \
} while (0)
static void
ftglue_free( FT_Memory memory,
FT_Pointer block )
{
if ( block )
memory->free( memory, block );
}
FTGLUE_APIDEF( FT_Long )
ftglue_stream_pos( FT_Stream stream )
{
LOG(( "ftglue:stream:pos() -> %ld\n", stream->pos ));
return stream->pos;
}
FTGLUE_APIDEF( FT_Error )
ftglue_stream_seek( FT_Stream stream,
FT_Long pos )
{
FT_Error error = 0;
if ( stream->read )
{
if ( stream->read( stream, pos, 0, 0 ) )
error = FT_Err_Invalid_Stream_Operation;
}
else if ( pos < 0 || (FT_ULong) pos > stream->size )
error = FT_Err_Invalid_Stream_Operation;
if ( !error )
stream->pos = pos;
LOG(( "ftglue:stream:seek(%ld) -> %d\n", pos, error ));
return error;
}
FTGLUE_APIDEF( FT_Error )
ftglue_stream_frame_enter( FT_Stream stream,
FT_ULong count )
{
FT_Error error = FT_Err_Ok;
FT_ULong read_bytes;
if ( stream->read )
{
/* allocate the frame in memory */
FT_Memory memory = stream->memory;
if ( QALLOC( stream->base, count ) )
goto Exit;
/* read it */
read_bytes = stream->read( stream, stream->pos,
stream->base, count );
if ( read_bytes < count )
{
FREE( stream->base );
error = FT_Err_Invalid_Stream_Operation;
}
stream->cursor = stream->base;
stream->limit = stream->cursor + count;
stream->pos += read_bytes;
}
else
{
/* check current and new position */
if ( stream->pos >= stream->size ||
stream->pos + count > stream->size )
{
error = FT_Err_Invalid_Stream_Operation;
goto Exit;
}
/* set cursor */
stream->cursor = stream->base + stream->pos;
stream->limit = stream->cursor + count;
stream->pos += count;
}
Exit:
LOG(( "ftglue:stream:frame_enter(%ld) -> %d\n", count, error ));
return error;
}
FTGLUE_APIDEF( void )
ftglue_stream_frame_exit( FT_Stream stream )
{
if ( stream->read )
{
FT_Memory memory = stream->memory;
FREE( stream->base );
}
stream->cursor = 0;
stream->limit = 0;
LOG(( "ftglue:stream:frame_exit()\n" ));
}
FTGLUE_APIDEF( FT_Error )
ftglue_face_goto_table( FT_Face face,
FT_ULong the_tag,
FT_Stream stream )
{
FT_Error error;
LOG(( "ftglue_face_goto_table( %p, %c%c%c%c, %p )\n",
face,
(int)((the_tag >> 24) & 0xFF),
(int)((the_tag >> 16) & 0xFF),
(int)((the_tag >> 8) & 0xFF),
(int)(the_tag & 0xFF),
stream ));
if ( !FT_IS_SFNT(face) )
{
LOG(( "not a SFNT face !!\n" ));
error = FT_Err_Invalid_Face_Handle;
}
else
{
/* parse the directory table directly, without using
* FreeType's built-in data structures
*/
FT_ULong offset = 0, sig;
FT_UInt count, nn;
if ( FILE_Seek( 0 ) || ACCESS_Frame( 4 ) )
goto Exit;
sig = GET_Tag4();
FORGET_Frame();
if ( sig == FT_MAKE_TAG( 't', 't', 'c', 'f' ) )
{
/* deal with TrueType collections */
LOG(( ">> This is a TrueType Collection\n" ));
if ( FILE_Seek( 12 + face->face_index*4 ) ||
ACCESS_Frame( 4 ) )
goto Exit;
offset = GET_ULong();
FORGET_Frame();
}
LOG(( "TrueType offset = %ld\n", offset ));
if ( FILE_Seek( offset+4 ) ||
ACCESS_Frame( 2 ) )
goto Exit;
count = GET_UShort();
FORGET_Frame();
if ( FILE_Seek( offset+12 ) ||
ACCESS_Frame( count*16 ) )
goto Exit;
for ( nn = 0; nn < count; nn++ )
{
FT_ULong tag = GET_ULong();
FT_ULong checksum = GET_ULong();
FT_ULong start = GET_ULong();
FT_ULong size = GET_ULong();
FT_UNUSED(checksum);
FT_UNUSED(size);
if ( tag == the_tag )
{
LOG(( "TrueType table (start: %ld) (size: %ld)\n", start, size ));
error = ftglue_stream_seek( stream, start );
goto FoundIt;
}
}
error = FT_Err_Table_Missing;
FoundIt:
FORGET_Frame();
}
Exit:
LOG(( "TrueType error=%d\n", error ));
return error;
}
#undef QALLOC
#include "fcaliastail.h"
#undef __ftglue__

View File

@@ -0,0 +1,111 @@
/* ftglue.c: Glue code for compiling the OpenType code from
* FreeType 1 using only the public API of FreeType 2
*
* By David Turner, The FreeType Project (www.freetype.org)
*
* This code is explicitely put in the public domain
*
* ==========================================================================
*
* the OpenType parser codes was originally written as an extension to
* FreeType 1.x. As such, its source code was embedded within the library,
* and used many internal FreeType functions to deal with memory and
* stream i/o.
*
* When it was 'salvaged' for Pango and Qt, the code was "ported" to FreeType 2,
* which basically means that some macro tricks were performed in order to
* directly access FT2 _internal_ functions.
*
* these functions were never part of FT2 public API, and _did_ change between
* various releases. This created chaos for many users: when they upgraded the
* FreeType library on their system, they couldn't run Gnome anymore since
* Pango refused to link.
*
* Very fortunately, it's possible to completely avoid this problem because
* the FT_StreamRec and FT_MemoryRec structure types, which describe how
* memory and stream implementations interface with the rest of the font
* library, have always been part of the public API, and never changed.
*
* What we do thus is re-implement, within the OpenType parser, the few
* functions that depend on them. This only adds one or two kilobytes of
* code, and ensures that the parser can work with _any_ version
* of FreeType installed on your system. How sweet... !
*
* Note that we assume that Pango doesn't use any other internal functions
* from FreeType. It used to in old versions, but this should no longer
* be the case. (crossing my fingers).
*
* - David Turner
* - The FreeType Project (www.freetype.org)
*
* PS: This "glue" code is explicitely put in the public domain
*/
#ifndef __OPENTYPE_FTGLUE_H__
#define __OPENTYPE_FTGLUE_H__
#include "fcint.h"
#include <ft2build.h>
#include FT_FREETYPE_H
FT_BEGIN_HEADER
#define SET_ERR(c) ( (error = (c)) != 0 )
#ifndef FTGLUE_API
#define FTGLUE_API(x) extern FcPrivate x
#endif
#ifndef FTGLUE_APIDEF
#define FTGLUE_APIDEF(x) x
#endif
/* stream macros used by the OpenType parser */
#define FILE_Pos() ftglue_stream_pos( stream )
#define FILE_Seek(pos) SET_ERR( ftglue_stream_seek( stream, pos ) )
#define ACCESS_Frame(size) SET_ERR( ftglue_stream_frame_enter( stream, size ) )
#define FORGET_Frame() ftglue_stream_frame_exit( stream )
#define GET_Byte() (*stream->cursor++)
#define GET_Short() (stream->cursor += 2, (FT_Short)( \
(*(((FT_Byte*)stream->cursor)-2) << 8) | \
*(((FT_Byte*)stream->cursor)-1) \
))
#define GET_Long() (stream->cursor += 4, (FT_Long)( \
(*(((FT_Byte*)stream->cursor)-4) << 24) | \
(*(((FT_Byte*)stream->cursor)-3) << 16) | \
(*(((FT_Byte*)stream->cursor)-2) << 8) | \
*(((FT_Byte*)stream->cursor)-1) \
))
#define GET_Char() ((FT_Char)GET_Byte())
#define GET_UShort() ((FT_UShort)GET_Short())
#define GET_ULong() ((FT_ULong)GET_Long())
#define GET_Tag4() GET_ULong()
#define FT_SET_ERROR( expression ) \
( ( error = (expression) ) != 0 )
FTGLUE_API( FT_Long )
ftglue_stream_pos( FT_Stream stream );
FTGLUE_API( FT_Error )
ftglue_stream_seek( FT_Stream stream,
FT_Long pos );
FTGLUE_API( FT_Error )
ftglue_stream_frame_enter( FT_Stream stream,
FT_ULong size );
FTGLUE_API( void )
ftglue_stream_frame_exit( FT_Stream stream );
FTGLUE_API( FT_Error )
ftglue_face_goto_table( FT_Face face,
FT_ULong tag,
FT_Stream stream );
FT_END_HEADER
#endif /* __OPENTYPE_FTGLUE_H__ */