Module Name:    xsrc
Committed By:   mrg
Date:           Sat Jul 12 04:11:34 UTC 2014

Modified Files:
        xsrc/external/mit/fontconfig/dist/fc-cache: fc-cache.c
        xsrc/external/mit/fontconfig/dist/src: fccache.c fcint.h fcmatch.c
            fcname.c fcstat.c
Added Files:
        xsrc/external/mit/fontconfig/dist/doc: FcLangSetGetLangs.3
        xsrc/external/mit/fontconfig/dist/doc/fontconfig-devel:
            fclangsetgetlangs.html

Log Message:
merge fontconfig-2.11.1


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 \
    xsrc/external/mit/fontconfig/dist/doc/FcLangSetGetLangs.3
cvs rdiff -u -r0 -r1.3 \
    
xsrc/external/mit/fontconfig/dist/doc/fontconfig-devel/fclangsetgetlangs.html
cvs rdiff -u -r1.5 -r1.6 \
    xsrc/external/mit/fontconfig/dist/fc-cache/fc-cache.c
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/fontconfig/dist/src/fccache.c
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/fontconfig/dist/src/fcint.h \
    xsrc/external/mit/fontconfig/dist/src/fcmatch.c \
    xsrc/external/mit/fontconfig/dist/src/fcname.c
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/fontconfig/dist/src/fcstat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/fontconfig/dist/fc-cache/fc-cache.c
diff -u xsrc/external/mit/fontconfig/dist/fc-cache/fc-cache.c:1.5 xsrc/external/mit/fontconfig/dist/fc-cache/fc-cache.c:1.6
--- xsrc/external/mit/fontconfig/dist/fc-cache/fc-cache.c:1.5	Thu Mar 20 07:49:26 2014
+++ xsrc/external/mit/fontconfig/dist/fc-cache/fc-cache.c	Sat Jul 12 04:11:34 2014
@@ -68,7 +68,7 @@ const struct option longopts[] = {
     {"force", 0, 0, 'f'},
     {"quick", 0, 0, 'q'},
     {"really-force", 0, 0, 'r'},
-    {"sysroot", 0, 0, 'y'},
+    {"sysroot", required_argument, 0, 'y'},
     {"system-only", 0, 0, 's'},
     {"version", 0, 0, 'V'},
     {"verbose", 0, 0, 'v'},
@@ -121,7 +121,7 @@ usage (char *program, int error)
 static FcStrSet *processed_dirs;
 
 static int
-scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, FcBool verbose, FcBool recursive, int *changed)
+scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, FcBool verbose, FcBool recursive, int *changed, FcStrSet *updateDirs)
 {
     int		    ret = 0;
     const FcChar8   *dir;
@@ -140,7 +140,10 @@ scanDirs (FcStrList *list, FcConfig *con
     {
 	if (verbose)
 	{
-	    printf ("%s: ", dir);
+	    if (!recursive)
+		printf ("Re-scanning %s: ", dir);
+	    else
+		printf ("%s: ", dir);
 	    fflush (stdout);
 	}
 	
@@ -187,8 +190,13 @@ scanDirs (FcStrList *list, FcConfig *con
 	
 	if (!cache)
 	{
-	    (*changed)++;
-	    cache = FcDirCacheRead (dir, FcTrue, config);
+	    if (!recursive)
+		cache = FcDirCacheRescan (dir, config);
+	    else
+	    {
+		(*changed)++;
+		cache = FcDirCacheRead (dir, FcTrue, config);
+	    }
 	    if (!cache)
 	    {
 		fprintf (stderr, "%s: error scanning\n", dir);
@@ -229,6 +237,8 @@ scanDirs (FcStrList *list, FcConfig *con
 	    }
 	    for (i = 0; i < FcCacheNumSubdir (cache); i++)
 		FcStrSetAdd (subdirs, FcCacheSubdir (cache, i));
+	    if (updateDirs && FcCacheNumSubdir (cache) > 0)
+		FcStrSetAdd (updateDirs, dir);
 	
 	    FcDirCacheUnload (cache);
 	
@@ -241,7 +251,7 @@ scanDirs (FcStrList *list, FcConfig *con
 		continue;
 	    }
 	    FcStrSetAdd (processed_dirs, dir);
-	    ret += scanDirs (sublist, config, force, really_force, verbose, recursive, changed);
+	    ret += scanDirs (sublist, config, force, really_force, verbose, recursive, changed, updateDirs);
 	    FcStrListDone (sublist);
 	}
 	else
@@ -274,7 +284,7 @@ cleanCacheDirectories (FcConfig *config,
 int
 main (int argc, char **argv)
 {
-    FcStrSet	*dirs;
+    FcStrSet	*dirs, *updateDirs;
     FcStrList	*list;
     FcBool    	verbose = FcFalse;
     FcBool      quick = FcFalse;
@@ -376,13 +386,19 @@ main (int argc, char **argv)
 	fprintf(stderr, "Cannot malloc\n");
 	return 1;
     }
-	
+
+    updateDirs = FcStrSetCreate ();
     changed = 0;
-    ret = scanDirs (list, config, force, really_force, verbose, FcTrue, &changed);
+    ret = scanDirs (list, config, force, really_force, verbose, FcTrue, &changed, updateDirs);
     /* Update the directory cache again to avoid the race condition as much as possible */
-    FcStrListFirst (list);
-    ret += scanDirs (list, config, FcTrue, really_force, verbose, FcFalse, &changed);
     FcStrListDone (list);
+    list = FcStrListCreate (updateDirs);
+    if (list)
+    {
+	ret += scanDirs (list, config, FcTrue, really_force, verbose, FcFalse, &changed, NULL);
+	FcStrListDone (list);
+    }
+    FcStrSetDestroy (updateDirs);
 
     /*
      * Try to create CACHEDIR.TAG anyway.

Index: xsrc/external/mit/fontconfig/dist/src/fccache.c
diff -u xsrc/external/mit/fontconfig/dist/src/fccache.c:1.5 xsrc/external/mit/fontconfig/dist/src/fccache.c:1.6
--- xsrc/external/mit/fontconfig/dist/src/fccache.c:1.5	Thu Mar 20 07:49:26 2014
+++ xsrc/external/mit/fontconfig/dist/src/fccache.c	Sat Jul 12 04:11:34 2014
@@ -28,6 +28,7 @@
 #include <dirent.h>
 #include <string.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <assert.h>
 #if defined(HAVE_MMAP) || defined(__CYGWIN__)
 #  include <unistd.h>
@@ -572,7 +573,7 @@ FcDirCacheMapFd (int fd, struct stat *fd
     {
 #if defined(HAVE_MMAP) || defined(__CYGWIN__)
 	cache = mmap (0, fd_stat->st_size, PROT_READ, MAP_SHARED, fd, 0);
-#ifdef HAVE_POSIX_FADVISE
+#if (HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED)
 	posix_fadvise (fd, 0, fd_stat->st_size, POSIX_FADV_WILLNEED);
 #endif
 	if (cache == MAP_FAILED)
@@ -827,6 +828,19 @@ bail1:
     return NULL;
 }
 
+FcCache *
+FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs)
+{
+    FcCache *new;
+    FcFontSet *set = FcFontSetDeserialize (FcCacheSet (cache));
+    const FcChar8 *dir = FcCacheDir (cache);
+
+    new = FcDirCacheBuild (set, dir, dir_stat, dirs);
+    FcFontSetDestroy (set);
+
+    return new;
+}
+
 /* write serialized state to the cache file */
 FcBool
 FcDirCacheWrite (FcCache *cache, FcConfig *config)

Index: xsrc/external/mit/fontconfig/dist/src/fcint.h
diff -u xsrc/external/mit/fontconfig/dist/src/fcint.h:1.6 xsrc/external/mit/fontconfig/dist/src/fcint.h:1.7
--- xsrc/external/mit/fontconfig/dist/src/fcint.h:1.6	Thu Mar 20 07:49:26 2014
+++ xsrc/external/mit/fontconfig/dist/src/fcint.h	Sat Jul 12 04:11:34 2014
@@ -567,6 +567,9 @@ FcDirCacheScan (const FcChar8 *dir, FcCo
 FcPrivate FcCache *
 FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs);
 
+FcPrivate FcCache *
+FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs);
+
 FcPrivate FcBool
 FcDirCacheWrite (FcCache *cache, FcConfig *config);
 
@@ -838,6 +841,9 @@ FcFontSetSerializeAlloc (FcSerialize *se
 FcPrivate FcFontSet *
 FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
 
+FcPrivate FcFontSet *
+FcFontSetDeserialize (const FcFontSet *set);
+
 /* fchash.c */
 FcPrivate FcChar8 *
 FcHashGetSHA256Digest (const FcChar8 *input_strings,
Index: xsrc/external/mit/fontconfig/dist/src/fcmatch.c
diff -u xsrc/external/mit/fontconfig/dist/src/fcmatch.c:1.6 xsrc/external/mit/fontconfig/dist/src/fcmatch.c:1.7
--- xsrc/external/mit/fontconfig/dist/src/fcmatch.c:1.6	Thu Mar 20 07:49:26 2014
+++ xsrc/external/mit/fontconfig/dist/src/fcmatch.c	Sat Jul 12 04:11:34 2014
@@ -745,6 +745,7 @@ FcSortWalk (FcSortNode **n, int nnode, F
 {
     FcBool ret = FcFalse;
     FcCharSet *cs;
+    int i;
 
     cs = 0;
     if (trim || csp)
@@ -754,7 +755,7 @@ FcSortWalk (FcSortNode **n, int nnode, F
 	    goto bail;
     }
 
-    while (nnode--)
+    for (i = 0; i < nnode; i++)
     {
 	FcSortNode	*node = *n++;
 	FcBool		adds_chars = FcFalse;
@@ -778,7 +779,7 @@ FcSortWalk (FcSortNode **n, int nnode, F
 	 * If this font isn't a subset of the previous fonts,
 	 * add it to the list
 	 */
-	if (!trim || adds_chars)
+	if (!i || !trim || adds_chars)
 	{
 	    FcPatternReference (node->pattern);
 	    if (FcDebug () & FC_DBG_MATCHV)
Index: xsrc/external/mit/fontconfig/dist/src/fcname.c
diff -u xsrc/external/mit/fontconfig/dist/src/fcname.c:1.6 xsrc/external/mit/fontconfig/dist/src/fcname.c:1.7
--- xsrc/external/mit/fontconfig/dist/src/fcname.c:1.6	Thu Mar 20 07:49:26 2014
+++ xsrc/external/mit/fontconfig/dist/src/fcname.c	Sat Jul 12 04:11:34 2014
@@ -420,6 +420,8 @@ FcNameParse (const FcChar8 *name)
 		if ((c = FcNameGetConstant (save)))
 		{
 		    t = FcNameGetObjectType ((char *) c->object);
+		    if (t == NULL)
+			goto bail2;
 		    switch ((int) t->type) {
 		    case FcTypeInteger:
 		    case FcTypeDouble:

Index: xsrc/external/mit/fontconfig/dist/src/fcstat.c
diff -u xsrc/external/mit/fontconfig/dist/src/fcstat.c:1.4 xsrc/external/mit/fontconfig/dist/src/fcstat.c:1.5
--- xsrc/external/mit/fontconfig/dist/src/fcstat.c:1.4	Thu Mar 20 07:49:26 2014
+++ xsrc/external/mit/fontconfig/dist/src/fcstat.c	Sat Jul 12 04:11:34 2014
@@ -30,6 +30,9 @@
 #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
@@ -186,10 +189,8 @@ FcDirChecksum (const FcChar8 *dir, time_
     struct Adler32 ctx;
     struct dirent **files;
     int n;
-#ifndef HAVE_STRUCT_DIRENT_D_TYPE
     int ret = 0;
     size_t len = strlen ((const char *)dir);
-#endif
 
     Adler32Init (&ctx);
 
@@ -210,7 +211,9 @@ FcDirChecksum (const FcChar8 *dir, time_
 
 #ifdef HAVE_STRUCT_DIRENT_D_TYPE
 	dtype = files[n]->d_type;
-#else
+	if (dtype == DT_UNKNOWN)
+	{
+#endif
 	struct stat statb;
 	char f[PATH_MAX + 1];
 
@@ -227,20 +230,18 @@ FcDirChecksum (const FcChar8 *dir, time_
 	    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));
 
-#ifndef HAVE_STRUCT_DIRENT_D_TYPE
       bail:
-#endif
 	free (files[n]);
     }
     free (files);
-#ifndef HAVE_STRUCT_DIRENT_D_TYPE
     if (ret == -1)
 	return -1;
-#endif
 
     *checksum = Adler32Finish (&ctx);
 

Added files:

Index: xsrc/external/mit/fontconfig/dist/doc/FcLangSetGetLangs.3
diff -u /dev/null xsrc/external/mit/fontconfig/dist/doc/FcLangSetGetLangs.3:1.3
--- /dev/null	Sat Jul 12 04:11:34 2014
+++ xsrc/external/mit/fontconfig/dist/doc/FcLangSetGetLangs.3	Sat Jul 12 04:11:34 2014
@@ -0,0 +1,13 @@
+.\" auto-generated by docbook2man-spec from docbook-utils package
+.TH "FcLangSetGetLangs" "3" "24 3月 2014" "Fontconfig 2.11.1" ""
+.SH NAME
+FcLangSetGetLangs \- get the list of languages in the langset
+.SH SYNOPSIS
+.nf
+\fB#include <fontconfig/fontconfig.h>
+.sp
+FcStrSet * FcLangSetGetLangs (const FcLangSet *\fIls\fB);
+.fi\fR
+.SH "DESCRIPTION"
+.PP
+Returns a string set of all languages in \fIlangset\fR\&.

Index: xsrc/external/mit/fontconfig/dist/doc/fontconfig-devel/fclangsetgetlangs.html
diff -u /dev/null xsrc/external/mit/fontconfig/dist/doc/fontconfig-devel/fclangsetgetlangs.html:1.3
--- /dev/null	Sat Jul 12 04:11:34 2014
+++ xsrc/external/mit/fontconfig/dist/doc/fontconfig-devel/fclangsetgetlangs.html	Sat Jul 12 04:11:34 2014
@@ -0,0 +1,209 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd";>
+<HTML
+><HEAD
+><TITLE
+>FcLangSetGetLangs</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
+REL="HOME"
+HREF="t1.html"><LINK
+REL="UP"
+TITLE="FcLangSet"
+HREF="x102.html#AEN1988"><LINK
+REL="PREVIOUS"
+TITLE="FcGetDefaultLangs"
+HREF="fcgetdefaultlangs.html"><LINK
+REL="NEXT"
+TITLE="FcGetLangs"
+HREF="fcgetlangs.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+></TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="fcgetdefaultlangs.html"
+ACCESSKEY="P"
+>&#60;&#60;&#60; Previous</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="fcgetlangs.html"
+ACCESSKEY="N"
+>Next &#62;&#62;&#62;</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="FCLANGSETGETLANGS"
+></A
+>FcLangSetGetLangs</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2306"
+></A
+><H2
+>Name</H2
+>FcLangSetGetLangs&nbsp;--&nbsp;get the list of languages in the langset</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2309"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><P
+></P
+><A
+NAME="AEN2310"
+></A
+><TABLE
+BORDER="0"
+BGCOLOR="#E0E0E0"
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &#60;fontconfig/fontconfig.h&#62;
+	</PRE
+></TD
+></TR
+></TABLE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>FcStrSet * <TT
+CLASS="FUNCTION"
+>FcLangSetGetLangs</TT
+></CODE
+>(const FcLangSet *<TT
+CLASS="PARAMETER"
+><I
+>ls</I
+></TT
+>);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2317"
+></A
+><H2
+>Description</H2
+><P
+>Returns a string set of all languages in <TT
+CLASS="PARAMETER"
+><I
+>langset</I
+></TT
+>.
+	    </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="fcgetdefaultlangs.html"
+ACCESSKEY="P"
+>&#60;&#60;&#60; Previous</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="t1.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="fcgetlangs.html"
+ACCESSKEY="N"
+>Next &#62;&#62;&#62;</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>FcGetDefaultLangs</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="x102.html#AEN1988"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>FcGetLangs</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file

Reply via email to