Module Name: xsrc Committed By: mrg Date: Mon Jul 11 08:42:43 UTC 2022
Modified Files: xsrc/external/mit/xfontsel/dist: compile xsrc/external/mit/xfs/dist/os: connection.c xsrc/external/mit/xload/dist: compile xsrc/external/mit/xlsfonts/dist: compile xlsfonts.c Added Files: xsrc/external/mit/xedit/dist: compile Removed Files: xsrc/external/mit/xdpyinfo/dist: README xsrc/external/mit/xfontsel/dist: README xsrc/external/mit/xfs/dist: README xsrc/external/mit/xload/dist: README xsrc/external/mit/xlsfonts/dist: README Log Message: merge xdpyinfo 1.3.3, xedit 1.2.3, xfontsel 1.1.0, xfs 1.2.1, xload 1.1.4, and xlsfonts 1.0.7. To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r0 xsrc/external/mit/xdpyinfo/dist/README cvs rdiff -u -r0 -r1.3 xsrc/external/mit/xedit/dist/compile cvs rdiff -u -r1.1.1.2 -r0 xsrc/external/mit/xfontsel/dist/README cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xfontsel/dist/compile cvs rdiff -u -r1.1.1.2 -r0 xsrc/external/mit/xfs/dist/README cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xfs/dist/os/connection.c cvs rdiff -u -r1.1.1.2 -r0 xsrc/external/mit/xload/dist/README cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/xload/dist/compile cvs rdiff -u -r1.1.1.2 -r0 xsrc/external/mit/xlsfonts/dist/README cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xlsfonts/dist/compile cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/xlsfonts/dist/xlsfonts.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: xsrc/external/mit/xfontsel/dist/compile diff -u xsrc/external/mit/xfontsel/dist/compile:1.3 xsrc/external/mit/xfontsel/dist/compile:1.4 --- xsrc/external/mit/xfontsel/dist/compile:1.3 Sun Mar 11 08:15:23 2018 +++ xsrc/external/mit/xfontsel/dist/compile Mon Jul 11 08:42:42 2022 @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey <tro...@cygnus.com>. # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ func_file_conv () mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) @@ -255,7 +255,8 @@ EOF echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: Index: xsrc/external/mit/xfs/dist/os/connection.c diff -u xsrc/external/mit/xfs/dist/os/connection.c:1.3 xsrc/external/mit/xfs/dist/os/connection.c:1.4 --- xsrc/external/mit/xfs/dist/os/connection.c:1.3 Sun Mar 11 10:08:03 2018 +++ xsrc/external/mit/xfs/dist/os/connection.c Mon Jul 11 08:42:42 2022 @@ -480,7 +480,7 @@ CloseDownConnection(ClientPtr client) /**************** * IgnoreClient * Removes one client from input masks. - * Must have cooresponding call to AttendClient. + * Must have corresponding call to AttendClient. ****************/ static fd_set IgnoredClientsWithInput; Index: xsrc/external/mit/xload/dist/compile diff -u xsrc/external/mit/xload/dist/compile:1.4 xsrc/external/mit/xload/dist/compile:1.5 --- xsrc/external/mit/xload/dist/compile:1.4 Sun Mar 11 08:35:14 2018 +++ xsrc/external/mit/xload/dist/compile Mon Jul 11 08:42:43 2022 @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey <tro...@cygnus.com>. # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ func_file_conv () mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) @@ -255,7 +255,8 @@ EOF echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: Index: xsrc/external/mit/xlsfonts/dist/compile diff -u xsrc/external/mit/xlsfonts/dist/compile:1.3 xsrc/external/mit/xlsfonts/dist/compile:1.4 --- xsrc/external/mit/xlsfonts/dist/compile:1.3 Mon Jul 20 02:48:15 2015 +++ xsrc/external/mit/xlsfonts/dist/compile Mon Jul 11 08:42:43 2022 @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey <tro...@cygnus.com>. # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ func_file_conv () mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) @@ -255,7 +255,8 @@ EOF echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: Index: xsrc/external/mit/xlsfonts/dist/xlsfonts.c diff -u xsrc/external/mit/xlsfonts/dist/xlsfonts.c:1.2 xsrc/external/mit/xlsfonts/dist/xlsfonts.c:1.3 --- xsrc/external/mit/xlsfonts/dist/xlsfonts.c:1.2 Wed May 4 15:41:37 2016 +++ xsrc/external/mit/xlsfonts/dist/xlsfonts.c Mon Jul 11 08:42:43 2022 @@ -36,10 +36,10 @@ in this Software without prior written a #include <limits.h> #include "dsimple.h" -#define N_START INT_MAX /* Maximum # of fonts to start with (should - * always be be > 10000 as modern OSes like - * Solaris 8 already have more than 9000 XLFD - * fonts available) */ +#define N_START INT_MAX /* Maximum # of fonts to start with (should + * always be be > 10000 as modern OSes like + * Solaris 8 already have more than 9000 XLFD + * fonts available) */ #define L_SHORT 0 #define L_MEDIUM 1 @@ -58,8 +58,8 @@ static int font_cnt = static int min_max; typedef struct { - char *name; - XFontStruct *info; + char *name; + XFontStruct *info; } FontList; static FontList *font_list = NULL; @@ -68,37 +68,39 @@ static FontList *font_list = NULL; static void get_list(const char *pattern); static int compare(const void *arg1, const void *arg2); static void show_fonts(void); -static void copy_number(char **pp1, char**pp2, int n1, int n2); +static void copy_number(char **pp1, char **pp2, int n1, int n2); static int IgnoreError(Display *disp, XErrorEvent *event); static void PrintProperty(XFontProp *prop); static void ComputeFontType(XFontStruct *fs); static void print_character_metrics(register XFontStruct *info); -static void do_query_font (Display *dpy, char *name); +static void do_query_font(Display *dpy, char *name); -void usage(const char *errmsg) +void +usage(const char *errmsg) { if (errmsg != NULL) - fprintf (stderr, "%s: %s\n\n", program_name, errmsg); + fprintf(stderr, "%s: %s\n\n", program_name, errmsg); - fprintf (stderr, "usage: %s [-options] [-fn pattern]\n%s", program_name, - "where options include:\n" - " -l[l[l]] give long info about each font\n" - " -m give character min and max bounds\n" - " -C force columns\n" - " -1 force single column\n" - " -u keep output unsorted\n" - " -o use OpenFont/QueryFont instead of ListFonts\n" - " -w width maximum width for multiple columns\n" - " -n columns number of columns if multi column\n" - " -display displayname X server to contact\n" - " -d displayname (alias for -display displayname)\n" - " -v print program version\n" - "\n"); + fprintf(stderr, "usage: %s [-options] [-fn pattern]\n%s", program_name, + "where options include:\n" + " -l[l[l]] give long info about each font\n" + " -m give character min and max bounds\n" + " -C force columns\n" + " -1 force single column\n" + " -u keep output unsorted\n" + " -o use OpenFont/QueryFont instead of ListFonts\n" + " -w width maximum width for multiple columns\n" + " -n columns number of columns if multi column\n" + " -display displayname X server to contact\n" + " -d displayname (alias for -display displayname)\n" + " -v print program version\n" + "\n"); Close_Display(); exit(EXIT_FAILURE); } -int main(int argc, char **argv) +int +main(int argc, char **argv) { int argcnt = 0, i; @@ -110,9 +112,9 @@ int main(int argc, char **argv) for (argv++, argc--; argc; argv++, argc--) { if (argv[0][0] == '-') { if (argcnt > 0) - usage ("options may not be specified after font names"); - for (i=1; argv[0][i]; i++) - switch(argv[0][i]) { + usage("options may not be specified after font names"); + for (i = 1; argv[0][i]; i++) + switch (argv[0][i]) { case 'l': long_list++; break; @@ -125,24 +127,27 @@ int main(int argc, char **argv) case '1': columns = 1; break; - case 'f': /* "-fn" */ - if (argv[0][i+1] != 'n') { - fprintf (stderr, "%s: unrecognized argument %s\n\n", - program_name, argv[0]); + case 'f': /* "-fn" */ + if (argv[0][i + 1] != 'n') { + fprintf(stderr, "%s: unrecognized argument %s\n\n", + program_name, argv[0]); usage(NULL); } - if (--argc <= 0) usage ("-fn requires an argument"); + if (--argc <= 0) + usage("-fn requires an argument"); argcnt++; argv++; get_list(argv[0]); goto next; case 'w': - if (--argc <= 0) usage ("-w requires an argument"); + if (--argc <= 0) + usage("-w requires an argument"); argv++; max_output_line_width = atoi(argv[0]); goto next; case 'n': - if (--argc <= 0) usage ("-n requires an argument"); + if (--argc <= 0) + usage("-n requires an argument"); argv++; columns = atoi(argv[0]); goto next; @@ -156,56 +161,56 @@ int main(int argc, char **argv) puts(PACKAGE_STRING); exit(0); default: - fprintf (stderr, "%s: unrecognized argument -%c\n\n", - program_name, argv[0][i]); + fprintf(stderr, "%s: unrecognized argument -%c\n\n", + program_name, argv[0][i]); usage(NULL); break; } if (i == 1) { - fprintf (stderr, "%s: unrecognized argument %s\n\n", - program_name, argv[0]); + fprintf(stderr, "%s: unrecognized argument %s\n\n", + program_name, argv[0]); usage(NULL); } - } else { + } + else { argcnt++; get_list(argv[0]); } - next: ; + next: ; } if (argcnt == 0) get_list("*"); show_fonts(); - + Close_Display(); return EXIT_SUCCESS; } - -static -void get_list(const char *pattern) +static void +get_list(const char *pattern) { - int available = nnames+1, - i; - char **fonts; - XFontStruct *info; + int available = nnames + 1, i; + char **fonts; + XFontStruct *info; /* Get list of fonts matching pattern */ for (;;) { if (open_instead_of_list) { - info = XLoadQueryFont (dpy, pattern); + info = XLoadQueryFont(dpy, pattern); if (info) { fonts = __UNCONST(&pattern); available = 1; - XUnloadFont (dpy, info->fid); - } else { + XUnloadFont(dpy, info->fid); + } + else { fonts = NULL; } break; } - + if (long_list == L_MEDIUM) fonts = XListFontsWithInfo(dpy, pattern, nnames, &available, &info); else @@ -228,19 +233,19 @@ void get_list(const char *pattern) font_list = realloc(font_list, (font_cnt + available) * sizeof(FontList)); if (font_list == NULL) Fatal_Error("Out of memory!"); - for (i=0; i<available; i++) { + for (i = 0; i < available; i++) { font_list[font_cnt].name = fonts[i]; if (long_list == L_MEDIUM) font_list[font_cnt].info = info + i; else font_list[font_cnt].info = NULL; - + font_cnt++; } } -static -int compare(const void *arg1, const void *arg2) +static int +compare(const void *arg1, const void *arg2) { const FontList *f1 = arg1; const FontList *f2 = arg2; @@ -248,12 +253,12 @@ int compare(const void *arg1, const void const char *p2 = f2->name; while (*p1 && *p2 && *p1 == *p2) - p1++, p2++; - return(*p1 - *p2); + p1++, p2++; + return (*p1 - *p2); } -static -void show_fonts(void) +static void +show_fonts(void) { int i; @@ -261,18 +266,20 @@ void show_fonts(void) return; /* first sort the output */ - if (sort_output) qsort(font_list, font_cnt, sizeof(FontList), compare); + if (sort_output) + qsort(font_list, font_cnt, sizeof(FontList), compare); if (long_list > L_MEDIUM) { for (i = 0; i < font_cnt; i++) { - do_query_font (dpy, font_list[i].name); + do_query_font(dpy, font_list[i].name); } return; } if (long_list == L_MEDIUM) { XFontStruct *pfi; - const char *string; + + const char *string; printf("DIR "); printf("MIN "); @@ -284,26 +291,31 @@ void show_fonts(void) printf("DESC "); printf("NAME"); printf("\n"); - for (i=0; i<font_cnt; i++) { + for (i = 0; i < font_cnt; i++) { pfi = font_list[i].info; if (!pfi) { fprintf(stderr, "%s: no font information for font \"%s\".\n", - program_name, - font_list[i].name ? - font_list[i].name : ""); + program_name, + font_list[i].name ? font_list[i].name : ""); continue; } - switch(pfi->direction) { - case FontLeftToRight: string = "-->"; break; - case FontRightToLeft: string = "<--"; break; - default: string = "???"; break; + switch (pfi->direction) { + case FontLeftToRight: + string = "-->"; + break; + case FontRightToLeft: + string = "<--"; + break; + default: + string = "???"; + break; } printf("%-4s", string); - if (pfi->min_byte1 == 0 && - pfi->max_byte1 == 0) { + if (pfi->min_byte1 == 0 && pfi->max_byte1 == 0) { printf(" %3d ", pfi->min_char_or_byte2); printf(" %3d ", pfi->max_char_or_byte2); - } else { + } + else { printf("*%3d ", pfi->min_byte1); printf("*%3d ", pfi->max_byte1); } @@ -314,10 +326,9 @@ void show_fonts(void) printf("%4d ", pfi->descent); printf("%s\n", font_list[i].name); if (min_max) { - char min[ BUFSIZ ], - max[ BUFSIZ ]; - char *pmax = max, - *pmin = min; + char min[BUFSIZ], max[BUFSIZ]; + + char *pmax = max, *pmin = min; strcpy(pmin, " min(l,r,w,a,d) = ("); strcpy(pmax, " max(l,r,w,a,d) = ("); @@ -353,13 +364,9 @@ void show_fonts(void) } if ((columns == 0 && isatty(1)) || columns > 1) { - int width, - max_width = 0, - lines_per_column, - j, - index; + int width, max_width = 0, lines_per_column, j, index; - for (i=0; i<font_cnt; i++) { + for (i = 0; i < font_cnt; i++) { width = strlen(font_list[i].name); if (width > max_width) max_width = width; @@ -371,48 +378,49 @@ void show_fonts(void) if ((max_width * 2) + output_line_padding > max_output_line_width) { columns = 1; - } else { + } + else { max_width += output_line_padding; columns = ((max_output_line_width + output_line_padding) / max_width); } - } else { + } + else { max_width += output_line_padding; } - if (columns <= 1) goto single_column; + if (columns <= 1) + goto single_column; if (font_cnt < columns) columns = font_cnt; lines_per_column = (font_cnt + columns - 1) / columns; - for (i=0; i<lines_per_column; i++) { - for (j=0; j<columns; j++) { + for (i = 0; i < lines_per_column; i++) { + for (j = 0; j < columns; j++) { index = j * lines_per_column + i; if (index >= font_cnt) break; - if (j+1 == columns) - printf("%s", font_list[ index ].name); + if (j + 1 == columns) + printf("%s", font_list[index].name); else - printf("%-*s", - max_width, - font_list[ index ].name); + printf("%-*s", max_width, font_list[index].name); } printf("\n"); } return; } - single_column: - for (i=0; i<font_cnt; i++) + single_column: + for (i = 0; i < font_cnt; i++) printf("%s\n", font_list[i].name); } -static -void copy_number(char **pp1, char**pp2, int n1, int n2) +static void +copy_number(char **pp1, char **pp2, int n1, int n2) { char *p1 = *pp1; char *p2 = *pp2; - int w; + int w; sprintf(p1, "%d", n1); sprintf(p2, "%d", n2); @@ -425,17 +433,15 @@ void copy_number(char **pp1, char**pp2, *pp2 = p2; } - - /* ARGSUSED */ -static -int IgnoreError(Display *disp, XErrorEvent *event) +static int +IgnoreError(Display * disp, XErrorEvent *event) { return 0; } static const char *bounds_metrics_title = - "width left right asc desc attr keysym\n"; + "width left right asc desc attr keysym\n"; #define PrintBounds(_what,_ptr) \ { register XCharStruct *p = (_ptr); \ @@ -443,8 +449,7 @@ static const char *bounds_metrics_title (_what), p->width, p->lbearing, \ p->rbearing, p->ascent, p->descent, p->attributes); } - -static const char* stringValued [] = { /* values are atoms */ +static const char *stringValued[] = { /* values are atoms */ /* font name components (see section 3.2 of the XLFD) */ "FOUNDRY", "FAMILY_NAME", @@ -459,7 +464,7 @@ static const char* stringValued [] = { / /* other standard X font properties (see section 3.2 of the XLFD) */ "FONT", "FACE_NAME", - "FULL_NAME", /* deprecated */ + "FULL_NAME", /* deprecated */ "COPYRIGHT", "NOTICE", "FONT_TYPE", @@ -469,7 +474,7 @@ static const char* stringValued [] = { / /* other registered font properties (see the X.org Registry, sec. 15) */ "_ADOBE_POSTSCRIPT_FONTNAME", - + /* unregistered font properties */ "CHARSET_COLLECTIONS", "CLASSIFICATION", @@ -479,11 +484,11 @@ static const char* stringValued [] = { / "QUALITY", "RELATIVE_SET", "STYLE", - NULL - }; + NULL +}; -static -void PrintProperty(XFontProp *prop) +static void +PrintProperty(XFontProp * prop) { char *atom, *value; char nosuch[40]; @@ -492,55 +497,54 @@ void PrintProperty(XFontProp *prop) atom = XGetAtomName(dpy, prop->name); if (!atom) { + snprintf(nosuch, sizeof(nosuch), "No such atom = %ld", prop->name); atom = nosuch; - nosuch[0] = '\0'; - (void)sprintf (atom, "No such atom = %ld", prop->name); } - printf (" %s", atom); + printf(" %s", atom); /* Pad out to a column width of 22, but ensure there is always at least one space between property name & value. */ - for (i = strlen(atom); i < 21; i++) putchar (' '); + for (i = strlen(atom); i < 21; i++) + putchar(' '); putchar(' '); - for (i = 0; ; i++) { + for (i = 0;; i++) { if (stringValued[i] == NULL) { - printf ("%ld\n", prop->card32); + printf("%ld\n", prop->card32); break; } if (strcmp(stringValued[i], atom) == 0) { value = XGetAtomName(dpy, prop->card32); if (value == NULL) - printf ("%ld (expected string value)\n", prop->card32); + printf("%ld (expected string value)\n", prop->card32); else { - printf ("%s\n", value); - XFree (value); + printf("%s\n", value); + XFree(value); } break; } - } - if (atom != nosuch) XFree (atom); - XSetErrorHandler (oldhandler); + } + if (atom != nosuch) + XFree(atom); + XSetErrorHandler(oldhandler); } - static void ComputeFontType(XFontStruct *fs) { - int i; Bool char_cell = True; const char *reason = NULL; XCharStruct *cs; - Atom awatom = XInternAtom (dpy, "AVERAGE_WIDTH", False); + Atom awatom = XInternAtom(dpy, "AVERAGE_WIDTH", False); - printf (" font type:\t\t"); + printf(" font type:\t\t"); if (fs->min_bounds.width != fs->max_bounds.width) { - printf ("Proportional (min and max widths not equal)\n"); + printf("Proportional (min and max widths not equal)\n"); return; } if (awatom) { - for (i = 0; i < fs->n_properties; i++) { + for (int i = 0; i < fs->n_properties; i++) { if (fs->properties[i].name == awatom && (fs->max_bounds.width * 10) != fs->properties[i].card32) { char_cell = False; @@ -551,12 +555,14 @@ ComputeFontType(XFontStruct *fs) } if (fs->per_char) { + unsigned int i; for (i = fs->min_char_or_byte2, cs = fs->per_char; i <= fs->max_char_or_byte2; i++, cs++) { - if (cs->width == 0) continue; + if (cs->width == 0) + continue; if (cs->width != fs->max_bounds.width) { /* this shouldn't happen since we checked above */ - printf ("Proportional (characters not all the same width)\n"); + printf("Proportional (characters not all the same width)\n"); return; } if (char_cell) { @@ -567,7 +573,8 @@ ComputeFontType(XFontStruct *fs) char_cell = False; reason = "ink outside bounding box"; } - } else { + } + else { if (!(0 <= cs->lbearing && cs->lbearing <= cs->rbearing && cs->rbearing <= cs->width)) { @@ -577,38 +584,39 @@ ComputeFontType(XFontStruct *fs) } if (!(cs->ascent <= fs->ascent && cs->descent <= fs->descent)) { - char_cell = False; + char_cell = False; reason = "characters not all same ascent or descent"; } } } } - printf ("%s", char_cell ? "Character Cell" : "Monospaced"); - if (reason) printf (" (%s)", reason); - printf ("\n"); - + printf("%s", char_cell ? "Character Cell" : "Monospaced"); + if (reason) + printf(" (%s)", reason); + printf("\n"); + return; } - static void print_character_metrics(register XFontStruct *info) { register XCharStruct *pc = info->per_char; - register int i, j; + unsigned int i, j; unsigned n, saven; - printf (" character metrics:\n"); + printf(" character metrics:\n"); saven = ((info->min_byte1 << 8) | info->min_char_or_byte2); for (j = info->min_byte1; j <= info->max_byte1; j++) { n = saven; for (i = info->min_char_or_byte2; i <= info->max_char_or_byte2; i++) { - char *s = XKeysymToString ((KeySym) n); - printf ("\t0x%02x%02x (%u)\t%4d %4d %4d %4d %4d 0x%04x %s\n", - j, i, n, pc->width, pc->lbearing, - pc->rbearing, pc->ascent, pc->descent, pc->attributes, - s ? s : "."); + char *s = XKeysymToString((KeySym) n); + + printf("\t0x%02x%02x (%u)\t%4d %4d %4d %4d %4d 0x%04x %s\n", + j, i, n, pc->width, pc->lbearing, + pc->rbearing, pc->ascent, pc->descent, pc->attributes, + s ? s : "."); pc++; n++; } @@ -616,47 +624,45 @@ print_character_metrics(register XFontSt } } -static -void do_query_font (Display *dpy, char *name) +static void +do_query_font(Display *display, char *name) { register int i; - register XFontStruct *info = XLoadQueryFont (dpy, name); + register XFontStruct *info = XLoadQueryFont(display, name); if (!info) { - fprintf (stderr, "%s: unable to get info about font \"%s\"\n", - program_name, name); + fprintf(stderr, "%s: unable to get info about font \"%s\"\n", + program_name, name); return; } - printf ("name: %s\n", name ? name : "(nil)"); - printf (" direction:\t\t%s\n", ((info->direction == FontLeftToRight) - ? "left to right" : "right to left")); - printf (" indexing:\t\t%s\n", - ((info->min_byte1 == 0 && info->max_byte1 == 0) ? "linear" : - "matrix")); - printf (" rows:\t\t\t0x%02x thru 0x%02x (%d thru %d)\n", - info->min_byte1, info->max_byte1, - info->min_byte1, info->max_byte1); - printf (" columns:\t\t0x%02x thru 0x%02x (%d thru %d)\n", - info->min_char_or_byte2, info->max_char_or_byte2, - info->min_char_or_byte2, info->max_char_or_byte2); - printf (" all chars exist:\t%s\n", - (info->all_chars_exist) ? "yes" : "no"); - printf (" default char:\t\t0x%04x (%d)\n", - info->default_char, info->default_char); - printf (" ascent:\t\t%d\n", info->ascent); - printf (" descent:\t\t%d\n", info->descent); - ComputeFontType (info); - printf (" bounds:\t\t%s", bounds_metrics_title); - PrintBounds ("min", &info->min_bounds); - PrintBounds ("max", &info->max_bounds); - if (info->per_char && long_list >= L_VERYLONG) - print_character_metrics (info); - printf (" properties:\t\t%d\n", info->n_properties); + printf("name: %s\n", name ? name : "(nil)"); + printf(" direction:\t\t%s\n", ((info->direction == FontLeftToRight) + ? "left to right" : "right to left")); + printf(" indexing:\t\t%s\n", + ((info->min_byte1 == 0 && info->max_byte1 == 0) + ? "linear" : "matrix")); + printf(" rows:\t\t\t0x%02x thru 0x%02x (%d thru %d)\n", + info->min_byte1, info->max_byte1, + info->min_byte1, info->max_byte1); + printf(" columns:\t\t0x%02x thru 0x%02x (%d thru %d)\n", + info->min_char_or_byte2, info->max_char_or_byte2, + info->min_char_or_byte2, info->max_char_or_byte2); + printf(" all chars exist:\t%s\n", + (info->all_chars_exist) ? "yes" : "no"); + printf(" default char:\t\t0x%04x (%d)\n", + info->default_char, info->default_char); + printf(" ascent:\t\t%d\n", info->ascent); + printf(" descent:\t\t%d\n", info->descent); + ComputeFontType(info); + printf(" bounds:\t\t%s", bounds_metrics_title); + PrintBounds("min", &info->min_bounds); + PrintBounds("max", &info->max_bounds); + if (info->per_char && long_list >= L_VERYLONG) + print_character_metrics(info); + printf(" properties:\t\t%d\n", info->n_properties); for (i = 0; i < info->n_properties; i++) - PrintProperty (&info->properties[i]); - printf ("\n"); + PrintProperty(&info->properties[i]); + printf("\n"); - XFreeFontInfo (NULL, info, 1); + XFreeFontInfo(NULL, info, 1); } - - Added files: Index: xsrc/external/mit/xedit/dist/compile diff -u /dev/null xsrc/external/mit/xedit/dist/compile:1.3 --- /dev/null Mon Jul 11 08:42:43 2022 +++ xsrc/external/mit/xedit/dist/compile Mon Jul 11 08:42:42 2022 @@ -0,0 +1,348 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# Written by Tom Tromey <tro...@cygnus.com>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-autom...@gnu.org> or send patches to +# <automake-patc...@gnu.org>. + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/* | msys/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to <bug-autom...@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: