diff options
author | marha <marha@users.sourceforge.net> | 2013-11-25 08:30:07 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-11-25 08:30:07 +0100 |
commit | a473b885d641b9c1ea57f2ae53f9ba7f2958cce2 (patch) | |
tree | 063ea788b90cc200b84b40ce431a7649045de907 /mkfontscale | |
parent | 697f071e3dcd3b01dba050d6c5316f2a23ee82f8 (diff) | |
download | vcxsrv-a473b885d641b9c1ea57f2ae53f9ba7f2958cce2.tar.gz vcxsrv-a473b885d641b9c1ea57f2ae53f9ba7f2958cce2.tar.bz2 vcxsrv-a473b885d641b9c1ea57f2ae53f9ba7f2958cce2.zip |
libX11 xserver mesa libXinerama libXmu mkfontscale git update 25 nov 2013
xserver commit 80481267662c8687e73081237913fa561e7a6561
libX11 commit 1e43c262d13cab2b759665f9f13bdedbc7afbfd4
libXinerama commit edd95182b26eb5d576d4878c559e0f17dddaa909
mkfontscale commit 880a0c4733e62e54e6a0f1238c7430727d23657b
libXmu commit e02c30fac32e4873240e507cadc416f710188feb
mesa commit 72cae2a599881e926b8709f4dfa2cc3591ea7a02
Diffstat (limited to 'mkfontscale')
-rw-r--r-- | mkfontscale/configure.ac | 2 | ||||
-rw-r--r-- | mkfontscale/man/mkfontscale.man | 5 | ||||
-rw-r--r-- | mkfontscale/mkfontscale.c | 44 |
3 files changed, 32 insertions, 19 deletions
diff --git a/mkfontscale/configure.ac b/mkfontscale/configure.ac index 971ae5c39..cc13259ab 100644 --- a/mkfontscale/configure.ac +++ b/mkfontscale/configure.ac @@ -54,7 +54,7 @@ fi # Checks for pkg-config packages PKG_CHECK_MODULES(MKFONTSCALE, fontenc freetype2) -PKG_CHECK_MODULES(X11, xproto) +PKG_CHECK_MODULES(X11, [xproto >= 7.0.25]) dnl Allow checking code with lint, sparse, etc. XORG_WITH_LINT diff --git a/mkfontscale/man/mkfontscale.man b/mkfontscale/man/mkfontscale.man index 4aa88ab04..cb1845817 100644 --- a/mkfontscale/man/mkfontscale.man +++ b/mkfontscale/man/mkfontscale.man @@ -38,6 +38,8 @@ mkfontscale \- create an index of scalable font files for X ] [ .B \-u | \-U ] [ +.B \-v +] [ .B \-\- ] [ .I directory @@ -132,6 +134,9 @@ is useful when generating encoding directories only. disable (\fI-u\fP) or enable (\fI-U\fP) indexing of ISO 10646:1 font encodings (default: enabled). .TP +.B \-v +print program version and exit. +.TP .B \-\- end of options. .SH SEE ALSO diff --git a/mkfontscale/mkfontscale.c b/mkfontscale/mkfontscale.c index a67f28338..a494f931d 100644 --- a/mkfontscale/mkfontscale.c +++ b/mkfontscale/mkfontscale.c @@ -34,6 +34,7 @@ #include <ctype.h> #include <X11/Xos.h> +#include <X11/Xfuncproto.h> #include <X11/fonts/fontenc.h> #include <ft2build.h> #include FT_FREETYPE_H @@ -112,15 +113,24 @@ static ListPtr encodingsToDo; static int reencodeLegacy; static char *encodingPrefix; static char *exclusionSuffix; +static char *ProgramName; -static void +static void _X_NORETURN _X_COLD usage(void) { - fprintf(stderr, + fprintf(stderr, "Usage:\n" "mkfontscale [ -b ] [ -s ] [ -o filename ] [-x suffix ]\n" - " [ -a encoding ] [ -f fuzz ] [ -l ] " + " [ -a encoding ] [ -f fuzz ] [ -l ]\n" " [ -e directory ] [ -p prefix ] [ -n ] [ -r ] \n" - " [-u] [-U] [ directory ]...\n"); + " [-u] [-U] [-v] [ directory ]...\n"); + exit(1); +} + +static void _X_NORETURN _X_COLD +missing_arg (const char *option) +{ + fprintf(stderr, "%s: %s requires an argument\n", ProgramName, option); + usage(); } int @@ -131,6 +141,7 @@ main(int argc, char **argv) int rc, ll = 0; char prefix[NPREFIX]; + ProgramName = argv[0]; encodingPrefix = NULL; exclusionSuffix = NULL; @@ -166,34 +177,31 @@ main(int argc, char **argv) break; } else if (strcmp(argv[argn], "-x") == 0) { if(argn >= argc - 1) { - usage(); - exit(1); + missing_arg("-x"); } exclusionSuffix = argv[argn + 1]; argn += 2; } else if(strcmp(argv[argn], "-a") == 0) { if(argn >= argc - 1) { - usage(); - exit(1); + missing_arg("-a"); } makeList(&argv[argn + 1], 1, encodings, 0); argn += 2; } else if(strcmp(argv[argn], "-p") == 0) { if(argn >= argc - 1) { - usage(); - exit(1); + missing_arg("-p"); } if(strlen(argv[argn + 1]) > NPREFIX - 1) { + fprintf(stderr, "%s: argument to -p cannot be longer than " + "%d characters\n", ProgramName, NPREFIX - 1); usage(); - exit(1); } free(encodingPrefix); encodingPrefix = dsprintf("%s", argv[argn + 1]); argn += 2; } else if(strcmp(argv[argn], "-e") == 0) { if(argn >= argc - 1) { - usage(); - exit(1); + missing_arg("-e"); } rc = readEncodings(encodingsToDo, argv[argn + 1]); if(rc < 0) @@ -222,15 +230,13 @@ main(int argc, char **argv) argn++; } else if(strcmp(argv[argn], "-o") == 0) { if(argn >= argc - 1) { - usage(); - exit(1); + missing_arg("-o"); } outfilename = argv[argn + 1]; argn += 2; } else if(strcmp(argv[argn], "-f") == 0) { if(argn >= argc - 1) { - usage(); - exit(1); + missing_arg("-f"); } bigEncodingFuzz = atof(argv[argn + 1]) / 100.0; argn += 2; @@ -238,9 +244,11 @@ main(int argc, char **argv) argn++; } else if (strcmp(argv[argn], "-n") == 0) { argn++; + } else if (strcmp(argv[argn], "-v") == 0) { + printf("%s\n", PACKAGE_STRING); + exit(0); } else { usage(); - exit(1); } } |