#define _GNU_SOURCE
#include <getopt.h>
const struct option longopts[] = {
+ {"convert", 0, 0, 'c'},
{"force", 0, 0, 'f'},
{"really-force", 0, 0, 'r'},
{"root", 1, 0, 'R'},
#if HAVE_GETOPT_LONG || HAVE_GETOPT
int c;
+FcBool convert = FcFalse;
+
#if HAVE_GETOPT_LONG
- while ((c = getopt_long (argc, argv, "frR:sVvh", longopts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "cfrR:sVvh", longopts, NULL)) != -1)
#else
- while ((c = getopt (argc, argv, "frR:sVvh")) != -1)
+ while ((c = getopt (argc, argv, "cfrR:sVvh")) != -1)
#endif
{
switch (c) {
+ case 'c':
+ convert = FcTrue;
+ break;
case 'r':
really_force = FcTrue;
/* fall through */
i = 1;
#endif
+ if (convert)
+ {
+ const FcChar8 *src_cache, *dst_cache, *src_type, *dst_type;
+
+ src_cache = (const FcChar8 *) argv[i++];
+ src_type = (const FcChar8 *) argv[i++];
+ dst_cache = (const FcChar8 *) argv[i++];
+ dst_type = (const FcChar8 *) argv[i++];
+
+ FcDirCacheConvert (src_cache, src_type, dst_cache, dst_type);
+
+ return 0;
+ }
+
if (systemOnly)
FcConfigEnableHome (FcFalse);
config = FcInitLoadConfig ();