Commit Graph

38 Commits

Author SHA1 Message Date
Akira TAGOH fe6ba5e5c5 Fix the hardcoded cache file suffix 2012-03-28 16:27:46 +09:00
Mike Frysinger da763aa77d fc-cat: fix pointer warning
Add a cast to avoid a gcc warning:

fc-cat.c: In function 'cache_print_set':
fc-cat.c:230:2: warning: pointer targets in passing argument 2
	of 'FcPatternFormat' differ in signedness [-Wpointer-sign]
../fontconfig/fontconfig.h:860:1: note:
	expected 'const FcChar8 *' but argument is of type 'char *'

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-02-21 14:15:58 -05:00
Behdad Esfahbod e61eba94ef Switch fc-cat to use FcPatternFormat()
Added the a builtin "fccat" to FcPatternFormat().
2011-06-20 11:55:25 -04:00
Behdad Esfahbod d1a0fca316 Make fc-arch stuff cross-compiling-safe
Fixes:
Bug 32679 - fontconfig-2.8.0 does not cross compile
Bug 25462 - Cross-compilation doesn't work
2010-12-28 01:22:34 -06:00
Behdad Esfahbod 5aaf466d38 Cleanup copyright notices to replace "Keith Packard" with "the author(s)" 2010-11-10 16:45:42 -05:00
Behdad Esfahbod 9d8d0226d9 Bug 29995 - fc-cat does not invoke FcFini() 2010-09-03 08:11:00 -04:00
Behdad Esfahbod 3074a73b41 Replace 'KEITH PACKARD' with 'THE AUTHOR(S)' in license text in all files 2009-03-13 17:59:28 -04:00
Behdad Esfahbod 1439c8f21a Handle -h and --help according to GNU Coding Standards (#17104)
Added -h instead of -?.  And upon -h and --help, write usave to stdout
instead of stdin, and return 0 instead of 1.

-? still works like before as that's what getopt returns upon unknown
arguments.
2009-02-13 16:53:59 -08:00
Behdad Esfahbod 317b849215 Replace RCS Id tags with the file name 2009-02-13 16:53:55 -08:00
Peter Breitenlohner e3b65ee068 Fix fc-cat documentation (bug 8935).
Adapt documentation to reality.

(1) The fc-cat usage message should reflect the
options accepted by the program.

(2) The fc-cat.1 manpage was fairly broken (unreadable).
2006-12-02 15:09:57 -08:00
Keith Packard 4984242e36 Hide private functions in shared library. Export functionality for utilities.
Borrowing header stuff written for cairo, fontconfig now exposes in the
shared library only the symbols which are included in the public header
files. All private symbols are hidden using suitable compiler directives.

A few new public functions were required for the fontconfig utility programs
(fc-cat and fc-cache) so those were added, bumping the .so minor version number
in the process.
2006-09-04 00:47:07 -07:00
Keith Packard 9b511b2905 Unify directory canonicalization into FcStrAddFilename.
Instead of making filename canonicalization occur in multiple places, it
occurs only in FcStrAddFilename now, as all filenames pass through that
function at one point.
2006-09-02 14:52:37 -07:00
Keith Packard bc5e487f2a Pass directory information around in FcCache structure. Freeze charsets.
Instead of passing directory information around in separate variables,
collect it all in an FcCache structure. Numerous internal and tool
interfaces changed as a result of this.

Charsets are now pre-frozen before being serialized. This causes them to
share across multiple fonts in the same cache.
2006-09-01 01:15:14 -07:00
Keith Packard 0a87ce715e With no args, fc-cat now dumps all directories.
Automatically list all font directories when no arguments are given to
fc-cat. Also add -r option to recurse from specified cache directories.
fc-cat also now prints the cache filename in verbose mode, along with the
related directory name.
2006-08-31 11:56:43 -07:00
Keith Packard d8ab9e6c42 Automatically remove invalid cache files.
Cache files for missing or more recently modified directories are
automatically removed at the end of every fc-cache run.
2006-08-31 09:42:49 -07:00
Keith Packard 76abb77f26 Fix fc-cat again. Sigh.
Internal interfaces in cache management changed again...
2006-08-30 22:23:25 -07:00
Keith Packard c02886485b FcCharSetSerialize was using wrong offset for leaves. Make fc-cat work.
FcCharSetSerialize was computing the offset to the unserialized leaf,
which left it pointing at random data when the cache was reloaded.

fc-cat has been updated to work with the new cache structure.

Various debug messages extended to help diagnose serialization errors.
2006-08-30 13:51:03 -07:00
Keith Packard af180c4037 Fix up fc-cache and fc-cat for no global cache changes.
fc-cache and fc-cat use internal (fcint.h) APIs that have
changed with the elimination of the global cache.
2006-08-27 22:24:39 -07:00
Patrick Lam f045376c08 Include $(top_srcdir), $(top_srcdir)/src before anything else.
Shuffle order of includes for building out of srcdir on win32.
reviewed by: plam
2006-04-25 05:57:41 +00:00
Patrick Lam 04f7d3e7fd Properly convert static charsets to dynamic charsets.
Fix memory leak in error case (Coverity defects #1820, #1821, #1822).
Fix memory leak (Coverity defect #1819).
prevent crash when invalid include line is parsed (Coverity defect #763).
Fix potential null pointer access (Coverity defect #1804).
Remove dead code (Coverity defect #1194).
Prevent potential null pointer access (Coverity defect #767), ensure error
    value is read (Coverity defect #1195).
reviewed by: plam
2006-04-11 14:20:59 +00:00
Patrick Lam d6217cc6bc Patrick Lam <plam@mit.edu>
Make fontconfig compile under MinGW:
1) remove unneeded #includes;
2) make use of mmap and sysconf conditional;
3) replace rand_r by srand/rand if needed;
4) use chsize instead of ftruncate; and
5) update libtool exports file
2006-04-07 04:42:32 +00:00
Patrick Lam ead55be0ed More stub definitions and remove FcFileIsDir from fc-cat. 2006-03-03 18:19:04 +00:00
Patrick Lam 9769b43d4a Initialize fontconfig library in fc-cat to avoid segfault.
reviewed by: plam
2006-02-21 14:12:41 +00:00
Patrick Lam 12f46c42fa Enable fc-cat to print out old-style cache info when given a directory
name.
2006-02-17 05:47:08 +00:00
Patrick Lam 68355f3877 src/fccache.c (FcGlobalCacheLoad, FcGlobalCacheSave, FcDirCacheConsume,
FcDirCacheWrite)
Check I/O call return values and eliminate unused variable warnings.
reviewed by: plam
2006-02-05 02:57:21 +00:00
Patrick Lam 2c4e012497 Update fc-cat to handle subdir lists in global cache file.
Another FcCacheReadString return value check.
2006-01-30 15:59:17 +00:00
Patrick Lam 8a0b0ed6d0 Compare device numbers as well as inodes. Always normalize directory names
before comparing them.
Allocate extra space for appended '/' in directory name.
reviewed by: plam
2006-01-14 21:23:03 +00:00
Patrick Lam cd9bca6970 Normalize font dirs by using the form, as given in fonts.conf, and recorded
in FcConfig's fontDirs string set, as canonical.
Actually update config.fontDirs as font directories are scanned.
2006-01-09 13:58:04 +00:00
Patrick Lam c60ec7cc6d Add self to AUTHORS list.
Minor change to global cache file format to fix fc-cat bug reported by
    Frederic Crozat, and buglet with not globally caching directories with
    zero fonts cached.
2006-01-05 15:12:22 +00:00
Patrick Lam ea44e21841 Migrate cache files from fonts directories to /var/cache/fontconfig. This
helps make fontconfig FHS-compliant, but requires that all caches get
    rebuilt.
Also, autogen.sh now needs the additional parameter
--localstatedir=/var.
2005-12-09 16:36:45 +00:00
Patrick Lam 982b598278 Fix warnings. 2005-12-07 03:55:25 +00:00
Patrick Lam 6059daeddb Add codepath for reading global cache files as well. 2005-12-01 07:12:45 +00:00
Patrick Lam d2f459781c Properly apply fcrozat's patch. 2005-11-23 17:01:27 +00:00
Patrick Lam f7c4624f56 2005-11-23 Frederic Crozat <fcrozat@mandriva.com>: reviewed by: plam
Minor code warning cleanups.
2005-11-23 16:36:26 +00:00
Patrick Lam 8f2a807810 Don't crash when fc-cat invoked with no arguments.
Fix invalid read access caused by premature free and GCC4 warnings in
    libxml2 codepath.
reviewed by: plam
reviewed by: plam
2005-11-18 20:32:30 +00:00
Patrick Lam d6946c1a11 Fix small memory error (tried to free argv); use basename and dirname
correctly (they can modify their arguments).
2005-11-01 05:52:28 +00:00
Patrick Lam e77c17184a Reinstate basename patch, but keep a hash table linking FcPatterns to their
fully-qualified font names for clients' benefit. Clients only pay for
    the font names once they request the FC_FILE property from an
    FcPattern, but the font name is malloc'd at that point (i.e. not
    mmapped: that's impossible, since it may vary between machines.)
    Clients do have to pay for a copy of the path name per cache file.
Note that FcPatternGetString now does some rewriting if you ask for an
    FC_FILE, appending the pathname as appropriate.
2005-11-01 05:26:27 +00:00
Patrick Lam f28f090d25 Add new command-line utility, fc-cat, to convert fonts.cache-2 files into
fonts.cache-1 files (e.g. for grepping and validation of the mmap
    codepath), as per James Cloos' request.
Remove done 'TODO' comment.
Updates for development release 2.3.90.
2005-09-23 05:59:19 +00:00