12c393a42Smrg/* 22c393a42Smrg * Copyright © 2007 Keith Packard 32c393a42Smrg * 42c393a42Smrg * Permission to use, copy, modify, distribute, and sell this software and its 52c393a42Smrg * documentation for any purpose is hereby granted without fee, provided that 62c393a42Smrg * the above copyright notice appear in all copies and that both that copyright 72c393a42Smrg * notice and this permission notice appear in supporting documentation, and 82c393a42Smrg * that the name of the copyright holders not be used in advertising or 92c393a42Smrg * publicity pertaining to distribution of the software without specific, 102c393a42Smrg * written prior permission. The copyright holders make no representations 112c393a42Smrg * about the suitability of this software for any purpose. It is provided "as 122c393a42Smrg * is" without express or implied warranty. 132c393a42Smrg * 142c393a42Smrg * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 152c393a42Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 162c393a42Smrg * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR 172c393a42Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 182c393a42Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 192c393a42Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 202c393a42Smrg * OF THIS SOFTWARE. 212c393a42Smrg */ 222c393a42Smrg 231cc69409Smrg@RET@ FcBool 241cc69409Smrg@FUNC@ FcDirCacheUnlink 251cc69409Smrg@TYPE1@ const FcChar8 * @ARG1@ dir 261cc69409Smrg@TYPE2@ FcConfig * @ARG2@ config 271cc69409Smrg@PURPOSE@ Remove all caches related to <parameter>dir</parameter> 282c393a42Smrg@DESC@ 292c393a42SmrgScans the cache directories in <parameter>config</parameter>, removing any 302c393a42Smrginstances of the cache file for <parameter>dir</parameter>. Returns FcFalse 312c393a42Smrgwhen some internal error occurs (out of memory, etc). Errors actually 322c393a42Smrgunlinking any files are ignored. 332c393a42Smrg@@ 342c393a42Smrg 351cc69409Smrg@RET@ FcBool 361cc69409Smrg@FUNC@ FcDirCacheValid 371cc69409Smrg@TYPE1@ const FcChar8 * @ARG1@ dir 381cc69409Smrg@PURPOSE@ check directory cache 392c393a42Smrg@DESC@ 402c393a42SmrgReturns FcTrue if <parameter>dir</parameter> has an associated valid cache 412c393a42Smrgfile, else returns FcFalse 422c393a42Smrg@@ 432c393a42Smrg 441cc69409Smrg@RET@ FcCache * 451cc69409Smrg@FUNC@ FcDirCacheLoad 461cc69409Smrg@TYPE1@ const FcChar8 * @ARG1@ dir 471cc69409Smrg@TYPE2@ FcConfig * @ARG2@ config 481cc69409Smrg@TYPE3@ FcChar8 ** @ARG3@ cache_file 491cc69409Smrg@PURPOSE@ load a directory cache 502c393a42Smrg@DESC@ 512c393a42SmrgLoads the cache related to <parameter>dir</parameter>. If no cache file 522c393a42Smrgexists, returns NULL. The name of the cache file is returned in 532c393a42Smrg<parameter>cache_file</parameter>, unless that is NULL. See also 542c393a42SmrgFcDirCacheRead. 552c393a42Smrg@@ 562c393a42Smrg 571cc69409Smrg@RET@ FcCache * 581cc69409Smrg@FUNC@ FcDirCacheRescan 591cc69409Smrg@TYPE1@ const FcChar8 * @ARG1@ dir 601cc69409Smrg@TYPE2@ FcConfig * @ARG2@ config 611cc69409Smrg@PURPOSE@ Re-scan a directory cache 62b09479dcSmrg@DESC@ 63b09479dcSmrgRe-scan directories only at <parameter>dir</parameter> and update the cache. 64b09479dcSmrgreturns NULL if failed. 651cc69409Smrg@SINCE@ 2.11.1 66b09479dcSmrg@@ 67b09479dcSmrg 681cc69409Smrg@RET@ FcCache * 691cc69409Smrg@FUNC@ FcDirCacheRead 701cc69409Smrg@TYPE1@ const FcChar8 * @ARG1@ dir 711cc69409Smrg@TYPE2@ FcBool% @ARG2@ force 721cc69409Smrg@TYPE3@ FcConfig * @ARG3@ config 731cc69409Smrg@PURPOSE@ read or construct a directory cache 742c393a42Smrg@DESC@ 752c393a42SmrgThis returns a cache for <parameter>dir</parameter>. If 762c393a42Smrg<parameter>force</parameter> is FcFalse, then an existing, valid cache file 772c393a42Smrgwill be used. Otherwise, a new cache will be created by scanning the 782c393a42Smrgdirectory and that returned. 792c393a42Smrg@@ 802c393a42Smrg 811cc69409Smrg@RET@ FcCache * 821cc69409Smrg@FUNC@ FcDirCacheLoadFile 831cc69409Smrg@TYPE1@ const FcChar8 * @ARG1@ cache_file 841cc69409Smrg@TYPE2@ struct stat * @ARG2@ file_stat 851cc69409Smrg@PURPOSE@ load a cache file 862c393a42Smrg@DESC@ 872c393a42SmrgThis function loads a directory cache from 882c393a42Smrg<parameter>cache_file</parameter>. If <parameter>file_stat</parameter> is 892c393a42Smrgnon-NULL, it will be filled with the results of stat(2) on the cache file. 902c393a42Smrg@@ 912c393a42Smrg 921cc69409Smrg@RET@ void 931cc69409Smrg@FUNC@ FcDirCacheUnload 941cc69409Smrg@TYPE1@ FcCache * @ARG1@ cache 951cc69409Smrg@PURPOSE@ unload a cache file 962c393a42Smrg@DESC@ 972c393a42SmrgThis function dereferences <parameter>cache</parameter>. When no other 982c393a42Smrgreferences to it remain, all memory associated with the cache will be freed. 992c393a42Smrg@@ 100