X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=fc-list%2Ffc-list.c;h=b85dfd7e49a180fe95d462cdcee30b54c87ed2bd;hb=f57783d2e9c7362b1e5d5e3a967ba90fa49ade6e;hp=45c62958b0d3693ba9a58fe76849e036973629dc;hpb=e6099fe9799e79a467698f7e0ddb693fae5d7d2f;p=fontconfig.git diff --git a/fc-list/fc-list.c b/fc-list/fc-list.c index 45c6295..b85dfd7 100644 --- a/fc-list/fc-list.c +++ b/fc-list/fc-list.c @@ -1,7 +1,7 @@ /* - * $XFree86: xc/lib/fontconfig/fc-list/fc-list.c,v 1.2 2002/02/15 06:01:26 keithp Exp $ + * $RCSId: xc/lib/fontconfig/fc-list/fc-list.c,v 1.5 2002/06/30 23:45:40 keithp Exp $ * - * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. + * Copyright © 2002 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 @@ -61,20 +61,31 @@ extern int optind, opterr, optopt; static void usage (char *program) { +#if HAVE_GETOPT_LONG fprintf (stderr, "usage: %s [-vV?] [--verbose] [--version] [--help] [pattern] {element ...} \n", program); +#else + fprintf (stderr, "usage: %s [-vV?] [pattern] {element ...} \n", + program); +#endif fprintf (stderr, "List fonts matching [pattern]\n"); fprintf (stderr, "\n"); +#if HAVE_GETOPT_LONG fprintf (stderr, " -v, --verbose display status information while busy\n"); fprintf (stderr, " -V, --version display font config version and exit\n"); fprintf (stderr, " -?, --help display this help and exit\n"); +#else + fprintf (stderr, " -v (verbose) display status information while busy\n"); + fprintf (stderr, " -V (version) display font config version and exit\n"); + fprintf (stderr, " -? (help) display this help and exit\n"); +#endif exit (1); } int main (int argc, char **argv) { - int verbose = 0; + /*int verbose = 0;*/ int i; FcObjectSet *os = 0; FcFontSet *fs; @@ -94,7 +105,7 @@ main (int argc, char **argv) FC_MAJOR, FC_MINOR, FC_REVISION); exit (0); case 'v': - verbose = 1; + /* verbose = 1; */ break; default: usage (argv[0]); @@ -124,8 +135,9 @@ main (int argc, char **argv) pat = FcPatternCreate (); if (!os) - os = FcObjectSetBuild (FC_FAMILY, FC_STYLE); + os = FcObjectSetBuild (FC_FAMILY, FC_STYLE, (char *) 0); fs = FcFontList (0, pat, os); + FcObjectSetDestroy (os); if (pat) FcPatternDestroy (pat); @@ -146,5 +158,8 @@ main (int argc, char **argv) } FcFontSetDestroy (fs); } + + FcFini (); + return 0; }