- exit (1);
-}
-
-/* read serialized state from the cache file */
-static FcBool
-FcCacheFileRead (FcFontSet * set, FcStrSet *dirs, char * dir, char *cache_file)
-{
- int fd;
- char * current_arch_machine_name;
- char candidate_arch_machine_name[9+MACHINE_SIGNATURE_SIZE];
- off_t current_arch_start = 0;
- char subdirName[FC_MAX_FILE_LEN + 1 + 12 + 1];
-
- if (!cache_file)
- goto bail;
-
- current_arch_machine_name = FcCacheMachineSignature();
- fd = open(cache_file, O_RDONLY);
- if (fd == -1)
- goto bail;
-
- current_arch_start = FcCacheSkipToArch(fd, current_arch_machine_name);
- if (current_arch_start < 0)
- goto bail1;
-
- lseek (fd, current_arch_start, SEEK_SET);
- if (FcCacheReadString (fd, candidate_arch_machine_name,
- sizeof (candidate_arch_machine_name)) == 0)
- goto bail1;
-
- while (strlen(FcCacheReadString (fd, subdirName, sizeof (subdirName))) > 0)
- FcStrSetAdd (dirs, (FcChar8 *)subdirName);
-
- if (!FcDirCacheConsume (fd, dir, set))
- goto bail1;
-
- close(fd);
- return FcTrue;
-
- bail1:
- close (fd);
- bail:
- return FcFalse;