doc/Makefile.am | 9 ++- doc/check-missing-doc | 23 ++++++++ doc/edit-sgml.c | 85 +++++++++++++++++++------------ doc/fccache.fncs | 68 +++++++++++++++++++++++++ doc/fccharset.fncs | 24 ++++++++ doc/fcconfig.fncs | 31 +++++++++++ doc/fcdircache.fncs | 88 ++++++++++++++++++++++++++++++++ doc/fcfile.fncs | 29 ++++++---- doc/fcfontset.fncs | 83 ++++++++++++++++++++++++++++++ doc/fcfreetype.fncs | 22 ++++++++ doc/fclangset.fncs | 124 ++++++++++++++++++++++++++++++++++++++++++++++ doc/fcmatrix.fncs | 2 doc/fcpattern.fncs | 52 ++++++++++++++++++- doc/fcstring.fncs | 93 +++++++++++++++++++++++++++------- doc/fcstrset.fncs | 11 ++++ doc/fcvalue.fncs | 21 +++++++ doc/fontconfig-devel.sgml | 26 +++++++++ fc-cache/fc-cache.c | 10 --- fontconfig/fontconfig.h | 24 ++++---- src/fccache.c | 3 + src/fccfg.c | 4 - src/fclang.c | 8 +- 22 files changed, 748 insertions(+), 92 deletions(-) New commits: commit 026fe895e487d0a9607a8506ab8be2ff6022ea19 Author: Keith Packard <keithp@xxxxxxxxxxxxxxx> Date: Sat Nov 3 22:31:16 2007 -0700 Update documentation for FcStrCopyFilename (bug 12964). FcStrCopyFilename constructs a canonical path for any argument, including expanding leading ~ and editing '.' and '..' elements out of the resulting path. diff --git a/doc/fcstring.fncs b/doc/fcstring.fncs index cea8981..8ee20e5 100644 --- a/doc/fcstring.fncs +++ b/doc/fcstring.fncs @@ -146,11 +146,16 @@ letters to lower case and returns the allocated buffer. @RET@ FcChar8 * @FUNC@ FcStrCopyFilename @TYPE1@ const FcChar8 * @ARG1@ s -@PURPOSE@ copy a string, expanding '~' -@DESC@ -Just like FcStrCopy except that it converts any leading '~' characters in -<parameter>s</parameter> to the value of the HOME environment variable. -Returns NULL if '~' is present in <parameter>s</parameter> and HOME is unset. +@PURPOSE@ create a complete path from a filename +@DESC@ +<function>FcStrCopyFilename</function> constructs an absolute pathname from +<parameter>s</parameter>. It converts any leading '~' characters in +to the value of the HOME environment variable, and any relative paths are +converted to absolute paths using the current working directory. Sequences +of '/' characters are converted to a single '/', and names containing the +current directory '.' or parent directory '..' are correctly reconstructed. +Returns NULL if '~' is the leading character and HOME is unset or disabled +(see <function>FcConfigEnableHome</function>). @@ @RET@ int commit a190678e3c4497870679808dde418191407be91d Author: Keith Packard <keithp@xxxxxxxxxxxxxxx> Date: Sat Nov 3 22:23:28 2007 -0700 Document previously undocumented functions. (bug 12963) diff --git a/doc/Makefile.am b/doc/Makefile.am index 7b40eb4..e5c922b 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -42,13 +42,16 @@ FNCS_TMPL = ${DOC_SRC}/func.sgml DOC_FUNCS_FNCS=\ fcatomic.fncs \ fcblanks.fncs \ + fccache.fncs \ fccharset.fncs \ fcconfig.fncs \ fcconstant.fncs \ + fcdircache.fncs \ fcfile.fncs \ fcfontset.fncs \ fcfreetype.fncs \ fcinit.fncs \ + fclangset.fncs \ fcmatrix.fncs \ fcobjectset.fncs \ fcobjecttype.fncs \ diff --git a/doc/check-missing-doc b/doc/check-missing-doc index 13d1eb9..3eef93a 100644 --- a/doc/check-missing-doc +++ b/doc/check-missing-doc @@ -1,7 +1,7 @@ #!/bin/sh header=fontconfig-header doc=fontconfig-doc -#trap "rm $header $doc" 0 1 15 +trap "rm $header $doc" 0 1 15 top_srcdir=${top_srcdir-".."} ( cat $top_srcdir/fontconfig/*.h | grep '^Fc' | @@ -10,7 +10,7 @@ cat $top_srcdir/fontconfig/*.h | grep '^Fc' | sed -n 's/#define \(Fc[a-zA-Z]*\)(.*$/\1/p') | sort -u > $header -grep '@FUNC@' $top_srcdir/doc/*.fncs | +grep '@FUNC[+]*@' $top_srcdir/doc/*.fncs | awk '{print $2}' | sort -u > $doc diff --git a/doc/fccache.fncs b/doc/fccache.fncs new file mode 100644 index 0000000..0a08632 --- /dev/null +++ b/doc/fccache.fncs @@ -0,0 +1,68 @@ +/* + * 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 Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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. + */ + +@RET@ const FcChar8 * +@FUNC@ FcCacheDir +@TYPE1@ const FcCache * @ARG1@ cache +@PURPOSE@ Return directory of <parameter>cache</parameter> +@DESC@ +This function returns the directory from which the cache was constructed. +@@ + +@RET@ FcFontSet * +@FUNC@ FcCacheCopySet +@TYPE1@ const FcCache * @ARG1@ cache +@PURPOSE@ Returns a copy of the fontset from <parameter>cache</parameter> +@DESC +The returned fontset contains each of the font patterns from +<parameter>cache</parameter>. This fontset may be modified, but the patterns +from the cache are read-only. +@@ + +@RET@ const FcChar8 * +@FUNC@ FcCacheSubdir +@TYPE1@ const FcCache * @ARG1@ cache +@TYPE2@ int @ARG2@ i +@PURPOSE@ Return the <parameter>i</parameter>'th subdirectory. +@DESC +The set of subdirectories stored in a cache file are indexed by this +function, <parameter>i</parameter> should range from 0 to +<parameter>n</parameter>-1, where <parameter>n</parameter> is the return +value from FcCacheNumSubdir. +@@ + +@RET@ int +@FUNC@ FcCacheNumSubdir +@TYPE1@ const FcCache * @ARG1@ cache +@PURPOSE@ Return the number of subdirectories in <parameter>cache</parameter>. +@DESC +This returns the total number of subdirectories in the cache. +@@ + +@RET@ int +@FUNC@ FcCacheNumFont +@TYPE1@ const FcCache * @ARG1@ cache +@PURPOSE@ Returns the number of fonts in <parameter>cache</parameter>. +@DESC +This returns the number of fonts which would be included in the return from +FcCacheCopySet. +@@ diff --git a/doc/fccharset.fncs b/doc/fccharset.fncs index cb07680..f4e81a7 100644 --- a/doc/fccharset.fncs +++ b/doc/fccharset.fncs @@ -165,3 +165,27 @@ Builds an array of bits marking the Unicode coverage of <parameter>a</parameter> <parameter>*next</parameter>. Returns the base of the array. <parameter>next</parameter> contains the next page in the font. @@ + +@RET@ FcChar32 +@FUNC@ FcCharSetCoverage +@TYPE1@ const FcCharSet * @ARG1@ a +@TYPE2@ FcChar32 @ARG2@ page +@TYPE3@ FcChar32[8] @ARG3@ result +@PURPOSE@ DEPRECATED return coverage for a Unicode page +@DESC@ +DEPRECATED +This function returns a bitmask in <parameter>result</parameter> which +indicates which code points in +<parameter>page</parameter> are included in <parameter>a</parameter>. +<function>FcCharSetCoverage</function> returns the next page in the charset which has any +coverage. +@@ + +@RET@ FcCharSet * +@FUNC@ FcCharSetNew +@TYPE1@ void +@PURPOSE@ DEPRECATED alias for FcCharSetCreate +@DESC@ +<function>FcCharSetNew</function> is a DEPRECATED alias for FcCharSetCreate. +@@ + diff --git a/doc/fcconfig.fncs b/doc/fcconfig.fncs index d252d60..998974f 100644 --- a/doc/fcconfig.fncs +++ b/doc/fcconfig.fncs @@ -65,6 +65,27 @@ Checks all of the files related to <parameter>config</parameter> and returns whether any of them has been modified since the configuration was created. @@ +@RET@ FcBool +@FUNC@ FcConfigHome +@TYPE1@ void +@PURPOSE@ return the current home directory. +@DESC@ +Return the current user's home directory, if it is available, and if using it +is enabled. See also <function>FcConfigEnableHome</function>). +@@ + +@RET@ FcBol +@FUNC@ FcConfigEnableHome +@TYPE1@ FcBool% @ARG1@ enable +@PURPOSE@ controls use of the home directory. +@DESC@ +If <parameter>enable</parameter> is FcTrue, then Fontconfig will use various +files which are specified relative to the user's home directory (using the ~ +notation in the configuration). When <parameter>enable</parameter> is +FcFalse, then all use of the home directory in these contexts will be +disabled. The previous setting of the value is returned. +@@ + @RET@ FcBool @FUNC@ FcConfigBuildFonts @TYPE1@ FcConfig * @ARG1@ config @@ -111,6 +132,16 @@ Note that this will not include any configuration done with FcConfigParse. Returns the name of the file used to store per-user font information. @@ +@RET@ FcStrList * +@FUNC@ FcConfigGetCacheDirs +@TYPE1@ FcConfig * @ARG1@ config +@PURPOSE@ return the list of directories searched for cache files +@DESC@ +<function>FcConfigGetCacheDirs</function> returns a string list containing +all of the directories that fontconfig will search when attempting to load a +cache file for a font directory. +@@ + @RET@ FcFontSet * @FUNC@ FcConfigGetFonts @TYPE1@ FcConfig * @ARG1@ config diff --git a/doc/fcdircache.fncs b/doc/fcdircache.fncs new file mode 100644 index 0000000..24dea8b --- /dev/null +++ b/doc/fcdircache.fncs @@ -0,0 +1,88 @@ +/* + * 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. + */ + +@RET@ FcBool +@FUNC@ FcDirCacheUnlink +@TYPE1@ const FcChar8 * @ARG1@ dir +@TYPE2@ FcConfig * @ARG2@ config +@PURPOSE@ Remove all caches related to <parameter>dir</parameter> +@DESC@ +Scans the cache directories in <parameter>config</parameter>, removing any +instances of the cache file for <parameter>dir</parameter>. Returns FcFalse +when some internal error occurs (out of memory, etc). Errors actually +unlinking any files are ignored. +@@ + +@RET@ FcBool +@FUNC@ FcDirCacheValid +@TYPE1@ const FcChar8 * @ARG1@ dir +@PURPOSE@ check directory cache +@DESC@ +Returns FcTrue if <parameter>dir</parameter> has an associated valid cache +file, else returns FcFalse +@@ + +@RET@ FcCache * +@FUNC@ FcDirCacheLoad +@TYPE1@ const FcChar8 * @ARG1@ dir +@TYPE2@ FcConfig * @ARG2@ config +@TYPE3@ FcChar8 ** @ARG3@ cache_file +@PURPOSE@ load a directory cache +@DESC@ +Loads the cache related to <parameter>dir</parameter>. If no cache file +exists, returns NULL. The name of the cache file is returned in +<parameter>cache_file</parameter>, unless that is NULL. See also +FcDirCacheRead. +@@ + +@RET@ FcCache * +@FUNC@ FcDirCacheRead +@TYPE1@ const FcChar8 * @ARG1@ dir +@TYPE2@ FcBool% @ARG2@ force +@TYPE3@ FcConfig * @ARG3@ config +@PURPOSE@ read or construct a directory cache +@DESC@ +This returns a cache for <parameter>dir</parameter>. If +<parameter>force</parameter> is FcFalse, then an existing, valid cache file +will be used. Otherwise, a new cache will be created by scanning the +directory and that returned. +@@ + +@RET@ FcCache * +@FUNC@ FcDirCacheLoadFile +@TYPE1@ const FcChar8 * @ARG1@ cache_file +@TYPE2@ struct stat * @ARG2@ file_stat +@PURPOSE@ load a cache file +@DESC@ +This function loads a directory cache from +<parameter>cache_file</parameter>. If <parameter>file_stat</parameter> is +non-NULL, it will be filled with the results of stat(2) on the cache file. +@@ + +@RET@ void +@FUNC@ FcDirCacheUnload +@TYPE1@ FcCache * @ARG1@ cache +@PURPOSE@ unload a cache file +@DESC@ +This function dereferences <parameter>cache</parameter>. When no other +references to it remain, all memory associated with the cache will be freed. +@@ diff --git a/doc/fcfile.fncs b/doc/fcfile.fncs index df7400b..98b8f81 100644 --- a/doc/fcfile.fncs +++ b/doc/fcfile.fncs @@ -37,7 +37,20 @@ If <parameter>force</parameter> is FcTrue, then the file is scanned even if associated information is found in <parameter>cache</parameter>. If <parameter>file</parameter> is a directory, it is added to <parameter>dirs</parameter>. Whether fonts are found depends on fontconfig -poliy as well as the current configuration. +policy as well as the current configuration. Internally, fontconfig will +ignore BDF and PCF fonts which are not in Unicode (or the effectively +equivalent ISO Latin-1) encoding as those are not usable by Unicode-based +applications. The configuration can ignore fonts based on filename or +contents of the font file itself. +@@ + +@RET@ FcBool +@FUNC@ FcFileIsDir +@TYPE1@ const FcChar8 * @ARG1@ file +@PURPOSE@ check whether a file is a directory +@DESC@ +Returns FcTrue if <parameter>file</parameter> is a directory, otherwise +returns FcFalse. @@ @RET@ FcBool @@ -54,9 +67,9 @@ Scans an entire directory and adds all fonts found to <parameter>set</parameter>. If <parameter>force</parameter> is FcTrue, then the directory and all files within it are scanned even if information is present in the per-directory cache file or <parameter>cache</parameter>. Any -subdirectories found are added to <parameter>dirs</parameter>. Whether fonts -or directories are found depends on fontconfig -policy as well as the current configuration. +subdirectories found are added to <parameter>dirs</parameter>. See the +manual for <function>FcFileScan</function> for a description of how +fontconfig selects which fonts to include. @@ @RET@ FcBool @@ -71,11 +84,3 @@ populates it with the fonts in <parameter>set</parameter> and subdirectories in <parameter>dirs</parameter>. @@ -@RET@ FcBool -@FUNC@ FcDirCacheValid -@TYPE1@ const FcChar8 * @ARG1@ cache_file -@PURPOSE@ check directory cache timestamp -@DESC@ -Returns FcTrue if <parameter>cache_file</parameter> is no older than the -directory containing it, else FcFalse. -@@ diff --git a/doc/fcfontset.fncs b/doc/fcfontset.fncs index 9c739c6..bcf4bd3 100644 --- a/doc/fcfontset.fncs +++ b/doc/fcfontset.fncs @@ -47,3 +47,86 @@ well. Adds a pattern to a font set. Note that the pattern is not copied before being inserted into the set. @@ + +@RET@ FcFontSet * +@FUNC@ FcFontSetList +@TYPE1@ FcConfig * @ARG1@ config +@TYPE2@ FcFontSet ** @ARG2@ sets +@TYPE3@ int @ARG3@ nsets +@TYPE4@ FcPattern * @ARG4@ pattern +@TYPE5@ FcObjectSet * @ARG5@ object_set +@PURPOSE@ List fonts from a set of font sets +@DESC@ +Selects fonts matching <parameter>pattern</parameter> from +<parameter>sets</parameter>, creates patterns from those +fonts containing only the objects in <parameter>object_set</parameter> and returns +the set of unique such patterns. +@@ + +@RET@ FcPattern * +@FUNC@ FcFontSetMatch +@TYPE1@ FcConfig * @ARG1@ config +@TYPE2@ FcFontSet ** @ARG2@ sets +@TYPE3@ int @ARG3@ nsets +@TYPE4@ FcPattern * @ARG4@ pattern +@TYPE5@ FcResult * @ARG5@ result +@PURPOSE@ Return the best font from a set of font sets +@DESC@ +Returns the font in <parameter>sets</parameter> most close matching +<parameter>pattern</parameter>. This function should be called only after +FcConfigSubstitute and FcDefaultSubstitute have been called for +<parameter>pattern</parameter>; otherwise the results will not be correct. +@@ + +@RET@ void +@FUNC@ FcFontSetPrint +@TYPE1@ FcFontSet * @ARG1@ set +@PURPOSE@ Print a set of patterns to stdout +@DESC@ +This function is useful for diagnosing font related issues, printing the +complete contents of every pattern in <parameter>set</parameter>. The format +of the output is designed to be of help to users and developers, and may +change at any time. +@@ + +@RET@ +@FUNC@ FcFontSetSort +@TYPE1@ FcConfig * @ARG1@ config +@TYPE2@ FcFontSet ** @ARG2@ sets +@TYPE3@ int @ARG3@ nsets +@TYPE4@ FcPattern * @ARG4@ pattern +@TYPE5@ FcBool% @ARG5@ trim +@TYPE6@ FcCharSet ** @ARG6@ csp +@TYPE7@ FcResult * @ARG7@ result +@PURPOSE@ Add to a font set +@DESC@ +Returns the list of fonts from <parameter>sets</parameter> +sorted by closeness to <parameter>pattern</parameter>. +If <parameter>trim</parameter> is FcTrue, +elements in the list which don't include Unicode coverage not provided by +earlier elements in the list are elided. The union of Unicode coverage of +all of the fonts is returned in <parameter>csp</parameter>, +if <parameter>csp</parameter> is not NULL. This function +should be called only after FcConfigSubstitute and FcDefaultSubstitute have +been called for <parameter>p</parameter>; +otherwise the results will not be correct. + </para><para> +The returned FcFontSet references FcPattern structures which may be shared +by the return value from multiple FcFontSort calls, applications cannot +modify these patterns. Instead, they should be passed, along with +<parameter>pattern</parameter> to +FcFontRenderPrepare which combines them into a complete pattern. + </para><para> +The FcFontSet returned by FcFontSetSort is destroyed by caling FcFontSetDestroy. +@@ + +@RET@ +@FUNC@ FcFontSetSortDestroy +@TYPE1@ FcFontSet * @ARG1@ set +@PURPOSE@ DEPRECATED destroy a font set +@DESC@ +This function is DEPRECATED. <function>FcFontSetSortDestroy</function> +destroys <parameter>set</parameter> by calling +<function>FcFontSetDestroy</function>. Applications should use +<function>FcFontSetDestroy</function> directly instead. +@@ diff --git a/doc/fcfreetype.fncs b/doc/fcfreetype.fncs index 6ecedda..935eacf 100644 --- a/doc/fcfreetype.fncs +++ b/doc/fcfreetype.fncs @@ -56,6 +56,28 @@ not in 'blanks' are not placed in the returned FcCharSet. @SYNOPSIS@ #include <fontconfig.h> #include <fcfreetype.h> +@RET@ FcCharSet * +@FUNC@ FcFreeTypeCharSetAndSpacing +@TYPE1@ FT_Face% @ARG1@ face +@TYPE2@ FcBlanks * @ARG2@ blanks +@TYPE3@ int * @ARG3@ spacing +@PURPOSE@ compute unicode coverage and spacing type +@DESC@ +Scans a FreeType face and returns the set of encoded Unicode chars. +This scans +several encoding tables to build as complete a list as possible. +If 'blanks' is not 0, the glyphs in the font are examined and any blank glyphs +not in 'blanks' are not placed in the returned FcCharSet. +<parameter>spacing</parameter> receives the computed spacing type of the +font, one of FC_MONO for a font where all glyphs have the same width, +FC_DUAL, where the font has glyphs in precisely two widths, one twice as +wide as the other, or FC_PROPORTIONAL where the font has glyphs of many +widths. +@@ + +@SYNOPSIS@ +#include <fontconfig.h> +#include <fcfreetype.h> @RET@ FcPattern * @FUNC@ FcFreeTypeQuery @TYPE1@ const char * @ARG1@ file diff --git a/doc/fclangset.fncs b/doc/fclangset.fncs new file mode 100644 index 0000000..eb4a937 --- /dev/null +++ b/doc/fclangset.fncs @@ -0,0 +1,124 @@ +/* + * 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. + */ + +@RET@ FcLangSet * +@FUNC@ FcLangSetCreate +@TYPE1@ void +@PURPOSE@ create a langset object +@DESC@ +<function>FcLangSetCreate</function> creates a new FcLangSet object. +@@ + +@RET@ void +@FUNC@ FcLangSetDestroy +@TYPE1@ FcLangSet * @ARG1@ ls +@PURPOSE@ destroy a langset object +@DESC@ +<function>FcLangSetDestroy</function> destroys a FcLangSet object, freeing +all memory associated with it. +@@ + +@RET@ FcLangSet * +@FUNC@ FcLangSetCopy +@TYPE1@ const FcLangSet * @ARG1@ ls +@PURPOSE@ copy a langset object +@DESC@ +<function>FcLangSetCopy</function> creates a new FcLangSet object and +populates it with the contents of <parameter>ls</parameter>. +@@ + +@RET@ FcBool +@FUNC@ FcLangSetAdd +@TYPE1@ FcLangSet * @ARG1@ ls +@TYPE2@ const FcChar8 * @ARG2@ lang +@PURPOSE@ add a language to a langset +@DESC@ +<parameter>lang</parameter> is added to <parameter>ls</parameter>. +<parameter>lang</parameter> should be of the form Ll-Tt where Ll is a +two or three letter language from ISO 639 and Tt is a territory from ISO +3166. +@@ + +@RET@ FcLangResult +@FUNC@ FcLangSetCompare +@TYPE1@ const FcLangSet * @ARG1@ ls_a +@TYPE2@ const FcLangSet * @ARG2@ ls_b +@PURPOSE@ compare language sets +@DESC@ +<function>FcLangSetCompare</function> compares language coverage for +<parameter>ls_a</parameter> and <parameter>ls_b</parameter>. If they share +any language and territory pair, this function returns FcLangEqual. If they +share a language but differ in which territory that language is for, this +function returns FcLangDiffentTerritory. If they share no languages in +common, this function returns FcLangDifferentLang. +@@ + +@RET@ FcBool +@FUNC@ FcLangSetContains +@TYPE1@ const FcLangSet * @ARG1@ ls_a +@TYPE2@ const FcLangSet * @ARG2@ ls_b +@PURPOSE@ check langset subset relation +@DESC@ +<function>FcLangSetContains</function> returns FcTrue if +<parameter>ls_a</parameter> contains every language in +<parameter>ls_b</parameter>. <parameter>ls_a</parameter> will 'contain' a +language from <parameter>ls_b</parameter> if <parameter>ls_a</parameter> +has exactly the language, or either the language or +<parameter>ls_a</parameter> has no territory. +@@ + +@RET@ FcBool +@FUNC@ FcLangSetEqual +@TYPE1@ const FcLangSet * @ARG1@ ls_a +@TYPE2@ const FcLangSet * @ARG2@ ls_b +@PURPOSE@ test for matching langsets +@DESC@ +Returns FcTrue if and only if <parameter>ls_a</parameter> supports precisely +the same language and territory combinations as <parameter>ls_b</parameter>. +@@ + +@RET@ FcChar32 +@FUNC@ FcLangSetHash +@TYPE1@ const FcLangSet * @ARG1@ ls +@PURPOSE@ return a hash value for a langset +@DESC@ +This function returns a value which depends solely on the languages +supported by <parameter>ls</parameter>. Any language which equals +<parameter>ls</function> will have the same result from +<function>FcLangSetHash</function>. However, two langsets with the same hash +value may not be equal. +@@ + +@RET@ FcLangResult +@FUNC@ FcLangSetHasLang +@TYPE1@ const FcLangSet * @ARG1@ ls +@TYPE2@ const FcChar8 * @ARG2@ lang +@PURPOSE@ test langset for language support +@DESC@ +<function>FcLangSetHasLang</function> checks whether +<parameter>ls</parameter> supports <parameter>lang</parameter>. If +<parameter>ls</parameter> has a matching language and territory pair, +this function returns FcLangEqual. If <parameter>ls</parameter> has +a matching language but differs in which territory that language is for, this +function returns FcLangDiffentTerritory. If <parameter>ls</parameter> +has no matching language, this function returns FcLangDifferentLang. +@@ diff --git a/doc/fcmatrix.fncs b/doc/fcmatrix.fncs index 2d48b1e..0159555 100644 --- a/doc/fcmatrix.fncs +++ b/doc/fcmatrix.fncs @@ -21,6 +21,8 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ + +@RET@ void @FUNC@ FcMatrixInit @PURPOSE@ initialize an FcMatrix structure @TYPE1@ FcMatrix * diff --git a/doc/fcpattern.fncs b/doc/fcpattern.fncs index c04d9b3..74f3675 100644 --- a/doc/fcpattern.fncs +++ b/doc/fcpattern.fncs @@ -29,12 +29,32 @@ Creates a pattern with no properties; used to build patterns from scratch. @@ +@RET@ FcPattern * +@FUNC@ FcPatternDuplicate +@TYPE1@ FcPattern * @ARG1@ p +@PURPOSE@ Copy a pattern +@DESC@ +Copy a pattern, returning a new pattern that matches +<parameter>p</parameter>. Each pattern may be modified without affecting the +other. +@@ + +@RET@ void +@FUNC@ FcPatternReference +@TYPE1@ FcPattern * @ARG1@ p +@PURPOSE@ Increment pattern reference count +@DESC@ +Add another reference to <parameter>p</parameter>. Patterns are freed only +when the reference count reaches zero. +@@ + @RET@ void @FUNC@ FcPatternDestroy @TYPE1@ FcPattern * @ARG1@ p @PURPOSE@ Destroy a pattern @DESC@ -Destroys a pattern, in the process destroying all related values. +Decrement the pattern reference count. If all references are gone, destroys +the pattern, in the process destroying all related values. @@ @RET@ FcBool @@ -134,6 +154,21 @@ values added to the list have binding <parameter>weak</parameter> instead of <pa @TYPE1+++++@ FcPattern * @ARG1+++++@ p @TYPE2+++++@ const char * @ARG2+++++@ object @TYPE3+++++@ FcBool% @ARG3+++++@ b + +@PROTOTYPE++++++@ +@RET++++++@ FcBool +@FUNC++++++@ FcPatternAddFTFace +@TYPE1++++++@ FcPattern * @ARG1++++++@ p +@TYPE2++++++@ const char * @ARG2++++++@ object +@TYPE3++++++@ const FT_Face @ARG3++++++@ f + +@PROTOTYPE+++++++@ +@RET+++++++@ FcBool +@FUNC+++++++@ FcPatternAddLangSet +@TYPE1+++++++@ FcPattern * @ARG1+++++++@ p +@TYPE2+++++++@ const char * @ARG2+++++++@ object +@TYPE3+++++++@ const FcLangSet * @ARG3+++++++@ l + @PURPOSE@ Add a typed value to a pattern @DESC@ These are all convenience functions that insert objects of the specified @@ -204,6 +239,21 @@ within the pattern directly. Applications must not free this value. @TYPE2+++++@ const char * @ARG2+++++@ object @TYPE3+++++@ int% @ARG3+++++@ n @TYPE4+++++@ FcBool * @ARG4+++++@ b + +@PROTOTYPE++++++@ +@RET++++++@ FcBool +@FUNC++++++@ FcPatternGetFTFace +@TYPE1++++++@ FcPattern * @ARG1++++++@ p +@TYPE2++++++@ const char * @ARG2++++++@ object +@TYPE3++++++@ const FT_Face * @ARG3++++++@ f + +@PROTOTYPE+++++++@ +@RET+++++++@ FcBool +@FUNC+++++++@ FcPatternGetLangSet +@TYPE1+++++++@ FcPattern * @ARG1+++++++@ p +@TYPE2+++++++@ const char * @ARG2+++++++@ object +@TYPE3+++++++@ const FcLangSet ** @ARG3+++++++@ l + @PURPOSE@ Return a typed value from a pattern @DESC@ These are convenience functions that call FcPatternGet and verify that the diff --git a/doc/fcstring.fncs b/doc/fcstring.fncs index bac5444..cea8981 100644 --- a/doc/fcstring.fncs +++ b/doc/fcstring.fncs @@ -97,6 +97,33 @@ indicates whether <parameter>string</parameter> is a well-formed UTF16 string. @@ +@RET@ FcBool +@FUNC@ FcIsLower +@TYPE1@ FcChar8 @ARG1@ c +@PURPOSE@ check for lower case ASCII character +@DESC@ +This macro checks whether <parameter>c</parameter> is an lower case ASCII +letter. +@@ + +@RET@ FcBool +@FUNC@ FcIsUpper +@TYPE1@ FcChar8 @ARG1@ c +@PURPOSE@ check for upper case ASCII character +@DESC@ +This macro checks whether <parameter>c</parameter> is a upper case ASCII +letter. +@@ + +@RET@ FcChar8 +@FUNC@ FcToLower +@TYPE1@ FcChar8 @ARG1@ c +@PURPOSE@ convert upper case ASCII to lower case +@DESC@ +This macro converts upper case ASCII <parameter>c</parameter> to the +equivalent lower case letter. +@@ + @RET@ FcChar8 * @FUNC@ FcStrCopy @TYPE1@ const FcChar8 * @ARG1@ s @@ -127,45 +154,70 @@ Returns NULL if '~' is present in <parameter>s</parameter> and HOME is unset. @@ @RET@ int +@FUNC@ FcStrCmp +@TYPE1@ const FcChar8 * @ARG1@ s1 +@TYPE2@ const FcChar8 * @ARG2@ s2 +@PURPOSE@ compare UTF-8 strings +@DESC@ +Returns the usual <0, 0, >0 result of comparing +<parameter>s1</parameter> and <parameter>s2</parameter>. +@@ + +@RET@ int @FUNC@ FcStrCmpIgnoreCase @TYPE1@ const FcChar8 * @ARG1@ s1 @TYPE2@ const FcChar8 * @ARG2@ s2 -@PURPOSE@ compare UTF-8 strings ignoring ASCII case +@PURPOSE@ compare UTF-8 strings ignoring case @DESC@ Returns the usual <0, 0, >0 result of comparing -<parameter>s1</parameter> and <parameter>s2</parameter>. This test is -case-insensitive in the ASCII range and will operate properly with UTF8 -encoded strings, although it does not check for well formed strings. +<parameter>s1</parameter> and <parameter>s2</parameter>. This test is +case-insensitive for all proper UTF-8 encoded strings. @@ @RET@ FcChar8 * @FUNC@ FcStrStr -@TYPE1@ const char * @ARG1@ s1 -@TYPE2@ const char * @ARG2@ s2 +@TYPE1@ const FcChar8 * @ARG1@ s1 +@TYPE2@ const FcChar8 * @ARG2@ s2 @PURPOSE@ locate UTF-8 substring @DESC@ Returns the location of <parameter>s2</parameter> in <parameter>s1</parameter>. Returns NULL if <parameter>s2</parameter> is not present in <parameter>s1</parameter>. This test will operate properly -with UTF8 encoded strings, although it does not check for well formed -strings. +with UTF8 encoded strings. @@ @RET@ FcChar8 * @FUNC@ FcStrStrIgnoreCase -@TYPE1@ const char * @ARG1@ s1 -@TYPE2@ const char * @ARG2@ s2 +@TYPE1@ const FcChar8 * @ARG1@ s1 +@TYPE2@ const FcChar8 * @ARG2@ s2 @PURPOSE@ locate UTF-8 substring ignoring ASCII case @DESC@ Returns the location of <parameter>s2</parameter> in -<parameter>s1</parameter>, ignoring ASCII case. Returns NULL if +<parameter>s1</parameter>, ignoring case. Returns NULL if <parameter>s2</parameter> is not present in <parameter>s1</parameter>. -This test is case-insensitive in the ASCII range and will operate properly -with UTF8 encoded strings, although it does not check for well formed -strings. +This test is case-insensitive for all proper UTF-8 encoded strings. @@ @RET@ FcChar8 * +@FUNC@ FcStrPlus +@TYPE1@ const FcChar8 * @ARG1@ s1 +@TYPE2@ const FcChar8 * @ARG2@ s2 +@PURPOSE@ concatenate two strings +@DESC@ +This function allocates new storage and places the concatenation of +<parameter>s1</parameter> and <parameter>s2</parameter> there, returning the +new string. +@@ + +@RET@ void +@FUNC@ FcStrFree +@TYPE1@ FcChar8 * @ARG1@ s +@PURPOSE@ free a string +@DESC@ +This is just a wrapper around free(3) which helps track memory usage of +strings within the fontconfig library. + +@RET@ FcChar8 * @FUNC@ FcStrDirname @TYPE1@ const FcChar8 * @ARG1@ file @PURPOSE@ directory part of filename diff --git a/doc/fcstrset.fncs b/doc/fcstrset.fncs index c6dd819..d6b0520 100644 --- a/doc/fcstrset.fncs +++ b/doc/fcstrset.fncs @@ -42,6 +42,17 @@ Returns whether <parameter>s</parameter> is a member of @@ @RET@ FcBool +@FUNC@ FcStrSetEqual +@TYPE1@ FcStrSet * @ARG1@ set_a +@TYPE2@ FcStrSet * @ARG2@ set_b +@PURPOSE@ check sets for equality +@DESC@ +Returns whether <parameter>set_a</parameter> contains precisely the same +strings as <parameter>set_b</parameter>. Ordering of strings within the two +sets is not considered. +@@ + +@RET@ FcBool @FUNC@ FcStrSetAdd @TYPE1@ FcStrSet * @ARG1@ set @TYPE2@ const FcChar8 * @ARG2@ s diff --git a/doc/fcvalue.fncs b/doc/fcvalue.fncs index 88ccaf3..14d043b 100644 --- a/doc/fcvalue.fncs +++ b/doc/fcvalue.fncs @@ -38,3 +38,24 @@ FcTypeMatrix and FcTypeCharSet reference memory, the other types do not. Returns a copy of <parameter>v</parameter> duplicating any object referenced by it so that <parameter>v</parameter> may be safely destroyed without harming the new value. @@ + +@RET@ void +@FUNC@ FcValuePrint +@TYPE1@ FcValue% @ARG1@ v +@PURPOSE@ Print a value to stdout +@DESC@ +Prints a human-readable representation of <parameter>v</parameter> to +stdout. The format should not be considered part of the library +specification as it may change in the future. +@@ + +@RET@ FcBool +@FUNC@ FcValueEqual +@TYPE1@ FcValue% @ARG1@ v_a +@TYPE2@ FcValue% @ARG2@ v_b +@PURPOSE@ Test two values for equality +@DESC@ +Compares two values. Integers and Doubles are compared as numbers; otherwise +the two values have to be the same type to be considered equal. Strings are +compared ignoring case. +@@ diff --git a/doc/fontconfig-devel.sgml b/doc/fontconfig-devel.sgml index 5bad9a5..d448524 100644 --- a/doc/fontconfig-devel.sgml +++ b/doc/fontconfig-devel.sgml @@ -178,7 +178,7 @@ convenience for the applications rendering mechanism. spacing charset FC_CHARSET CharSet Unicode chars encoded by the font - lang FC_LANG String List of RFC-3066-style + lang FC_LANG LangSet Set of RFC-3066-style languages this font supports fontversion FC_FONTVERSION Int Version number of the font capability FC_CAPABILITY String List of layout capabilities in @@ -217,6 +217,26 @@ An FcCharSet is an abstract type that holds the set of encoded unicode chars in a font. Operations to build and compare these sets are provided. </para> </sect2> + <sect2><title>FcLangSet</title> + <para> +An FcLangSet is an abstract type that holds the set of languages supported +by a font. Operations to build and compare these sets are provided. These +are computed for a font based on orthographic information built into the +fontconfig library. Fontconfig has orthographies for all of the ISO 639-1 +languages except for MS, NA, PA, PS, QU, RN, RW, SD, SG, SN, SU and ZA. If +you have orthographic information for any of these languages, please submit +them. + </para> + </sect2> + <sect2><title>FcLangResult</title> + <para> +An FcLangResult is an enumeration used to return the results of comparing +two language strings or FcLangSet objects. FcLangEqual means the +objects match language and territory. FcLangDifferentTerritory means +the objects match in language but differ in territory. +FcLangDifferentLang means the objects differ in language. + </para> + </sect2> <sect2><title>FcType</title> <para> Tags the kind of data stored in an FcValue. @@ -236,6 +256,8 @@ types. The 'type' tag indicates which member is valid. double d; const FcMatrix *m; const FcCharSet *c; + void *f; + const FcLangSet *l; } u; } FcValue; </programlisting> @@ -251,6 +273,8 @@ types. The 'type' tag indicates which member is valid. FcTypeBool b b FcTypeMatrix m FcMatrix * FcTypeCharSet c FcCharSet * + FcTypeFTFace f void * (FT_Face) + FcTypeLangSet l FcLangSet * </programlisting> </para> </sect2> commit 9a54f8a1945e614e07446412a2df534fbc1f77cb Author: Keith Packard <keithp@xxxxxxxxxxxxxxx> Date: Sat Nov 3 22:01:33 2007 -0700 Verify documentation covers exposed symbols. Add check-missing-doc script to make sure the documentation matches the complete list of symbols exported from the header files before release. diff --git a/doc/Makefile.am b/doc/Makefile.am index bf1ab99..7b40eb4 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -86,7 +86,11 @@ docdir=@DOCDIR@ DOC_FILES=$(TXT) $(PDF) $(HTML_FILES) LOCAL_DOCS=$(man3_MANS) $(man5_MANS) $(DOC_FILES) $(HTML_DIR)/* -EXTRA_DIST=$(LOCAL_DOCS) $(SGML) $(DOC_FUNCS_FNCS) func.sgml confdir.sgml.in +check_SCRIPTS=check-missing-doc +TESTS_ENVIRONMENT=top_srcdir=${top_srcdir} sh +TESTS=check-missing-doc + +EXTRA_DIST=$(LOCAL_DOCS) $(SGML) $(DOC_FUNCS_FNCS) $(check_SCRIPTS) func.sgml confdir.sgml.in SUFFIXES=.fncs .sgml .txt .html diff --git a/doc/check-missing-doc b/doc/check-missing-doc new file mode 100644 index 0000000..13d1eb9 --- /dev/null +++ b/doc/check-missing-doc @@ -0,0 +1,23 @@ +#!/bin/sh +header=fontconfig-header +doc=fontconfig-doc +#trap "rm $header $doc" 0 1 15 +top_srcdir=${top_srcdir-".."} +( +cat $top_srcdir/fontconfig/*.h | grep '^Fc' | + grep -v FcPublic | sed 's/[^a-zA-Z0-9].*//'; + cat $top_srcdir/fontconfig/*.h | + sed -n 's/#define \(Fc[a-zA-Z]*\)(.*$/\1/p') | + sort -u > $header + +grep '@FUNC@' $top_srcdir/doc/*.fncs | +awk '{print $2}' | +sort -u > $doc + +if cmp $doc $header > /dev/null; then + exit 0 +fi + +echo \ +'Library Export Documentation' +diff -y $header $doc | grep '[<>]' commit c833409f6b68c191ac354cd2fdeb183f73a65c4c Author: Keith Packard <keithp@xxxxxxxxxxxxxxx> Date: Sat Nov 3 21:58:34 2007 -0700 Use FcLangDifferentTerritory instead of FcLangDifferentCountry. diff --git a/src/fclang.c b/src/fclang.c index 13f0ca2..361803a 100644 --- a/src/fclang.c +++ b/src/fclang.c @@ -150,13 +150,13 @@ FcLangCompare (const FcChar8 *s1, const FcChar8 *s2) if (c1 != c2) { if (FcLangEnd (c1) && FcLangEnd (c2)) - result = FcLangDifferentCountry; + result = FcLangDifferentTerritory; return result; } else if (!c1) return FcLangEqual; else if (c1 == '-') - result = FcLangDifferentCountry; + result = FcLangDifferentTerritory; } } @@ -206,7 +206,7 @@ FcCharSetForLang (const FcChar8 *lang) switch (FcLangCompare (lang, fcLangCharSets[i].lang)) { case FcLangEqual: return &fcLangCharSets[i].charset; - case FcLangDifferentCountry: + case FcLangDifferentTerritory: if (country == -1) country = i; default: @@ -437,7 +437,7 @@ FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb) if ((lsa->map[i] & fcLangCountrySets[j][i]) && (lsb->map[i] & fcLangCountrySets[j][i])) { - best = FcLangDifferentCountry; + best = FcLangDifferentTerritory; break; } if (lsa->extra) commit 9b84ecff92b8dccf6559a858e35762c0f664429a Author: Keith Packard <keithp@xxxxxxxxxxxxxxx> Date: Sat Nov 3 21:57:51 2007 -0700 Don't check cache file time stamps when cleaning cache dir. Cache file mtime is meaningless now that the directory time is encoded in the cache. diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c index b4d4988..54add90 100644 --- a/fc-cache/fc-cache.c +++ b/fc-cache/fc-cache.c @@ -255,7 +255,6 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose) FcBool ret = FcTrue; FcBool remove; FcCache *cache; - struct stat file_stat; struct stat target_stat; dir_base = FcStrPlus (dir, (FcChar8 *) "/"); @@ -302,7 +301,7 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose) break; } remove = FcFalse; - cache = FcDirCacheLoadFile (file_name, &file_stat); + cache = FcDirCacheLoadFile (file_name, NULL); if (!cache) { if (verbose) @@ -319,13 +318,6 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose) dir, ent->d_name, target_dir); remove = FcTrue; } - else if (target_stat.st_mtime > file_stat.st_mtime) - { - if (verbose) - printf ("%s: %s: cache outdated: %s\n", - dir, ent->d_name, target_dir); - remove = FcTrue; - } } if (remove) { commit 1d93c1752f03b833603ea31c2cfbd16868c44922 Author: Keith Packard <keithp@xxxxxxxxxxxxxxx> Date: Sat Nov 3 21:56:36 2007 -0700 Typo error in function name: Inverval -> interval diff --git a/src/fccfg.c b/src/fccfg.c index b55770d..18a74e7 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -508,7 +508,7 @@ FcConfigAddBlank (FcConfig *config, } int -FcConfigGetRescanInverval (FcConfig *config) +FcConfigGetRescanInterval (FcConfig *config) { if (!config) { @@ -520,7 +520,7 @@ FcConfigGetRescanInverval (FcConfig *config) } FcBool -FcConfigSetRescanInverval (FcConfig *config, int rescanInterval) +FcConfigSetRescanInterval (FcConfig *config, int rescanInterval) { if (!config) { commit b868a1447341ebe9962007069ec8658550e62483 Author: Keith Packard <keithp@xxxxxxxxxxxxxxx> Date: Sat Nov 3 21:55:39 2007 -0700 Track line numbers in sgml edit tool input. Errors in the documentation can be hard to find unless the tool outputs the line number where the problem exists. diff --git a/doc/edit-sgml.c b/doc/edit-sgml.c index 3f3be53..067626c 100644 --- a/doc/edit-sgml.c +++ b/doc/edit-sgml.c @@ -77,10 +77,10 @@ static void ReplaceDispose (Replace *r); static void -Bail (const char *format, const char *arg); +Bail (const char *format, int line, const char *arg); static Replace * -ReplaceRead (FILE *f); +ReplaceRead (FILE *f, int *linep); typedef struct _replaceList { struct _replaceList *next; @@ -110,7 +110,7 @@ static Replace * ReplaceSetFind (ReplaceSet *s, char *tag); static ReplaceSet * -ReplaceSetRead (FILE *f); +ReplaceSetRead (FILE *f, int *linep); typedef struct _skipStack { struct _skipStack *prev; @@ -137,10 +137,10 @@ static LoopStack * LoopStackLoop (ReplaceSet *rs, LoopStack *ls, FILE *f); static void -LineSkip (FILE *f); +LineSkip (FILE *f, int *linep); static void -DoReplace (FILE *f, ReplaceSet *s); +DoReplace (FILE *f, int *linep, ReplaceSet *s); #define STRING_INIT 128 @@ -249,27 +249,43 @@ ReplaceDispose (Replace *r) } static void -Bail (const char *format, const char *arg) +Bail (const char *format, int line, const char *arg) { fprintf (stderr, "fatal: "); - fprintf (stderr, format, arg); + fprintf (stderr, format, line, arg); fprintf (stderr, "\n"); exit (1); } +static int +Getc (FILE *f, int *linep) +{ + int c = getc (f); + if (c == '\n') + ++(*linep); +} + +static void +Ungetc (int c, FILE *f, int *linep) +{ + if (c == '\n') + --(*linep); + ungetc (c, f); +} + static Replace * -ReplaceRead (FILE *f) +ReplaceRead (FILE *f, int *linep) { int c; Replace *r; - while ((c = getc (f)) != '@') + while ((c = Getc (f, linep)) != '@') { if (c == EOF) return 0; } r = ReplaceNew(); - while ((c = getc (f)) != '@') + while ((c = Getc (f, linep)) != '@') { if (c == EOF) { @@ -277,7 +293,7 @@ ReplaceRead (FILE *f) return 0; } if (isspace (c)) - Bail ("invalid character after tag %s", r->tag->buf); + Bail ("%d: invalid character after tag %s", *linep, r->tag->buf); StringAdd (r->tag, c); } if (r->tag->buf[0] == '\0') @@ -285,13 +301,13 @@ ReplaceRead (FILE *f) ReplaceDispose (r); return 0; } - while (isspace ((c = getc (f)))) + while (isspace ((c = Getc (f, linep)))) ; - ungetc (c, f); - while ((c = getc (f)) != '@' && c != EOF) + Ungetc (c, f, linep); + while ((c = Getc (f, linep)) != '@' && c != EOF) StringAdd (r->text, c); if (c == '@') - ungetc (c, f); + Ungetc (c, f, linep); while (isspace (StringLast (r->text))) StringDel (r->text); if (StringLast(r->text) == '%') @@ -355,12 +371,12 @@ ReplaceSetFind (ReplaceSet *s, char *tag) } static ReplaceSet * -ReplaceSetRead (FILE *f) +ReplaceSetRead (FILE *f, int *linep) { ReplaceSet *s = ReplaceSetNew (); Replace *r; - while ((r = ReplaceRead (f))) + while ((r = ReplaceRead (f, linep))) { while (ReplaceSetFind (s, r->tag->buf)) StringAdd (r->tag, '+'); @@ -426,17 +442,17 @@ LoopStackLoop (ReplaceSet *rs, LoopStack *ls, FILE *f) } static void -LineSkip (FILE *f) +LineSkip (FILE *f, int *linep) { int c; - while ((c = getc (f)) == '\n') + while ((c = Getc (f, linep)) == '\n') ; - ungetc (c, f); + Ungetc (c, f, linep); } static void -DoReplace (FILE *f, ReplaceSet *s) +DoReplace (FILE *f, int *linep, ReplaceSet *s) { int c; String *tag; @@ -445,12 +461,12 @@ DoReplace (FILE *f, ReplaceSet *s) LoopStack *ls = 0; int skipping = 0; - while ((c = getc (f)) != EOF) + while ((c = Getc (f, linep)) != EOF) { if (c == '@') { tag = StringNew (); - while ((c = getc (f)) != '@') + while ((c = Getc (f, linep)) != '@') { if (c == EOF) abort (); @@ -463,7 +479,7 @@ DoReplace (FILE *f, ReplaceSet *s) ss = SkipStackPush (ss, skipping); if (!ReplaceSetFind (s, tag->buf + 1)) skipping++; - LineSkip (f); + LineSkip (f, linep); break; case ':': if (!ss) @@ -472,20 +488,20 @@ DoReplace (FILE *f, ReplaceSet *s) ++skipping; else --skipping; - LineSkip (f); + LineSkip (f, linep); break; case ';': skipping = ss->skipping; ss = SkipStackPop (ss); - LineSkip (f); + LineSkip (f, linep); break; case '{': ls = LoopStackPush (ls, f, tag->buf + 1); - LineSkip (f); + LineSkip (f, linep); break; case '}': ls = LoopStackLoop (s, ls, f); - LineSkip (f); + LineSkip (f, linep); break; default: r = ReplaceSetFind (s, tag->buf); @@ -505,22 +521,25 @@ main (int argc, char **argv) { FILE *f; ReplaceSet *s; + int iline, oline; if (!argv[1]) - Bail ("usage: %s <template.sgml>", argv[0]); + Bail ("usage: %s <template.sgml>", 0, argv[0]); f = fopen (argv[1], "r"); if (!f) { - Bail ("can't open file %s", argv[1]); + Bail ("can't open file %s", 0, argv[1]); exit (1); } - while ((s = ReplaceSetRead (stdin))) + iline = 1; + while ((s = ReplaceSetRead (stdin, &iline))) { - DoReplace (f, s); + oline = 1; + DoReplace (f, &oline, s); ReplaceSetDispose (s); rewind (f); } if (ferror (stdout)) - Bail ("%s", "error writing output"); + Bail ("%s", 0, "error writing output"); exit (0); } commit 088b582a26bce1ab3ec081a80fd6a6fe43223da5 Author: Keith Packard <keithp@xxxxxxxxxxxxxxx> Date: Sat Nov 3 21:54:49 2007 -0700 Clean up exported names in fontconfig.h. Fix typo errors (Inverval indeed). Remove FcPattern *p from FcValue (unused) Remove spurious FcPublic from formals. diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h index 4f02809..f98599f 100644 --- a/fontconfig/fontconfig.h +++ b/fontconfig/fontconfig.h @@ -228,7 +228,6 @@ typedef struct _FcValue { const FcMatrix *m; const FcCharSet *c; void *f; - const FcPattern *p; const FcLangSet *l; } u; } FcValue; @@ -250,7 +249,10 @@ typedef enum _FcMatchKind { } FcMatchKind; typedef enum _FcLangResult { - FcLangEqual, FcLangDifferentCountry, FcLangDifferentLang + FcLangEqual = 0, + FcLangDifferentCountry = 1, + FcLangDifferentTerritory = 1, + FcLangDifferentLang = 2 } FcLangResult; typedef enum _FcSetName { @@ -367,10 +369,10 @@ FcPublic FcStrList * FcConfigGetCacheDirs (FcConfig *config); FcPublic int -FcConfigGetRescanInverval (FcConfig *config); +FcConfigGetRescanInterval (FcConfig *config); FcPublic FcBool -FcConfigSetRescanInverval (FcConfig *config, int rescanInterval); +FcConfigSetRescanInterval (FcConfig *config, int rescanInterval); FcPublic FcFontSet * FcConfigGetFonts (FcConfig *config, @@ -883,25 +885,25 @@ FcPublic FcStrSet * FcStrSetCreate (void); FcPublic FcBool -FcStrSetMember (FcPublic FcStrSet *set, const FcChar8 *s); +FcStrSetMember (FcStrSet *set, const FcChar8 *s); FcPublic FcBool -FcStrSetEqual (FcPublic FcStrSet *sa, FcPublic FcStrSet *sb); +FcStrSetEqual (FcStrSet *sa, FcStrSet *sb); FcPublic FcBool -FcStrSetAdd (FcPublic FcStrSet *set, const FcChar8 *s); +FcStrSetAdd (FcStrSet *set, const FcChar8 *s); FcPublic FcBool -FcStrSetAddFilename (FcPublic FcStrSet *set, const FcChar8 *s); +FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s); FcPublic FcBool -FcStrSetDel (FcPublic FcStrSet *set, const FcChar8 *s); +FcStrSetDel (FcStrSet *set, const FcChar8 *s); FcPublic void -FcStrSetDestroy (FcPublic FcStrSet *set); +FcStrSetDestroy (FcStrSet *set); FcPublic FcStrList * -FcStrListCreate (FcPublic FcStrSet *set); +FcStrListCreate (FcStrSet *set); FcPublic FcChar8 * FcStrListNext (FcStrList *list); commit e37d10fa74217a6102003882d49ac323f28db678 Author: Keith Packard <keithp@xxxxxxxxxxxxxxx> Date: Sat Nov 3 14:16:29 2007 -0700 Make file_stat argument to FcDirCacheLoadFile optional. Allow file_stat to be NULL by using a local stat structure in that case. diff --git a/src/fccache.c b/src/fccache.c index bd8db46..c24b061 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -559,7 +559,10 @@ FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat) { int fd; FcCache *cache; + struct stat my_file_stat; + if (!file_stat) + file_stat = &my_file_stat; fd = FcDirCacheOpenFile (cache_file, file_stat); if (fd < 0) return NULL;
_______________________________________________ Fontconfig mailing list Fontconfig@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/fontconfig