Module Name: xsrc Committed By: mrg Date: Sun Mar 9 23:18:49 UTC 2025
Modified Files: xsrc/external/mit/xterm/dist: fontutils.c graphics_sixel.c linedata.c misc.c ptyx.h resize.c scrollback.c xterm.h xterm.man xsrc/external/mit/xterm/include: xtermcfg.h Removed Files: xsrc/external/mit/xterm/dist: AAA_README_VMS.txt README.os390 link_axp.com make.com vms.c vms.h xterm.dat xterm_axp.opt xsrc/external/mit/xterm/dist/package/freebsd: pkg-message Log Message: merge xterm 397. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r0 xsrc/external/mit/xterm/dist/AAA_README_VMS.txt \ xsrc/external/mit/xterm/dist/README.os390 \ xsrc/external/mit/xterm/dist/link_axp.com \ xsrc/external/mit/xterm/dist/make.com \ xsrc/external/mit/xterm/dist/xterm_axp.opt cvs rdiff -u -r1.14 -r1.15 xsrc/external/mit/xterm/dist/fontutils.c cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/xterm/dist/graphics_sixel.c cvs rdiff -u -r1.11 -r1.12 xsrc/external/mit/xterm/dist/linedata.c cvs rdiff -u -r1.26 -r1.27 xsrc/external/mit/xterm/dist/misc.c cvs rdiff -u -r1.21 -r1.22 xsrc/external/mit/xterm/dist/ptyx.h cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/xterm/dist/resize.c cvs rdiff -u -r1.9 -r1.10 xsrc/external/mit/xterm/dist/scrollback.c \ xsrc/external/mit/xterm/dist/xterm.h cvs rdiff -u -r1.1.1.6 -r0 xsrc/external/mit/xterm/dist/vms.c cvs rdiff -u -r1.1.1.4 -r0 xsrc/external/mit/xterm/dist/vms.h cvs rdiff -u -r1.1.1.3 -r0 xsrc/external/mit/xterm/dist/xterm.dat cvs rdiff -u -r1.23 -r1.24 xsrc/external/mit/xterm/dist/xterm.man cvs rdiff -u -r1.1.1.1 -r0 \ xsrc/external/mit/xterm/dist/package/freebsd/pkg-message cvs rdiff -u -r1.21 -r1.22 xsrc/external/mit/xterm/include/xtermcfg.h 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/xterm/dist/fontutils.c diff -u xsrc/external/mit/xterm/dist/fontutils.c:1.14 xsrc/external/mit/xterm/dist/fontutils.c:1.15 --- xsrc/external/mit/xterm/dist/fontutils.c:1.14 Thu Jul 4 09:09:18 2024 +++ xsrc/external/mit/xterm/dist/fontutils.c Sun Mar 9 23:18:48 2025 @@ -1,4 +1,4 @@ -/* $XTermId: fontutils.c,v 1.782 2024/05/17 19:54:51 tom Exp $ */ +/* $XTermId: fontutils.c,v 1.787 2024/12/01 20:29:42 tom Exp $ */ /* * Copyright 1998-2023,2024 by Thomas E. Dickey @@ -74,20 +74,20 @@ #define CI_GET_CHAR_INFO_1D(fs,col,cs) \ { \ - cs = 0; \ + cs = NULL; \ if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ if (fs->per_char == NULL) { \ cs = &fs->min_bounds; \ } else { \ cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \ } \ - if (CI_NONEXISTCHAR(cs)) cs = 0; \ + if (CI_NONEXISTCHAR(cs)) cs = NULL; \ } \ } #define CI_GET_CHAR_INFO_2D(fs,row,col,cs) \ { \ - cs = 0; \ + cs = NULL; \ if (row >= fs->min_byte1 && row <= fs->max_byte1 && \ col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ if (fs->per_char == NULL) { \ @@ -98,14 +98,14 @@ fs->min_char_or_byte2 + 1)) + \ (col - fs->min_char_or_byte2)]; \ } \ - if (CI_NONEXISTCHAR(cs)) cs = 0; \ + if (CI_NONEXISTCHAR(cs)) cs = NULL; \ } \ } #define FREE_FNAME(field) \ - if (fonts == 0 || new_fnames.field != fonts->field) { \ + if (fonts == NULL || new_fnames.field != fonts->field) { \ FREE_STRING(new_fnames.field); \ - new_fnames.field = 0; \ + new_fnames.field = NULL; \ } /* @@ -217,7 +217,7 @@ countGlyphs(XFontStruct *fp) { unsigned count = 0; - if (fp != 0) { + if (fp != NULL) { if (fp->min_byte1 == 0 && fp->max_byte1 == 0) { count = fp->max_char_or_byte2 - fp->min_char_or_byte2 + 1; } else if (fp->min_char_or_byte2 < 256 @@ -266,7 +266,7 @@ setupPackedFonts(XtermWidget xw) for (e = 0; e < fMAX; ++e) { XTermXftFonts *data = getMyXftFont(xw, e, screen->menu_font_number); - if (data != 0) { + if (data != NULL) { if (data->font_info.mixed) { screen->allow_packing = True; break; @@ -295,7 +295,7 @@ is_derived_font_name(const char *name) Boolean result = False; NameList *list; if (!IsEmpty(name)) { - for (list = derived_fonts; list != 0; list = list->next) { + for (list = derived_fonts; list != NULL; list = list->next) { if (!x_strcasecmp(name, list->name)) { result = True; break; @@ -333,16 +333,16 @@ n_fields(char **source, int start, int s * find the start-1th dash */ for (i = start - 1, str = *source; i; i--, str++) { - if ((str = strchr(str, '-')) == 0) - return 0; + if ((str = strchr(str, '-')) == NULL) + return NULL; } /* * find the stopth dash */ for (i = stop - start + 1, str1 = str; i; i--, str1++) { - if ((str1 = strchr(str1, '-')) == 0) - return 0; + if ((str1 = strchr(str1, '-')) == NULL) + return NULL; } /* @@ -393,7 +393,7 @@ get_font_name_props(Display *dpy, XFontS /* * first get the full font name */ - name = 0; + name = NULL; fontatom = CachedInternAtom(dpy, "FONT"); if (fontatom != 0) { XFontProp *fp; @@ -407,8 +407,8 @@ get_font_name_props(Display *dpy, XFontS } } - if (name == 0) - return 0; + if (name == NULL) + return NULL; /* * XGetAtomName allocates memory - don't leak @@ -416,9 +416,9 @@ get_font_name_props(Display *dpy, XFontS XFree(last_name); last_name = name; - if (result != 0) { + if (result != NULL) { if (!check_fontname(name)) - return 0; + return NULL; free(*result); *result = x_strdup(name); } @@ -430,56 +430,56 @@ get_font_name_props(Display *dpy, XFontS */ /* registry, foundry, family */ - if ((props.beginning = n_fields(&name, 1, 3)) == 0) - return 0; + if ((props.beginning = n_fields(&name, 1, 3)) == NULL) + return NULL; /* weight is the next */ - if ((props.weight = n_fields(&name, 1, 1)) == 0) - return 0; + if ((props.weight = n_fields(&name, 1, 1)) == NULL) + return NULL; /* slant */ - if ((props.slant = n_fields(&name, 1, 1)) == 0) - return 0; + if ((props.slant = n_fields(&name, 1, 1)) == NULL) + return NULL; /* width */ - if ((props.wideness = n_fields(&name, 1, 1)) == 0) - return 0; + if ((props.wideness = n_fields(&name, 1, 1)) == NULL) + return NULL; /* add style */ - if ((props.add_style = n_fields(&name, 1, 1)) == 0) - return 0; + if ((props.add_style = n_fields(&name, 1, 1)) == NULL) + return NULL; /* pixel size */ - if ((str = n_fields(&name, 1, 1)) == 0) - return 0; + if ((str = n_fields(&name, 1, 1)) == NULL) + return NULL; if ((props.pixel_size = atoi(str)) == 0) - return 0; + return NULL; /* point size */ - if ((props.point_size = n_fields(&name, 1, 1)) == 0) - return 0; + if ((props.point_size = n_fields(&name, 1, 1)) == NULL) + return NULL; /* res_x */ - if ((str = n_fields(&name, 1, 1)) == 0) - return 0; + if ((str = n_fields(&name, 1, 1)) == NULL) + return NULL; if ((props.res_x = atoi(str)) == 0) - return 0; + return NULL; /* res_y */ - if ((str = n_fields(&name, 1, 1)) == 0) - return 0; + if ((str = n_fields(&name, 1, 1)) == NULL) + return NULL; if ((props.res_y = atoi(str)) == 0) - return 0; + return NULL; /* spacing */ - if ((props.spacing = n_fields(&name, 1, 1)) == 0) - return 0; + if ((props.spacing = n_fields(&name, 1, 1)) == NULL) + return NULL; /* average width */ - if ((str = n_fields(&name, 1, 1)) == 0) - return 0; + if ((str = n_fields(&name, 1, 1)) == NULL) + return NULL; if ((props.average_width = atoi(str)) == 0) - return 0; + return NULL; /* the rest: charset registry and charset encoding */ props.end = name; @@ -492,8 +492,8 @@ get_font_name_props(Display *dpy, XFontS static void alloca_fontname(char **result, size_t next) { - size_t last = (*result != 0) ? strlen(*result) : 0; - size_t have = (*result != 0) ? ALLOCHUNK(last) : 0; + size_t last = (*result != NULL) ? strlen(*result) : 0; + size_t have = (*result != NULL) ? ALLOCHUNK(last) : 0; size_t want = last + next + 2; if (want >= have) { @@ -501,10 +501,10 @@ alloca_fontname(char **result, size_t ne want = ALLOCHUNK(want); if (last != 0) { *result = TypeRealloc(char, want, *result); - if (*result == 0) + if (*result == NULL) free(save); } else { - if ((*result = TypeMallocN(char, want)) != 0) { + if ((*result = TypeMallocN(char, want)) != NULL) { free(save); **result = '\0'; } @@ -515,10 +515,10 @@ alloca_fontname(char **result, size_t ne static void append_fontname_str(char **result, const char *value) { - if (value == 0) + if (value == NULL) value = "*"; alloca_fontname(result, strlen(value)); - if (*result != 0) { + if (*result != NULL) { if (**result != '\0') strcat(*result, "-"); strcat(*result, value); @@ -549,13 +549,13 @@ derive_font_name(FontNameProperties *pro int use_average_width, const char *use_encoding) { - char *result = 0; + char *result = NULL; append_fontname_str(&result, props->beginning); append_fontname_str(&result, use_weight); append_fontname_str(&result, props->slant); - append_fontname_str(&result, 0); - append_fontname_str(&result, 0); + append_fontname_str(&result, NULL); + append_fontname_str(&result, NULL); append_fontname_num(&result, props->pixel_size); append_fontname_str(&result, props->point_size); append_fontname_num(&result, props->res_x); @@ -597,11 +597,11 @@ open_italic_font(XtermWidget xw, int n, NoFontWarning(data); for (pass = 0; pass < XtNumber(slant); ++pass) { char *name; - if ((name = italic_font_name(fp, slant[pass])) != 0) { + if ((name = italic_font_name(fp, slant[pass])) != NULL) { TRACE(("open_italic_font %s %s\n", whichFontEnum((VTFontEnum) n), name)); if (xtermOpenFont(xw, name, data, NULL, False)) { - result = (data->fs != 0); + result = (data->fs != NULL); #if OPT_REPORT_FONTS if (resource.reportFonts) { ReportFonts("opened italic version of %s:\n\t%s\n", @@ -618,7 +618,7 @@ open_italic_font(XtermWidget xw, int n, #if OPT_TRACE if (result) { XFontStruct *fs = data->fs; - if (fs != 0) { + if (fs != NULL) { TRACE(("...actual size %dx%d (ascent %d, descent %d)\n", fs->ascent + fs->descent, @@ -666,15 +666,15 @@ xtermSpecialFont(XTermDraw * params) static FontNameProperties old_props; #endif FontNameProperties *props; - char *result = 0; + char *result = NULL; const char *weight; int pixel_size; int res_x; int res_y; props = get_font_name_props(screen->display, - GetNormalFont(screen, fNorm)->fs, 0); - if (props == 0) + GetNormalFont(screen, fNorm)->fs, NULL); + if (props == NULL) return result; pixel_size = props->pixel_size; @@ -723,7 +723,7 @@ xtermSpecialFont(XTermDraw * params) append_fontname_num(&result, (params->draw_flags & NORESOLUTION) ? -1 : res_x); append_fontname_num(&result, (params->draw_flags & NORESOLUTION) ? -1 : res_y); append_fontname_str(&result, props->spacing); - append_fontname_str(&result, 0); + append_fontname_str(&result, NULL); append_fontname_str(&result, props->end); xtermDerivedFont(result); @@ -779,10 +779,10 @@ same_font_name(const char *pattern, cons static int got_bold_font(Display *dpy, XFontStruct *fs, String requested) { - char *actual = 0; + char *actual = NULL; int got; - if (get_font_name_props(dpy, fs, &actual) == 0) + if (get_font_name_props(dpy, fs, &actual) == NULL) got = 0; else got = same_font_name(requested, actual); @@ -800,7 +800,7 @@ comparable_metrics(XFontStruct *normal, #define DATA "comparable_metrics: " int result = 0; - if (normal == 0 || bold == 0) { + if (normal == NULL || bold == NULL) { ; } else if (normal->all_chars_exist) { if (bold->all_chars_exist) { @@ -808,8 +808,8 @@ comparable_metrics(XFontStruct *normal, } else { TRACE((DATA "all chars exist in normal font, but not in bold\n")); } - } else if (normal->per_char != 0) { - if (bold->per_char != 0) { + } else if (normal->per_char != NULL) { + if (bold->per_char != NULL) { result = 1; } else { TRACE((DATA "normal font has per-char metrics, but not bold\n")); @@ -833,7 +833,7 @@ same_font_size(XtermWidget xw, XFontStru TScreen *screen = TScreenOf(xw); int result = 0; - if (nfs != 0 && bfs != 0) { + if (nfs != NULL && bfs != NULL) { TRACE(("same_font_size height %d/%d, min %d/%d max %d/%d\n", nfs->ascent + nfs->descent, bfs->ascent + bfs->descent, @@ -950,7 +950,7 @@ is_double_width_font_xft(Display *dpy, X #define is_double_width_font_xft(dpy, xftfont) 0 #endif -#define EmptyFont(fs) (fs != 0 \ +#define EmptyFont(fs) (fs != NULL \ && ((fs)->ascent + (fs)->descent == 0 \ || (fs)->max_bounds.width == 0)) @@ -985,9 +985,9 @@ defaultVTFontNames(XtermWidget xw) static void cache_menu_font_name(TScreen *screen, int fontnum, int which, const char *name) { - if (name != 0) { + if (name != NULL) { String last = screen->menu_font_names[fontnum][which]; - if (last != 0) { + if (last != NULL) { if (strcmp(last, name)) { FREE_STRING(last); TRACE(("caching menu fontname %d.%d %s\n", fontnum, which, name)); @@ -1016,12 +1016,12 @@ cannotFont(XtermWidget xw, const char *w case fwAlways: break; } - for (list = reported; list != 0; list = list->next) { + for (list = reported; list != NULL; list = list->next) { if (!x_strcasecmp(name, list->name)) { return; } } - if ((list = TypeMalloc(NameList)) != 0) { + if ((list = TypeMalloc(NameList)) != NULL) { list->name = x_strdup(name); list->next = reported; reported = list; @@ -1084,7 +1084,7 @@ xtermOpenFont(XtermWidget xw, && current->fs != NULL && current->fn != NULL); - if ((result->fs = xtermLoadQueryFont(xw, name)) != 0) { + if ((result->fs = xtermLoadQueryFont(xw, name)) != NULL) { code = True; if (EmptyFont(result->fs)) { xtermCloseFont(xw, result); @@ -1122,7 +1122,7 @@ xtermOpenFont(XtermWidget xw, void xtermCloseFont(XtermWidget xw, XTermFonts * fnt) { - if (fnt != 0 && fnt->fs != 0) { + if (fnt != NULL && fnt->fs != NULL) { TScreen *screen = TScreenOf(xw); clrCgsFonts(xw, WhichVWin(screen), fnt); @@ -1139,7 +1139,7 @@ xtermCloseFont2(XtermWidget xw, XTermFon { XFontStruct *thisFont = fnts[which].fs; - if (thisFont != 0) { + if (thisFont != NULL) { int k; xtermCloseFont(xw, &fnts[which]); @@ -1187,7 +1187,7 @@ xtermFreeFontInfo(XTermFonts * target) target->chrset = 0; target->flags = 0; FreeAndNull(target->fn); - target->fs = 0; + target->fs = NULL; } #if OPT_REPORT_FONTS @@ -1203,10 +1203,95 @@ reportXCharStruct(const char *tag, XChar } static void +fillXCharStruct(XCharStruct * cs, short value) +{ + cs->lbearing = value; + cs->rbearing = value; + cs->width = value; + cs->ascent = value; + cs->descent = value; +} + +/* if the per-character data differs from the summary, that is a problem */ +static void +compareXCharStruct(const char *tag, XCharStruct * actual, XCharStruct * expect) +{ +#define CompareXCharStruct(field) \ + if (actual->field != expect->field) \ + ReportFonts("\t\t%s %s differs: %d\n", tag, #field, actual->field) + CompareXCharStruct(lbearing); + CompareXCharStruct(rbearing); + CompareXCharStruct(width); + CompareXCharStruct(ascent); + CompareXCharStruct(descent); +} + +static void +reportXPerChar(XFontStruct *fs) +{ + XCharStruct *cs = fs->per_char; + + if (cs != NULL) { + XCharStruct min_bounds; + XCharStruct max_bounds; + int valid = 0; + int total = 0; + unsigned first_char = 0; + unsigned last_char = 0; + unsigned ch; + + if (fs->max_byte1 == 0) { + first_char = fs->min_char_or_byte2; + last_char = fs->max_char_or_byte2; + } else { + first_char = (fs->min_byte1 * 256) + fs->min_char_or_byte2; + last_char = (fs->max_byte1 * 256) + fs->max_char_or_byte2; + } + + fillXCharStruct(&max_bounds, -32768); + fillXCharStruct(&min_bounds, 32767); + TRACE2(("\t\tCells: %d..%d\n", first_char, last_char)); + for (ch = first_char; ch < last_char; ++ch) { + XCharStruct *item = cs + ch - first_char; + ++total; + if (!CI_NONEXISTCHAR(item)) { + ++valid; +#define MIN_BOUNDS(field) min_bounds.field = Min(min_bounds.field, item->field) + MIN_BOUNDS(lbearing); + MIN_BOUNDS(rbearing); + MIN_BOUNDS(width); + MIN_BOUNDS(ascent); + MIN_BOUNDS(descent); +#define MAX_BOUNDS(field) max_bounds.field = Max(max_bounds.field, item->field) + MAX_BOUNDS(lbearing); + MAX_BOUNDS(rbearing); + MAX_BOUNDS(width); + MAX_BOUNDS(ascent); + MAX_BOUNDS(descent); + TRACE2(("\t\t\t%d: cell [%d .. %d] wide %d high %d / %d\n", + ch, + item->lbearing, + item->rbearing, + item->width, + item->ascent, + item->descent)); + } else { + TRACE(("\t\t\t%d: cell missing\n", ch)); + } + } + ReportFonts("\t\tPer-character: %d/%d\n", valid, total); + compareXCharStruct("Max", &max_bounds, &(fs->max_bounds)); + compareXCharStruct("Min", &min_bounds, &(fs->min_bounds)); + } else { + ReportFonts("\t\tPer-character: none\n"); + } +} + +static void reportOneVTFont(const char *tag, XTermFonts * fnt) { - if (!IsEmpty(fnt->fn) && fnt->fs != 0) { + if (!IsEmpty(fnt->fn) && fnt->fs != NULL) { XFontStruct *fs = fnt->fs; unsigned first_char = 0; unsigned last_char = 0; @@ -1249,7 +1334,8 @@ reportOneVTFont(const char *tag, ReportFonts("\t\tproperties: %d\n", fs->n_properties); reportXCharStruct("min_bounds", &(fs->min_bounds)); reportXCharStruct("max_bounds", &(fs->max_bounds)); - /* TODO: report fs->properties and fs->per_char */ + reportXPerChar(fs); + /* TODO: report fs->properties */ } } @@ -1265,11 +1351,12 @@ reportVTFontInfo(XtermWidget xw, int fon ReportFonts("Loaded VTFonts(default)\n"); } - reportOneVTFont("fNorm", GetNormalFont(screen, fNorm)); - reportOneVTFont("fBold", GetNormalFont(screen, fBold)); +#define ReportOneVTFont(name) reportOneVTFont(#name, screen->fnts + name) + ReportOneVTFont(fNorm); + ReportOneVTFont(fBold); #if OPT_WIDE_CHARS - reportOneVTFont("fWide", GetNormalFont(screen, fWide)); - reportOneVTFont("fWBold", GetNormalFont(screen, fWBold)); + ReportOneVTFont(fWide); + ReportOneVTFont(fWBold); #endif } } @@ -1300,8 +1387,8 @@ xtermUpdateFontGCs(XtermWidget xw, MyGet if_OPT_WIDE_CHARS(screen, { XTermFonts *wide_xx = myfunc(screen, fWide); XTermFonts *bold_xx = myfunc(screen, fWBold); - if (wide_xx->fs != 0 - && bold_xx->fs != 0) { + if (wide_xx->fs != NULL + && bold_xx->fs != NULL) { setCgsFore(xw, win, gcWide, new_normal); setCgsBack(xw, win, gcWide, new_revers); setCgsFont(xw, win, gcWide, wide_xx); @@ -1342,7 +1429,7 @@ xtermUpdateItalics(XtermWidget xw, unsig static void show_font_misses(const char *name, XTermFonts * fp) { - if (fp->fs != 0) { + if (fp->fs != NULL) { if (FontLacksMetrics(fp)) { TRACE(("%s font lacks metrics\n", name)); } else if (FontIsIncomplete(fp)) { @@ -1402,7 +1489,7 @@ loadBoldFP(XtermWidget xw, char *normal = x_strdup(nameRef); fp = get_font_name_props(screen->display, infoRef->fs, &normal); - if (fp != 0) { + if (fp != NULL) { NoFontWarning(infoOut); *nameOutP = bold_font_name(fp, fp->average_width); if (!xtermOpenFont(xw, *nameOutP, infoOut, NULL, False)) { @@ -1412,7 +1499,7 @@ loadBoldFP(XtermWidget xw, } TRACE(("...derived bold '%s'\n", NonNull(*nameOutP))); } - if (fp == 0 || infoOut->fs == 0) { + if (fp == NULL || infoOut->fs == NULL) { xtermCopyFontInfo(infoOut, infoRef); TRACE(("...cannot load a matching bold font\n")); } else if (comparable_metrics(infoRef->fs, infoOut->fs) @@ -1472,7 +1559,7 @@ loadWideFP(XtermWidget xw, char *normal = x_strdup(nameRef); FontNameProperties *fp = get_font_name_props(screen->display, infoRef->fs, &normal); - if (fp != 0) { + if (fp != NULL) { *nameOutP = wide_font_name(fp); NoFontWarning(infoOut); } @@ -1485,7 +1572,7 @@ loadWideFP(XtermWidget xw, && EmptyFont(infoOut->fs)) { xtermCloseFont2(xw, infoOut - fWide, fWide); } - if (infoOut->fs == 0) { + if (infoOut->fs == NULL) { xtermCopyFontInfo(infoOut, infoRef); } else { TRACE(("...%s wide %s\n", @@ -1525,7 +1612,7 @@ loadWBoldFP(XtermWidget xw, if (!check_fontname(*nameOutP)) { FontNameProperties *fp; fp = get_font_name_props(screen->display, boldInfoRef->fs, &bold); - if (fp != 0) { + if (fp != NULL) { *nameOutP = widebold_font_name(fp); NoFontWarning(infoOut); } @@ -1539,7 +1626,7 @@ loadWBoldFP(XtermWidget xw, xtermCloseFont2(xw, infoOut - fWBold, fWBold); } - if (infoOut->fs == 0) { + if (infoOut->fs == NULL) { if (is_derived_font_name(*nameOutP)) free(*nameOutP); if (IsEmpty(wideNameRef)) { @@ -1611,14 +1698,14 @@ xtermLoadFont(XtermWidget xw, memset(new_fonts, 0, sizeof(new_fonts)); memcpy(&old_fonts, screen->fnts, sizeof(old_fonts)); - if (fonts != 0) + if (fonts != NULL) new_fnames = *fonts; if (!check_fontname(new_fnames.f_n)) return code; if (fontnum == fontMenu_fontescape && new_fnames.f_n != screen->MenuFontName(fontnum)) { - if ((tmpname = x_strdup(new_fnames.f_n)) == 0) + if ((tmpname = x_strdup(new_fnames.f_n)) == NULL) return code; } @@ -1683,8 +1770,8 @@ xtermLoadFont(XtermWidget xw, * Normal/bold fonts should be the same width. Also, the min/max * values should be the same. */ - if (new_fonts[fNorm].fs != 0 - && new_fonts[fBold].fs != 0 + if (new_fonts[fNorm].fs != NULL + && new_fonts[fBold].fs != NULL && (!is_fixed_font(new_fonts[fNorm].fs) || !is_fixed_font(new_fonts[fBold].fs) || differing_widths(new_fonts[fNorm].fs, new_fonts[fBold].fs))) { @@ -1697,8 +1784,8 @@ xtermLoadFont(XtermWidget xw, } if_OPT_WIDE_CHARS(screen, { - if (new_fonts[fWide].fs != 0 - && new_fonts[fWBold].fs != 0 + if (new_fonts[fWide].fs != NULL + && new_fonts[fWBold].fs != NULL && (!is_fixed_font(new_fonts[fWide].fs) || !is_fixed_font(new_fonts[fWBold].fs) || differing_widths(new_fonts[fWide].fs, new_fonts[fWBold].fs))) { @@ -1931,11 +2018,11 @@ xtermLoadItalics(XtermWidget xw) /* * FIXME - need to handle font-leaks */ - data->fs = 0; - if (getNormalFont(screen, n)->fs != 0 && + data->fs = NULL; + if (getNormalFont(screen, n)->fs != NULL && (fp = get_font_name_props(screen->display, getNormalFont(screen, n)->fs, - 0)) != 0) { + NULL)) != NULL) { if (!open_italic_font(xw, n, fp, data)) { if (n > 0) { xtermCopyFontInfo(data, @@ -1987,7 +2074,7 @@ xtermLoadItalics(XtermWidget xw) for (n = fontMenu_default; n <= fontMenu_lastBuiltin; ++n) { \ for (m = 0; m < fMAX; ++m) { \ FREE_STRING(dst.menu_font_names[n][m]); \ - dst.menu_font_names[n][m] = 0; \ + dst.menu_font_names[n][m] = NULL; \ } \ } @@ -2341,7 +2428,7 @@ HandleLoadVTFonts(Widget w, { XtermWidget xw; - if ((xw = getXtermWidget(w)) != 0) { + if ((xw = getXtermWidget(w)) != NULL) { static char empty[] = ""; /* appease strict compilers */ TScreen *screen = TScreenOf(xw); @@ -2350,13 +2437,13 @@ HandleLoadVTFonts(Widget w, char *myName = MyStackAlloc(strlen(name) + 1, name_buf); TRACE(("HandleLoadVTFonts(%d)\n", *param_count)); - if (myName != 0) { + if (myName != NULL) { char class_buf[80]; String convert = (String) ((*param_count > 1) ? params[1] : myName); char *myClass = MyStackAlloc(strlen(convert) + 1, class_buf); strcpy(myName, name); - if (myClass != 0) { + if (myClass != NULL) { strcpy(myClass, convert); if (*param_count == 1) myClass[0] = x_toupper(myClass[0]); @@ -2576,7 +2663,7 @@ static Boolean isBogusXft(XftFont *font) { Boolean result = False; - if (font != 0) { + if (font != NULL) { FcBool fcbogus; if (GetFcBool(font->pattern, FC_COLOR) && fcbogus) { TRACE(("...matched color-bitmap font\n")); @@ -2747,7 +2834,7 @@ nameOfXftFont(XftFont *fp) if (XftNameUnparse(fp->pattern, buffer, (int) sizeof(buffer))) { char *target; char *source = buffer; - if ((target = strtok(source, ":")) != 0) { + if ((target = strtok(source, ":")) != NULL) { result = x_strdup(target); } } @@ -2788,9 +2875,9 @@ reportXftFonts(XtermWidget xw, if (XftNameUnparse(match, buffer, (int) sizeof(buffer))) { char *target; char *source = buffer; - while ((target = strtok(source, ":")) != 0) { + while ((target = strtok(source, ":")) != NULL) { ReportFonts("\t%s\n", target); - source = 0; + source = NULL; } } fflush(stdout); @@ -2858,13 +2945,13 @@ maybeXftCache(XtermWidget xw, XftFont *f void closeCachedXft(TScreen *screen, XftFont *font) { - if (font != 0) { + if (font != NULL) { ListXftFonts *p, *q; - for (p = screen->list_xft_fonts, q = 0; p != 0; q = p, p = p->next) { + for (p = screen->list_xft_fonts, q = NULL; p != NULL; q = p, p = p->next) { if (p->font == font) { XftFontClose(screen->display, font); - if (q != 0) { + if (q != NULL) { q->next = p->next; } else { screen->list_xft_fonts = p->next; @@ -2887,17 +2974,17 @@ xtermOpenXft(XtermWidget xw, TScreen *screen = TScreenOf(xw); Display *dpy = screen->display; XftResult status; - XftFont *result = 0; + XftFont *result = NULL; TRACE(("xtermOpenXft(name=%s, tag=%s)\n", name, tag)); - if (pat != 0 && (fontNum <= MaxXftCache)) { + if (pat != NULL && (fontNum <= MaxXftCache)) { XftPattern *match; FcConfigSubstitute(NULL, pat, FcMatchPattern); XftDefaultSubstitute(dpy, DefaultScreen(dpy), pat); match = FcFontMatch(NULL, pat, &status); - if (match != 0) { + if (match != NULL) { Boolean maybeReopened = False; result = XftFontOpenPattern(dpy, match); #ifdef FC_COLOR @@ -3235,7 +3322,7 @@ setRenderFontsize(XtermWidget xw, VTwin TRACE(("...reduce width from %d to %d\n", width, width >> 1)); width >>= 1; } - if (tag == 0) { + if (tag == NULL) { SetFontWidth(screen, win, width); SetFontHeight(screen, win, height); win->f_ascent = ascent; @@ -3259,7 +3346,7 @@ setRenderFontsize(XtermWidget xw, VTwin TRACE(("setRenderFontsize %s unchanged\n", tag)); } #if OPT_BOX_CHARS - if (!screen->broken_box_chars && (tag == 0)) { + if (!screen->broken_box_chars && (tag == NULL)) { linedrawing_gaps(xw, data); } #endif @@ -3333,7 +3420,7 @@ void setFaceName(XtermWidget xw, const char *value) { TScreen *screen = TScreenOf(xw); - Boolean changed = (Boolean) ((CurrentXftFont(xw) == 0) + Boolean changed = (Boolean) ((CurrentXftFont(xw) == NULL) || strcmp(CurrentXftFont(xw), value)); if (changed) { @@ -3389,7 +3476,7 @@ xtermComputeFontInfo(XtermWidget xw, XTermXftFonts *wbtal = &(screen->renderWideBtal[fontnum]); #endif - if (XftFp(norm) == 0 && !IsEmpty(face_name)) { + if (XftFp(norm) == NULL && !IsEmpty(face_name)) { Work *work = &(xw->work); XftPattern *pat; double face_size; @@ -3467,7 +3554,7 @@ xtermComputeFontInfo(XtermWidget xw, #if OPT_WIDE_ATTRS #define HAVE_ITALICS 1 -#define FIND_ITALICS ((pat = XftNameParse(face_name)) != 0) +#define FIND_ITALICS ((pat = XftNameParse(face_name)) != NULL) #elif OPT_ISO_COLORS #define HAVE_ITALICS 1 #define FIND_ITALICS (screen->italicULMode && (pat = XftNameParse(face_name)) != 0) @@ -3478,7 +3565,7 @@ xtermComputeFontInfo(XtermWidget xw, #if OPT_DEC_CHRSET freeall_DoubleFT(xw); #endif - if ((pat = XftNameParse(face_name)) != 0) { + if ((pat = XftNameParse(face_name)) != NULL) { #define OPEN_XFT(data, tag) xtermOpenXft(xw, data, 0, face_name, data->pattern, tag) norm->pattern = XftPatternDuplicate(pat); XftPatternBuild(norm->pattern, @@ -3486,7 +3573,7 @@ xtermComputeFontInfo(XtermWidget xw, (void *) 0); OPEN_XFT(norm, "normal"); - if (XftFp(norm) != 0) { + if (XftFp(norm) != NULL) { bold->pattern = XftPatternDuplicate(pat); XftPatternBuild(bold->pattern, NormXftPattern, @@ -3524,7 +3611,7 @@ xtermComputeFontInfo(XtermWidget xw, CACHE_XFT(norm); CACHE_XFT(bold); - if (XftFp(norm) != 0 && !XftFp(bold)) { + if (XftFp(norm) != NULL && !XftFp(bold)) { noUsableXft(xw, "bold"); XftPatternDestroy(bold->pattern); bold->pattern = XftPatternDuplicate(pat); @@ -3537,7 +3624,7 @@ xtermComputeFontInfo(XtermWidget xw, } #if HAVE_ITALICS CACHE_XFT(ital); - if (XftFp(norm) != 0 && !XftFp(ital)) { + if (XftFp(norm) != NULL && !XftFp(ital)) { noUsableXft(xw, "italic"); XftPatternDestroy(ital->pattern); ital->pattern = XftPatternDuplicate(pat); @@ -3549,7 +3636,7 @@ xtermComputeFontInfo(XtermWidget xw, CACHE_XFT(ital); } CACHE_XFT(btal); - if (XftFp(norm) != 0 && !XftFp(btal)) { + if (XftFp(norm) != NULL && !XftFp(btal)) { noUsableXft(xw, "bold italic"); XftPatternDestroy(btal->pattern); btal->pattern = XftPatternDuplicate(pat); @@ -3571,7 +3658,7 @@ xtermComputeFontInfo(XtermWidget xw, * to have, but not essential. */ #if OPT_RENDERWIDE - if (XftFp(norm) != 0 && screen->wide_chars) { + if (XftFp(norm) != NULL && screen->wide_chars) { int char_width = XftFp(norm)->max_advance_width * 2; double aspect = ((FirstItemOf(xw->work.fonts.xft.list_w) || screen->renderFontNorm[fontnum].font_info.mixed) @@ -3591,14 +3678,14 @@ xtermComputeFontInfo(XtermWidget xw, FC_ASPECT, XftTypeDouble, aspect if (!IsEmpty(face_name) && (pat = XftNameParse(face_name)) - != 0) { + != NULL) { wnorm->pattern = XftPatternDuplicate(pat); XftPatternBuild(wnorm->pattern, WideXftPattern, (void *) 0); OPEN_XFT(wnorm, "wide"); - if (XftFp(wnorm) != 0) { + if (XftFp(wnorm) != NULL) { wbold->pattern = XftPatternDuplicate(pat); XftPatternBuild(wbold->pattern, WideXftPattern, @@ -3633,7 +3720,7 @@ xtermComputeFontInfo(XtermWidget xw, CACHE_XFT(wnorm); CACHE_XFT(wbold); - if (XftFp(wnorm) != 0 && !XftFp(wbold)) { + if (XftFp(wnorm) != NULL && !XftFp(wbold)) { noUsableXft(xw, "wide-bold"); XftPatternDestroy(wbold->pattern); wbold->pattern = XftPatternDuplicate(pat); @@ -3646,7 +3733,7 @@ xtermComputeFontInfo(XtermWidget xw, } CACHE_XFT(wital); - if (XftFp(wnorm) != 0 && !XftFp(wital)) { + if (XftFp(wnorm) != NULL && !XftFp(wital)) { noUsableXft(xw, "wide-italic"); XftPatternDestroy(wital->pattern); wital->pattern = XftPatternDuplicate(pat); @@ -3664,7 +3751,7 @@ xtermComputeFontInfo(XtermWidget xw, } #endif /* OPT_RENDERWIDE */ } - if (XftFp(norm) == 0) { + if (XftFp(norm) == NULL) { TRACE(("...no TrueType font found for number %d, disable menu entry\n", fontnum)); xw->work.render_font = False; update_font_renderfont(); @@ -3786,7 +3873,7 @@ xtermMissingChar(unsigned ch, XTermFonts { Bool result = False; XFontStruct *fs = font->fs; - XCharStruct *pc = 0; + XCharStruct *pc = NULL; if (fs == NULL) { result = True; @@ -3795,7 +3882,7 @@ xtermMissingChar(unsigned ch, XTermFonts if (ch < 256) #endif { - CI_GET_CHAR_INFO_1D(fs, E2A(ch), pc); + CI_GET_CHAR_INFO_1D(fs, ch, pc); } } #if OPT_WIDE_CHARS @@ -3806,7 +3893,7 @@ xtermMissingChar(unsigned ch, XTermFonts } #endif - if (pc == 0 || CI_NONEXISTCHAR(pc)) { + if (pc == NULL || CI_NONEXISTCHAR(pc)) { TRACE2(("xtermMissingChar %#04x (!exists)\n", ch)); result = True; } @@ -4031,14 +4118,14 @@ xtermDrawBoxChar(XTermDraw * params, const short *const data; } lines[] = { - { 0, 0 }, /* 00 (unused) */ - { 0, 0 }, /* 01 diamond */ - { 0, 0 }, /* 02 box */ + { 0, NULL }, /* 00 (unused) */ + { 0, NULL }, /* 01 diamond */ + { 0, NULL }, /* 02 box */ { 0, glyph_ht }, /* 03 HT */ { 0, glyph_ff }, /* 04 FF */ - { 0, 0 }, /* 05 CR */ + { 0, NULL }, /* 05 CR */ { 0, glyph_lf }, /* 06 LF */ - { 0, 0 }, /* 07 degrees (small circle) */ + { 0, NULL }, /* 07 degrees (small circle) */ { 3, plus_or_minus }, /* 08 */ { 0, glyph_nl }, /* 09 */ { 0, glyph_vt }, /* 0A */ @@ -4061,9 +4148,9 @@ xtermDrawBoxChar(XTermDraw * params, { 0, greater_than_or_equal }, /* 1B */ { 0, greek_pi }, /* 1C */ { 0, not_equal_to }, /* 1D */ - { 0, 0 }, /* 1E LB */ - { 0, 0 }, /* 1F bullet */ - { 0, 0 }, /* 20 space */ + { 0, NULL }, /* 1E LB */ + { 0, NULL }, /* 1F bullet */ + { 0, NULL }, /* 20 space */ { 3, sigma_1 }, /* PUA(0) */ { 3, sigma_2 }, /* PUA(1) */ { 3, sigma_3 }, /* PUA(2) */ @@ -4101,7 +4188,7 @@ xtermDrawBoxChar(XTermDraw * params, int which = (params->attr_flags & BOLD) ? fBold : fNorm; unsigned n; for (n = 1; n < 32; n++) { - if (xtermMissingChar(n, getNormalFont(screen, which))) + if (xtermMissingChar(n, XTermFontsRef(screen->fnts, which))) continue; if (dec2ucs(screen, n) != ch) continue; @@ -4240,7 +4327,7 @@ xtermDrawBoxChar(XTermDraw * params, 0, 360 * 64); } else if (ch < XtNumber(lines) - && (p = lines[ch].data) != 0) { + && (p = lines[ch].data) != NULL) { int coord[4]; int n = 0; while (*p >= 0) { @@ -4339,7 +4426,7 @@ foundXftGlyph(XtermWidget xw, XTermXftFo XftFont *font = XftFpN(data, fontNum); int result = 0; - if (font != 0) { + if (font != NULL) { if (!xtermXftMissing(xw, data, fontNum, font, wc)) { if (XftIsN(data, fontNum) == xcBogus) { @@ -4361,7 +4448,7 @@ markXftOpened(XtermWidget xw, XTermXftFo which->opened++; XftIsN(which, n) = xcOpened; /* XFT_DEBUG=3 will show useful context for this */ - if (getenv("XFT_DEBUG") != 0) { + if (getenv("XFT_DEBUG") != NULL) { printf("%s: matched U+%04X in fontset #%d [%u:%u]\n", ProgramName, wc, n + 1, @@ -4372,7 +4459,7 @@ markXftOpened(XtermWidget xw, XTermXftFo } static char ** -xftData2List(XtermWidget xw, XTermXftFonts *fontData) +xftData2List(XtermWidget xw, const XTermXftFonts *fontData) { TScreen *screen = TScreenOf(xw); VTFontList *lists = &xw->work.fonts.xft; @@ -4496,7 +4583,9 @@ findXftGlyph(XtermWidget xw, XTermXftFon fontData->fontset = FcFontSetCreate(); - if (fontData->fontset == 0 || !sortedFonts || sortedFonts->nfont <= 0) { + if (fontData->fontset == NULL + || !sortedFonts + || sortedFonts->nfont <= 0) { xtermWarning("did not find any usable TrueType font\n"); return 0; } @@ -4509,7 +4598,7 @@ findXftGlyph(XtermWidget xw, XTermXftFon && *++my_list != NULL) { for (j = 0; my_list[j] != NULL; ++j) { FcPattern *extraPattern; - if ((extraPattern = XftNameParse(my_list[j])) != 0) { + if ((extraPattern = XftNameParse(my_list[j])) != NULL) { FcPattern *match; match = mergeXftStyle(xw, extraPattern, fontData); @@ -4737,7 +4826,7 @@ ucs2dec(TScreen *screen, unsigned ch) if ((ch > 127) && !is_UCS_SPECIAL(ch)) { #if OPT_VT52_MODE - if (screen != 0 && !(screen->vtXX_level)) { + if (screen != NULL && !(screen->vtXX_level)) { /* * Intentionally empty: it would be possible to use the built-in * line-drawing fallback in xtermDrawBoxChar(), but for testing @@ -4795,7 +4884,7 @@ dec2ucs(TScreen *screen, unsigned ch) (void) screen; if (xtermIsDecGraphic(ch)) { #if OPT_VT52_MODE - if (screen != 0 && !(screen->vtXX_level)) { + if (screen != NULL && !(screen->vtXX_level)) { switch (ch) { MY_UCS(0x0020, 0); /* nbsp, treat as blank */ MY_UCS(0x0020, 1); /* reserved, treat as blank */ @@ -5134,7 +5223,7 @@ HandleLargerFont(Widget w, XtermWidget xw; TRACE(("Handle larger-vt-font for %p\n", (void *) w)); - if ((xw = getXtermWidget(w)) != 0) { + if ((xw = getXtermWidget(w)) != NULL) { if (xw->misc.shift_fonts) { TScreen *screen = TScreenOf(xw); int m; @@ -5159,7 +5248,7 @@ HandleSmallerFont(Widget w, XtermWidget xw; TRACE(("Handle smaller-vt-font for %p\n", (void *) w)); - if ((xw = getXtermWidget(w)) != 0) { + if ((xw = getXtermWidget(w)) != NULL) { if (xw->misc.shift_fonts) { TScreen *screen = TScreenOf(xw); int m; @@ -5235,7 +5324,7 @@ HandleSetFont(Widget w, { XtermWidget xw; - if ((xw = getXtermWidget(w)) != 0) { + if ((xw = getXtermWidget(w)) != NULL) { int fontnum; VTFontNames fonts; @@ -5318,7 +5407,7 @@ SetVTFont(XtermWidget xw, VTFontNames new_fnames; memset(&new_fnames, 0, sizeof(new_fnames)); - if (fonts != 0) + if (fonts != NULL) new_fnames = *fonts; if (which == fontMenu_fontsel) { /* go get the selection */ @@ -5384,7 +5473,7 @@ static void trimSizeFromFace(char *face_name, float *face_size) { char *first = strstr(face_name, ":size="); - if (first == 0) { + if (first == NULL) { first = face_name; } else { first++; @@ -5395,13 +5484,13 @@ trimSizeFromFace(char *face_name, float float value; char extra; TRACE(("...before trimming, font = \"%s\"\n", face_name)); - if (last == 0) + if (last == NULL) last = first + strlen(first); mark = *last; *last = '\0'; if (sscanf(first, "size=%g%c", &value, &extra) == 1) { TRACE(("...trimmed size from font: %g\n", value)); - if (face_size != 0) + if (face_size != NULL) *face_size = value; } if (mark) { @@ -5437,7 +5526,7 @@ save2FontList(XtermWidget xw, (void) xw; - if (source == 0) + if (source == NULL) source = ""; while (isspace(CharOf(*source))) ++source; @@ -5488,7 +5577,7 @@ save2FontList(XtermWidget xw, if (!marked) plen = 0; value = x_strtrim(source + plen); - if (value != 0) { + if (value != NULL) { Bool success = False; #if OPT_RENDERFONT VTFontList *target = (use_ttf @@ -5497,8 +5586,8 @@ save2FontList(XtermWidget xw, #else VTFontList *target = &(fontnames->x11); #endif - char ***list = 0; - char **next = 0; + char ***list = NULL; + char **next = NULL; size_t count = 0; (void) use_ttf; @@ -5532,14 +5621,14 @@ save2FontList(XtermWidget xw, break; #endif case fMAX: - list = 0; + list = NULL; break; } - if (list != 0) { + if (list != NULL) { success = True; - if (*list != 0) { - while ((*list)[count] != 0) { + if (*list != NULL) { + while ((*list)[count] != NULL) { if (IsEmpty((*list)[count])) { TRACE(("... initial %s\n", value)); free((*list)[count]); @@ -5554,7 +5643,7 @@ save2FontList(XtermWidget xw, } if (success) { next = (char **) realloc(*list, sizeof(char *) * (count + 2)); - if (next != 0) { + if (next != NULL) { #if OPT_RENDERFONT if (use_ttf) { trimSizeFromFace(value, @@ -5564,7 +5653,7 @@ save2FontList(XtermWidget xw, } #endif next[count++] = value; - next[count] = 0; + next[count] = NULL; *list = next; TRACE(("... saved \"%s\" \"%s\" %lu:\"%s\"\n", whichFontList(xw, target), @@ -5592,7 +5681,7 @@ save2FontList(XtermWidget xw, } if (list && *list) { free((*list)[limit]); - (*list)[limit] = 0; + (*list)[limit] = NULL; } } } else { @@ -5618,10 +5707,10 @@ allocFontList(XtermWidget xw, char *blob; blob = x_strdup(source); - if (blob != 0) { + if (blob != NULL) { int n; int pass; - char **list = 0; + char **list = NULL; TRACE(("allocFontList %s name=\"%s\" source=\"%s\"\n", whichFontEnum(which), name, blob)); @@ -5643,12 +5732,12 @@ allocFontList(XtermWidget xw, if (count == 0 && *blob == '\0') break; list = TypeCallocN(char *, count + 2); - if (list == 0) + if (list == NULL) break; } } if (list) { - for (n = 0; list[n] != 0; ++n) { + for (n = 0; list[n] != NULL; ++n) { if (*list[n]) { save2FontList(xw, name, target, which, list[n], True, ttf); } @@ -5692,12 +5781,12 @@ copyFontList(char ***targetp, char **sou { freeFontList(targetp); - if (source != 0) { + if (source != NULL) { int pass; size_t count; for (pass = 0; pass < 2; ++pass) { - for (count = 0; source[count] != 0; ++count) { + for (count = 0; source[count] != NULL; ++count) { if (pass) (*targetp)[count] = x_strdup(source[count]); } @@ -5717,7 +5806,7 @@ static Boolean merge_sublist(char ***targetp, char **source) { Boolean result = False; - if ((*targetp == 0 || IsEmpty(**targetp)) && !IsEmpty(*source)) { + if ((*targetp == NULL || IsEmpty(**targetp)) && !IsEmpty(*source)) { copyFontList(targetp, source); result = True; } @@ -5728,15 +5817,15 @@ merge_sublist(char ***targetp, char **so void freeFontList(char ***targetp) { - if (targetp != 0) { + if (targetp != NULL) { char **target = *targetp; - if (target != 0) { + if (target != NULL) { int n; - for (n = 0; target[n] != 0; ++n) { + for (n = 0; target[n] != NULL; ++n) { free(target[n]); } free(target); - *targetp = 0; + *targetp = NULL; } } } @@ -5748,7 +5837,7 @@ freeFontLists(VTFontList * lists) TRACE(("freeFontLists\n")); for (which = 0; which < fMAX; ++which) { - char ***target = 0; + char ***target = NULL; switch (which) { case fNorm: target = &(lists->list_n); @@ -5779,7 +5868,7 @@ freeFontLists(VTFontList * lists) break; #endif default: - target = 0; + target = NULL; break; } freeFontList(target); @@ -5793,7 +5882,7 @@ freeFontLists(VTFontList * lists) XTermFonts * getNormalFont(TScreen *screen, int which) { - XTermFonts *result = 0; + XTermFonts *result = NULL; if (which >= 0 && which < fMAX) result = GetNormalFont(screen, which); return result; @@ -5803,7 +5892,7 @@ getNormalFont(TScreen *screen, int which XTermFonts * getDoubleFont(TScreen *screen, int which) { - XTermFonts *result = 0; + XTermFonts *result = NULL; if ((int) which >= 0 && which < NUM_CHRSET) result = GetDoubleFont(screen, which); return result; @@ -5820,7 +5909,7 @@ getDoubleXftFont(XTermDraw * params, XTe const char *face_name = getFaceName(xw, False); if (chrset != CSET_SWL - && (top_pattern = XftNameParse(face_name)) != 0) { + && (top_pattern = XftNameParse(face_name)) != NULL) { double face_size = (double) xw->misc.face_size[fontnum]; XftPattern *sub_pattern = XftPatternDuplicate(top_pattern); const char *category = "doublesize"; @@ -5861,7 +5950,7 @@ getDoubleXftFont(XTermDraw * params, XTe XTermFonts * getItalicFont(TScreen *screen, int which) { - XTermFonts *result = 0; + XTermFonts *result = NULL; #if OPT_WIDE_ATTRS if (which >= 0 && which < fMAX) result = GetItalicFont(screen, which); @@ -5882,7 +5971,7 @@ XTermXftFonts * getMyXftFont(XtermWidget xw, int which, int fontnum) { TScreen *screen = TScreenOf(xw); - XTermXftFonts *result = 0; + XTermXftFonts *result = NULL; if (fontnum >= 0 && fontnum < NMENUFONTS) { switch ((VTFontEnum) which) { case fNorm: @@ -5921,7 +6010,7 @@ getMyXftFont(XtermWidget xw, int which, } const char * -whichXftFonts(XtermWidget xw, XTermXftFonts *data) +whichXftFonts(XtermWidget xw, const XTermXftFonts *data) { TScreen *screen = TScreenOf(xw); const char *result = "?"; @@ -5966,8 +6055,8 @@ XftFont * getXftFont(XtermWidget xw, VTFontEnum which, int fontnum) { XTermXftFonts *data = getMyXftFont(xw, (int) which, fontnum); - XftFont *result = 0; - if (data != 0) + XftFont *result = NULL; + if (data != NULL) result = XftFp(data); return result; } @@ -5998,7 +6087,7 @@ whichFontEnum(VTFontEnum value) } const char * -whichFontList(XtermWidget xw, VTFontList * value) +whichFontList(XtermWidget xw, const VTFontList * value) { const char *result = "?"; if (value == &(xw->work.fonts.x11)) @@ -6017,7 +6106,7 @@ whichFontList(XtermWidget xw, VTFontList static const char * whichFontList2s(VTFontList * list, char **value) { - const char *result = 0; + const char *result = NULL; #define DATA(name) if (value == (list->name)) result = #name DATA(list_n); DATA(list_b); @@ -6038,14 +6127,14 @@ whichFontList2s(VTFontList * list, char const char * whichFontList2(XtermWidget xw, char **value) { - const char *result = 0; + const char *result = NULL; #define DATA(name) (result = whichFontList2s(&(xw->name), value)) - if (DATA(work.fonts.x11) == 0) { + if (DATA(work.fonts.x11) == NULL) { #if OPT_RENDERFONT - if (DATA(work.fonts.xft) == 0) + if (DATA(work.fonts.xft) == NULL) #endif #if OPT_LOAD_VTFONTS || OPT_WIDE_CHARS - if (DATA(screen.cacheVTFonts.fonts.x11) == 0) + if (DATA(screen.cacheVTFonts.fonts.x11) == NULL) #endif result = "?"; } Index: xsrc/external/mit/xterm/dist/graphics_sixel.c diff -u xsrc/external/mit/xterm/dist/graphics_sixel.c:1.5 xsrc/external/mit/xterm/dist/graphics_sixel.c:1.6 --- xsrc/external/mit/xterm/dist/graphics_sixel.c:1.5 Thu Jul 4 09:09:18 2024 +++ xsrc/external/mit/xterm/dist/graphics_sixel.c Sun Mar 9 23:18:48 2025 @@ -1,4 +1,4 @@ -/* $XTermId: graphics_sixel.c,v 1.57 2024/05/16 20:03:50 tom Exp $ */ +/* $XTermId: graphics_sixel.c,v 1.63 2024/12/01 15:41:40 tom Exp $ */ /* * Copyright 2014-2023,2024 by Thomas E. Dickey @@ -272,18 +272,18 @@ update_sixel_aspect(SixelContext * conte #endif } -static int -finished_parsing(XtermWidget xw, Graphic *graphic) +static void +finished_parsing(Graphic *graphic) { - TScreen *screen = TScreenOf(xw); + TScreen *screen = TScreenOf(s_xw); /* Update the screen scrolling and do a refresh. * The refresh may not cover the whole graphic. */ if (screen->scroll_amt) - FlushScroll(xw); + FlushScroll(s_xw); - if (SixelScrolling(xw)) { + if (SixelScrolling(s_xw)) { int new_row, new_col; /* Note: XTerm follows the VT340 behavior in text cursor placement @@ -327,7 +327,7 @@ finished_parsing(XtermWidget xw, Graphic } while (new_row > screen->bot_marg) { - xtermScroll(xw, 1); + xtermScroll(s_xw, 1); new_row--; TRACE(("bottom row was past screen. new start row=%d, cursor row=%d\n", graphic->charrow, new_row)); @@ -344,16 +344,15 @@ finished_parsing(XtermWidget xw, Graphic } graphic->dirty = True; - refresh_modified_displayed_graphics(xw); + refresh_modified_displayed_graphics(s_xw); dump_graphic(graphic); - return 0; } /* * Handle Sixel protocol selector: Ps1 ; Ps2 ; Ps3 q * Refer to EK-PPLV2-PM, Table 5-1 "Macro Parameter Selections" */ -int +void parse_sixel_init(XtermWidget xw, ANSI *params) { s_xw = xw; @@ -455,8 +454,6 @@ parse_sixel_init(XtermWidget xw, ANSI *p } update_sixel_aspect(&s_context, s_graphic); - - return 0; } #if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) @@ -537,26 +534,26 @@ parse_sixel_incremental_display(void) s_prev_col = dirty_col; } -int +void parse_sixel_char(char cp) { /* s_* variables are static state, defined above */ - if (cp == '\0' || isspace(cp)) { + if (cp == '\0' || isspace(CharOf(cp))) { if (s_repeating && cp == '\0') { TRACE(("DATA_ERROR: sixel data string terminated in the middle of a repeat operator\n")); s_repeating = False; - return finished_parsing(s_xw, s_graphic); + finished_parsing(s_graphic); } - return 0; + return; } - if (isdigit(cp)) { + if (isdigit(CharOf(cp))) { if (s_accumulator == -1) s_accumulator = 0; s_accumulator *= 10; s_accumulator += cp - '0'; - return 0; + return; } if (s_repeating) { /* '!' ... */ @@ -580,7 +577,6 @@ parse_sixel_char(char cp) set_sixel(s_graphic, &s_context, sixel)) { s_context.col++; } else { - s_context.col = 0; break; } } @@ -596,7 +592,7 @@ parse_sixel_char(char cp) s_repeating = False; if (s_screen->incremental_graphics) parse_sixel_incremental_display(); - return 0; + return; } /* FIXME: Raster attributes (") can occur repeatedly and at any time. */ @@ -633,7 +629,8 @@ parse_sixel_char(char cp) TRACE(("DATA_ERROR: raster " #field " %d > max %d\n", \ s_raster_params[state], s_graphic->max_ ## field)); \ s_raster_state = s_NOTRASTER; \ - return finished_parsing(s_xw, s_graphic); \ + finished_parsing(s_graphic); \ + return; \ } \ s_context.declared_ ## field = s_raster_params[state]; \ break @@ -649,7 +646,8 @@ parse_sixel_char(char cp) TRACE(("DATA_ERROR: raster operator ('\"') with too many parameters (%d)\n, next char %c (%d)\n", s_raster_state, cp, cp)); s_raster_state = s_NOTRASTER; - return finished_parsing(s_xw, s_graphic); + finished_parsing(s_graphic); + return; } /* Save data from Raster Attributes */ @@ -664,7 +662,7 @@ parse_sixel_char(char cp) s_raster_state++; if (cp == ';') { - return 0; + return; } /* cp (next character to consume) is not digit, space, or semicolon, so finish up with raster */ @@ -692,7 +690,8 @@ parse_sixel_char(char cp) /* FIXME: What does VT340 do with default register? */ TRACE(("DATA_ERROR: sixel data string uses default color register, next char %c (%d)\n", cp, cp)); - return finished_parsing(s_xw, s_graphic); + finished_parsing(s_graphic); + return; } s_Pregister = (RegisterNum) s_color_params[s_GETTINGREGISTER]; /* The DEC terminals wrapped register indices. */ @@ -705,7 +704,8 @@ parse_sixel_char(char cp) /* FIXME: Default VT340 colorspace is HSL, right? */ TRACE(("DATA_ERROR: sixel data string uses default colorspace \n")); s_color_state = s_NOTCOLORING; - return finished_parsing(s_xw, s_graphic); + finished_parsing(s_graphic); + return; } break; case s_GETTINGPC1: @@ -713,7 +713,8 @@ parse_sixel_char(char cp) /* FIXME: Does VT340 sixel do the same as ReGIS and use the previous value for unspecified color components? */ TRACE(("DATA_ERROR: sixel data string uses default color component 1 \n")); s_color_state = s_NOTCOLORING; - return finished_parsing(s_xw, s_graphic); + finished_parsing(s_graphic); + return; } break; case s_GETTINGPC2: @@ -721,7 +722,8 @@ parse_sixel_char(char cp) /* FIXME: unspecified color components? */ TRACE(("DATA_ERROR: sixel data string uses default color component 2 \n")); s_color_state = s_NOTCOLORING; - return finished_parsing(s_xw, s_graphic); + finished_parsing(s_graphic); + return; } break; case s_GETTINGPC3: @@ -729,7 +731,8 @@ parse_sixel_char(char cp) /* FIXME: unspecified color components? */ TRACE(("DATA_ERROR: sixel data string uses default color component 3 \n")); s_color_state = s_NOTCOLORING; - return finished_parsing(s_xw, s_graphic); + finished_parsing(s_graphic); + return; } break; case s_COLORINGDONE: @@ -741,20 +744,22 @@ parse_sixel_char(char cp) TRACE(("DATA_ERROR: sixel switch color operator ('#') with too many parameters\n, next char %c (%d)\n", cp, cp)); s_color_state = s_NOTCOLORING; - return finished_parsing(s_xw, s_graphic); + finished_parsing(s_graphic); + return; } s_accumulator = -1; s_color_state++; if (cp == ';') { - return 0; + return; } else { /* cp (next character to consume) is not digit, space, or semicolon, so finish up with color */ if (s_color_state != s_COLORINGDONE && s_color_state != s_GETTINGCOLORSPACE) { TRACE(("DATA_ERROR: sixel switch color operator with wrong number of parameters (%d)\n", s_color_state)); s_color_state = s_NOTCOLORING; - return finished_parsing(s_xw, s_graphic); + finished_parsing(s_graphic); + return; } if (s_color_state == s_COLORINGDONE) { @@ -775,7 +780,8 @@ parse_sixel_char(char cp) TRACE(("DATA_ERROR: sixel set color operator uses out-of-range HLS color coordinates %d,%d,%d\n", Pc1, Pc2, Pc3)); s_color_state = s_NOTCOLORING; - return finished_parsing(s_xw, s_graphic); + finished_parsing(s_graphic); + return; } hls2rgb(Pc1, Pc2, Pc3, &r, &g, &b); break; @@ -784,7 +790,8 @@ parse_sixel_char(char cp) TRACE(("DATA_ERROR: sixel set color operator uses out-of-range RGB color coordinates %d,%d,%d\n", Pc1, Pc2, Pc3)); s_color_state = s_NOTCOLORING; - return finished_parsing(s_xw, s_graphic); + finished_parsing(s_graphic); + return; } r = (short) Pc1; g = (short) Pc2; @@ -793,7 +800,8 @@ parse_sixel_char(char cp) default: /* unknown */ TRACE(("DATA_ERROR: sixel set color operator uses unknown color space %d\n", Pspace)); s_color_state = s_NOTCOLORING; - return finished_parsing(s_xw, s_graphic); + finished_parsing(s_graphic); + return; } update_color_register(s_graphic, s_Pregister, @@ -815,8 +823,7 @@ parse_sixel_char(char cp) if (sixel) { if (!ValidColumn(s_graphic, &s_context) || !set_sixel(s_graphic, &s_context, sixel)) { - s_context.col = 0; - return 0; + return; } } s_context.col++; @@ -877,14 +884,11 @@ parse_sixel_char(char cp) TRACE(("DATA_ERROR: skipping unknown sixel command %04x (%c)\n", (int) cp, cp)); } - - return 0; } -/* Just like finished_parsing, but called from do_dcs in misc.c */ -int -parse_sixel_finished(XtermWidget xw) +/* Just like finished_parsing, but called from charproc.c */ +void +parse_sixel_finished(void) { - /* FIXME: should use s_xw */ - return finished_parsing(xw, s_graphic); + finished_parsing(s_graphic); } Index: xsrc/external/mit/xterm/dist/linedata.c diff -u xsrc/external/mit/xterm/dist/linedata.c:1.11 xsrc/external/mit/xterm/dist/linedata.c:1.12 --- xsrc/external/mit/xterm/dist/linedata.c:1.11 Thu Jul 4 09:09:18 2024 +++ xsrc/external/mit/xterm/dist/linedata.c Sun Mar 9 23:18:48 2025 @@ -1,7 +1,7 @@ -/* $XTermId: linedata.c,v 1.106 2023/12/31 20:12:06 tom Exp $ */ +/* $XTermId: linedata.c,v 1.107 2024/12/01 20:27:00 tom Exp $ */ /* - * Copyright 2009-2022,2023 by Thomas E. Dickey + * Copyright 2009-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -44,14 +44,14 @@ LineData * getLineData(TScreen *screen, int row) { - LineData *result = 0; + LineData *result = NULL; ScrnBuf buffer; int max_row = LastRowNumber(screen); if (row >= 0) { buffer = screen->visbuf; } else { - buffer = 0; + buffer = NULL; result = getScrollback(screen, row); } if (row >= 0 && row <= max_row) { Index: xsrc/external/mit/xterm/dist/misc.c diff -u xsrc/external/mit/xterm/dist/misc.c:1.26 xsrc/external/mit/xterm/dist/misc.c:1.27 --- xsrc/external/mit/xterm/dist/misc.c:1.26 Thu Jul 4 09:09:18 2024 +++ xsrc/external/mit/xterm/dist/misc.c Sun Mar 9 23:18:48 2025 @@ -1,4 +1,4 @@ -/* $XTermId: misc.c,v 1.1092 2024/05/21 00:28:28 tom Exp $ */ +/* $XTermId: misc.c,v 1.1107 2024/12/01 20:06:49 tom Exp $ */ /* * Copyright 1999-2023,2024 by Thomas E. Dickey @@ -105,13 +105,6 @@ #define MakeTemp(f) mktemp(f) #endif -#ifdef VMS -#define XTERM_VMS_LOGFILE "SYS$SCRATCH:XTERM_LOG.TXT" -#ifdef ALLOWLOGFILEEXEC -#undef ALLOWLOGFILEEXEC -#endif -#endif /* VMS */ - #if USE_DOUBLE_BUFFER #include <X11/extensions/Xdbe.h> #endif @@ -179,7 +172,7 @@ Sleep(int msec) select_timeout.tv_sec = 0; select_timeout.tv_usec = msec * 1000; - select(0, 0, 0, 0, &select_timeout); + select(0, NULL, NULL, NULL, &select_timeout); } static void @@ -289,7 +282,7 @@ setXUrgency(XtermWidget xw, Bool enable) if (screen->bellIsUrgent) { XWMHints *h = XGetWMHints(screen->display, VShellWindow(xw)); - if (h != 0) { + if (h != NULL) { if (enable && !(screen->select & FOCUS)) { h->flags |= XUrgencyHint; } else { @@ -411,7 +404,7 @@ mergeExposeEvents(XEvent *target) XExposeEvent *q = (XExposeEvent *) (&next_event); XtAppNextEvent(app_con, &next_event); - TRACE_EVENT("pending", &next_event, (String *) 0, 0); + TRACE_EVENT("pending", &next_event, (String *) 0, NULL); /* * If either window is contained within the other, merge the events. @@ -466,7 +459,7 @@ mergeConfigureEvents(XEvent *target) XConfigureEvent *q = (XConfigureEvent *) (&next_event); XtAppNextEvent(app_con, &next_event); - TRACE_EVENT("pending", &next_event, (String *) 0, 0); + TRACE_EVENT("pending", &next_event, (String *) 0, NULL); if (p->window == q->window) { TRACE(("pending Configure...merged\n")); @@ -519,7 +512,7 @@ mergeButtonEvents(XEvent *target) XButtonEvent *q = (XButtonEvent *) (&next_event); XtAppNextEvent(app_con, &next_event); - TRACE_EVENT("pending", &next_event, (String *) 0, 0); + TRACE_EVENT("pending", &next_event, (String *) 0, NULL); if (p->window == q->window) { TRACE(("pending ButtonEvent...merged\n")); @@ -553,7 +546,7 @@ xtermAppPending(void) while (result && XtAppPeekEvent(app_con, &this_event)) { found = True; - TRACE_EVENT("pending", &this_event, (String *) 0, 0); + TRACE_EVENT("pending", &this_event, (String *) 0, NULL); if (this_event.type == Expose) { result = mergeExposeEvents(&this_event); } else if (this_event.type == ConfigureNotify) { @@ -715,12 +708,12 @@ make_hidden_cursor(XtermWidget xw) * server insists on drawing _something_. */ TRACE(("Ask for nil2 font\n")); - if ((fn = xtermLoadQueryFont(xw, "nil2")) == 0) { + if ((fn = xtermLoadQueryFont(xw, "nil2")) == NULL) { TRACE(("...Ask for fixed font\n")); fn = xtermLoadQueryFont(xw, DEFFONT); } - if (fn != None) { + if (fn != NULL) { /* a space character seems to work as a cursor (dots are not needed) */ c = XCreateGlyphCursor(dpy, fn->fid, fn->fid, 'X', ' ', &dummy, &dummy); XFreeFont(dpy, fn); @@ -745,7 +738,7 @@ init_colored_cursor(Display *dpy) static const char pattern[] = "xtermXXXXXXXX"; char *env = getenv("XCURSOR_THEME"); - xterm_cursor_theme = 0; + xterm_cursor_theme = NULL; /* * The environment variable overrides a (possible) resource Xcursor.theme */ @@ -766,11 +759,11 @@ init_colored_cursor(Display *dpy) TRACE(("init_colored_cursor will make an empty Xcursor theme\n")); - if ((tmp_dir = getenv("TMPDIR")) == 0) { + if ((tmp_dir = getenv("TMPDIR")) == NULL) { tmp_dir = P_tmpdir; } needed = strlen(tmp_dir) + 4 + strlen(theme) + strlen(pattern); - if ((filename = malloc(needed)) != 0) { + if ((filename = malloc(needed)) != NULL) { sprintf(filename, "%s/%s", tmp_dir, pattern); #ifdef HAVE_MKDTEMP @@ -788,14 +781,14 @@ init_colored_cursor(Display *dpy) * search path away from home. We are setting up the complete * theme just in case the library ever acquires a maintainer. */ - if (xterm_cursor_theme != 0) { + if (xterm_cursor_theme != NULL) { char *leaf = xterm_cursor_theme + strlen(xterm_cursor_theme); FILE *fp; strcat(leaf, "/"); strcat(leaf, theme); - if ((fp = fopen(xterm_cursor_theme, "w")) != 0) { + if ((fp = fopen(xterm_cursor_theme, "w")) != NULL) { fprintf(fp, "[Icon Theme]\n"); fclose(fp); *leaf = '\0'; @@ -821,7 +814,7 @@ void cleanup_colored_cursor(void) { #ifdef HAVE_LIB_XCURSOR - if (xterm_cursor_theme != 0) { + if (xterm_cursor_theme != NULL) { char *my_path = getenv("XCURSOR_PATH"); struct stat sb; if (!IsEmpty(my_path) @@ -1076,7 +1069,7 @@ HandleStringEvent(Widget w GCC_UNUSED, value *= 16; if (c >= '0' && c <= '9') value += (unsigned) (c - '0'); - else if ((xxxxxx = (strchr) (abcdef, c)) != 0) + else if ((xxxxxx = (strchr) (abcdef, c)) != NULL) value += (unsigned) (xxxxxx - abcdef) + 10; else break; @@ -1628,7 +1621,7 @@ dabbrev_prev_word(XtermWidget xw, CELL * char *abword; int c; char *ab_end = (xw->work.dabbrev_data + MAX_DABBREV - 1); - char *result = 0; + char *result = NULL; abword = ab_end; *abword = '\0'; /* end of string marker */ @@ -1645,7 +1638,7 @@ dabbrev_prev_word(XtermWidget xw, CELL * result = abword; } - if (result != 0) { + if (result != NULL) { while ((c = dabbrev_prev_char(screen, cell, ld)) >= 0 && !IS_WORD_CONSTITUENT(c)) { ; /* skip preceding spaces */ @@ -1662,7 +1655,7 @@ dabbrev_expand(XtermWidget xw) int pty = screen->respond; /* file descriptor of pty */ static CELL cell; - static char *dabbrev_hint = 0, *lastexpansion = 0; + static char *dabbrev_hint = NULL, *lastexpansion = NULL; static unsigned int expansions; char *expansion; @@ -1677,14 +1670,14 @@ dabbrev_expand(XtermWidget xw) free(dabbrev_hint); - if ((dabbrev_hint = dabbrev_prev_word(xw, &cell, &ld)) != 0) { + if ((dabbrev_hint = dabbrev_prev_word(xw, &cell, &ld)) != NULL) { free(lastexpansion); - if ((lastexpansion = strdup(dabbrev_hint)) != 0) { + if ((lastexpansion = strdup(dabbrev_hint)) != NULL) { /* make own copy */ - if ((dabbrev_hint = strdup(dabbrev_hint)) != 0) { + if ((dabbrev_hint = strdup(dabbrev_hint)) != NULL) { screen->dabbrev_working = True; /* we are in the middle of dabbrev process */ } @@ -1696,17 +1689,17 @@ dabbrev_expand(XtermWidget xw) } if (!screen->dabbrev_working) { free(lastexpansion); - lastexpansion = 0; + lastexpansion = NULL; return result; } } - if (dabbrev_hint == 0) + if (dabbrev_hint == NULL) return result; hint_len = strlen(dabbrev_hint); for (;;) { - if ((expansion = dabbrev_prev_word(xw, &cell, &ld)) == 0) { + if ((expansion = dabbrev_prev_word(xw, &cell, &ld)) == NULL) { if (expansions >= 2) { expansions = 0; cell.col = screen->cur_col; @@ -1721,12 +1714,12 @@ dabbrev_expand(XtermWidget xw) break; } - if (expansion != 0) { + if (expansion != NULL) { Char *copybuffer; size_t del_cnt = strlen(lastexpansion) - hint_len; size_t buf_cnt = del_cnt + strlen(expansion) - hint_len; - if ((copybuffer = TypeMallocN(Char, buf_cnt)) != 0) { + if ((copybuffer = TypeMallocN(Char, buf_cnt)) != NULL) { /* delete previous expansion */ memset(copybuffer, screen->dabbrev_erase_char, del_cnt); memmove(copybuffer + del_cnt, @@ -1739,7 +1732,7 @@ dabbrev_expand(XtermWidget xw) free(lastexpansion); - if ((lastexpansion = strdup(expansion)) != 0) { + if ((lastexpansion = strdup(expansion)) != NULL) { result = 1; expansions++; } @@ -1759,7 +1752,7 @@ HandleDabbrevExpand(Widget w, XtermWidget xw; TRACE(("Handle dabbrev-expand for %p\n", (void *) w)); - if ((xw = getXtermWidget(w)) != 0) { + if ((xw = getXtermWidget(w)) != NULL) { if (!dabbrev_expand(xw)) Bell(xw, XkbBI_TerminalBell, 0); } @@ -1824,7 +1817,7 @@ xtermIsIconified(XtermWidget xw) int actual_format_return = 0; unsigned long nitems_return = 0; unsigned long bytes_after_return = 0; - unsigned char *prop_return = 0; + unsigned char *prop_return = NULL; long long_length = 1024; Atom requested_type = XA_ATOM; Atom is_hidden = CachedInternAtom(dpy, "_NET_WM_STATE_HIDDEN"); @@ -1845,7 +1838,7 @@ xtermIsIconified(XtermWidget xw) &nitems_return, &bytes_after_return, &prop_return)) { - if (prop_return != 0 + if (prop_return != NULL && actual_return_type == requested_type && actual_format_return == 32) { unsigned long n; @@ -1877,7 +1870,7 @@ HandleDeIconify(Widget w, { XtermWidget xw; - if ((xw = getXtermWidget(w)) != 0) { + if ((xw = getXtermWidget(w)) != NULL) { xtermDeiconify(xw); } } @@ -1891,7 +1884,7 @@ HandleIconify(Widget w, { XtermWidget xw; - if ((xw = getXtermWidget(w)) != 0) { + if ((xw = getXtermWidget(w)) != NULL) { xtermIconify(xw); } } @@ -2058,7 +2051,7 @@ HandleMaximize(Widget w, { XtermWidget xw; - if ((xw = getXtermWidget(w)) != 0) { + if ((xw = getXtermWidget(w)) != NULL) { RequestMaximize(xw, 1); } } @@ -2072,7 +2065,7 @@ HandleRestoreSize(Widget w, { XtermWidget xw; - if ((xw = getXtermWidget(w)) != 0) { + if ((xw = getXtermWidget(w)) != NULL) { RequestMaximize(xw, 0); } } @@ -2116,11 +2109,7 @@ Redraw(void) #endif } -#ifdef VMS -#define TIMESTAMP_FMT "%s%d-%02d-%02d-%02d-%02d-%02d" -#else #define TIMESTAMP_FMT "%s%d-%02d-%02d.%02d:%02d:%02d" -#endif void timestamp_filename(char *dst, const char *src) @@ -2149,9 +2138,7 @@ create_printfile(XtermWidget xw, const c int fd; FILE *fp; -#ifdef VMS - sprintf(fname, "sys$scratch:xterm%s", suffix); -#elif defined(HAVE_STRFTIME) +#if defined(HAVE_STRFTIME) { char format[1024]; time_t now; @@ -2181,17 +2168,6 @@ open_userfile(uid_t uid, gid_t gid, char int fd; struct stat sb; -#ifdef VMS - if ((fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) { - int the_error = errno; - xtermWarning("cannot open %s: %d:%s\n", - path, - the_error, - SysErrorMsg(the_error)); - return -1; - } - chown(path, uid, gid); -#else if ((access(path, F_OK) != 0 && (errno != ENOENT)) || (creat_as(uid, gid, append, path, 0644) <= 0) || ((fd = open(path, O_WRONLY | O_APPEND)) < 0)) { @@ -2202,7 +2178,6 @@ open_userfile(uid_t uid, gid_t gid, char SysErrorMsg(the_error)); return -1; } -#endif /* * Doublecheck that the user really owns the file that we've opened before @@ -2218,7 +2193,6 @@ open_userfile(uid_t uid, gid_t gid, char return fd; } -#ifndef VMS /* * Create a file only if we could with the permissions of the real user id. * We could emulate this with careful use of access() and following @@ -2321,7 +2295,6 @@ creat_as(uid_t uid, gid_t gid, Bool appe return retval; } } -#endif /* !VMS */ #endif /* OPT_SCREEN_DUMPS || defined(ALLOWLOGGING) */ int @@ -2386,7 +2359,7 @@ StartLogExec(TScreen *screen) } } - if (shell == 0) { + if (shell == NULL) { static char dummy[] = "/bin/sh"; shell = dummy; } @@ -2496,13 +2469,6 @@ StartLog(XtermWidget xw) if (screen->logging || (screen->inhibit & I_LOG)) return; -#ifdef VMS /* file name is fixed in VMS variant */ - screen->logfd = open(XTERM_VMS_LOGFILE, - O_CREAT | O_TRUNC | O_APPEND | O_RDWR, - 0640); - if (screen->logfd < 0) - return; /* open failed */ -#else /*VMS */ /* if we weren't supplied with a logfile path, generate one */ if (IsEmpty(screen->logfile)) @@ -2529,7 +2495,6 @@ StartLog(XtermWidget xw) True)) < 0) return; } -#endif /*VMS */ screen->logstart = VTbuffer->next; screen->logging = True; update_logging(); @@ -2557,14 +2522,8 @@ FlushLog(XtermWidget xw) Char *cp; size_t i; -#ifdef VMS /* avoid logging output loops which otherwise occur sometimes - when there is no output and cp/screen->logstart are 1 apart */ - if (!tt_new_output) - return; - tt_new_output = False; -#endif /* VMS */ cp = VTbuffer->next; - if (screen->logstart != 0 + if (screen->logstart != NULL && (i = (size_t) (cp - screen->logstart)) > 0) { IGNORE_RC(write(screen->logfd, screen->logstart, i)); } @@ -2622,13 +2581,13 @@ rgb masks (%04lx/%04lx/%04lx)\n" Display *dpy = screen->display; XVisualInfo myTemplate; - if (xw->visInfo == 0 && xw->numVisuals == 0) { + if (xw->visInfo == NULL && xw->numVisuals == 0) { myTemplate.visualid = XVisualIDFromVisual(DefaultVisual(dpy, XDefaultScreen(dpy))); xw->visInfo = XGetVisualInfo(dpy, (long) VisualIDMask, &myTemplate, &xw->numVisuals); - if ((xw->visInfo != 0) && (xw->numVisuals > 0)) { + if ((xw->visInfo != NULL) && (xw->numVisuals > 0)) { XVisualInfo *vi = xw->visInfo; xw->rgb_widths[0] = maskToWidth(vi->red_mask); xw->rgb_widths[1] = maskToWidth(vi->green_mask); @@ -2663,7 +2622,7 @@ rgb masks (%04lx/%04lx/%04lx)\n" xw->rgb_widths[2])); } } - return (xw->visInfo != 0) && (xw->numVisuals > 0) ? xw->visInfo : NULL; + return (xw->visInfo != NULL) && (xw->numVisuals > 0) ? xw->visInfo : NULL; #undef MYFMT #undef MYARG } @@ -2717,14 +2676,14 @@ loadColorTable(XtermWidget xw, unsigned { Colormap cmap = xw->core.colormap; TScreen *screen = TScreenOf(xw); - Boolean result = (screen->cmap_data != 0); + Boolean result = (screen->cmap_data != NULL); if (!result && length != 0 && length < MAX_COLORTABLE) { screen->cmap_data = TypeMallocN(XColor, (size_t) length); - if (screen->cmap_data != 0) { + if (screen->cmap_data != NULL) { unsigned i; unsigned shift; @@ -2848,7 +2807,7 @@ allocateClosestRGB(XtermWidget xw, XColo if (loadColorTable(xw, cmap_size)) { char *tried = TypeCallocN(char, (size_t) cmap_size); - if (tried != 0) { + if (tried != NULL) { unsigned attempts; /* @@ -3099,8 +3058,8 @@ ResetAnsiColorRequest(XtermWidget xw, ch color = (int) (strtol) (buf, &next, 10); if (!PartS2L(buf, next) || (color < 0)) break; /* no number at all */ - if (next != 0) { - if (strchr(";", *next) == 0) + if (next != NULL) { + if (strchr(";", *next) == NULL) break; /* unexpected delimiter */ ++next; } @@ -3373,8 +3332,6 @@ ManipulateSelectionData(XtermWidget xw, PDATA('7', CUT_BUFFER7), }; char target_used[XtNumber(table)]; - char select_code[XtNumber(table) + 1]; - String select_args[XtNumber(table) + 1]; const char *base = buf; Cardinal j; @@ -3388,6 +3345,8 @@ ManipulateSelectionData(XtermWidget xw, } if (*buf == ';') { + char select_code[XtNumber(table) + 1]; + String select_args[XtNumber(table) + 1]; *buf++ = '\0'; if (*base == '\0') @@ -3458,10 +3417,6 @@ ManipulateSelectionData(XtermWidget xw, /***====================================================================***/ -#define IsSetUtf8Title(xw) (IsTitleMode(xw, tmSetUtf8) \ - || (xw->screen.utf8_title) \ - || (xw->screen.c1_printable)) - static Bool xtermIsPrintable(XtermWidget xw, Char **bufp, Char *last) { @@ -3748,7 +3703,7 @@ ChangeColorsRequest(XtermWidget xw, if (names != NULL) { *names++ = '\0'; } - if (thisName != 0) { + if (thisName != NULL) { if (!strcmp(thisName, "?")) { if (ReportColorRequest(xw, ndx, final)) ++queried; @@ -3794,8 +3749,8 @@ ResetColorsRequest(XtermWidget xw, newColors.which = 0; newColors.names[ndx] = NULL; - if (thisName != 0 - && xw->work.oldColors->names[ndx] != 0 + if (thisName != NULL + && xw->work.oldColors->names[ndx] != NULL && strcmp(thisName, xw->work.oldColors->names[ndx])) { AllocateTermColor(xw, &newColors, ndx, thisName, False); @@ -3859,7 +3814,7 @@ QueryFontRequest(XtermWidget xw, String Bool success = True; int num; String base = buf + 1; - const char *name = 0; + const char *name = NULL; num = ParseShiftedFont(xw, buf, &buf); if (num < 0 @@ -3872,7 +3827,7 @@ QueryFontRequest(XtermWidget xw, String name = getFaceName(xw, False); } else #endif - if ((name = screen->MenuFontName(num)) == 0) { + if ((name = screen->MenuFontName(num)) == NULL) { success = False; } } @@ -3950,7 +3905,7 @@ ChangeFontRequest(XtermWidget xw, String * But if there is, simply overwrite the font entry. */ if (*buf == '\0') { - if ((buf = screen->MenuFontName(num)) == 0) { + if ((buf = screen->MenuFontName(num)) == NULL) { success = False; } } @@ -3962,7 +3917,7 @@ ChangeFontRequest(XtermWidget xw, String name = x_strtrim(buf); if (screen->EscapeFontName()) { FREE_STRING(screen->EscapeFontName()); - screen->EscapeFontName() = 0; + screen->EscapeFontName() = NULL; } if (success && !IsEmpty(name)) { #if OPT_RENDERFONT @@ -4013,6 +3968,7 @@ report_allowed_ops(XtermWidget xw, int f CASE(allowTcapOps); CASE(allowTitleOps); CASE(allowWindowOps); + (void) delimiter; #undef CASE unparseputc1(xw, final); @@ -4036,7 +3992,7 @@ do_osc(XtermWidget xw, Char *oscbuf, siz int mode; Char *cp; int state = 0; - char *buf = 0; + char *buf = NULL; char temp[20]; #if OPT_ISO_COLORS int ansi_colors = 0; @@ -4460,7 +4416,7 @@ parse_decudk(XtermWidget xw, const char * Parse numeric parameters. Normally we use a state machine to simplify * interspersing with control characters, but have the string already. */ -static void +void parse_ansi_params(ANSI *params, const char **string) { const char *cp = *string; @@ -4596,7 +4552,7 @@ parse_decdld(ANSI *params, const char *s ch = CharOf(ch - 0x3f); for (n = 0; n < 6; ++n) { - bits[row + n][col] = CharOf((ch & (1 << n)) ? '*' : '.'); + bits[row + n][col] = CharOf((ch & xBIT(n)) ? '*' : '.'); } col += 1; prior = True; @@ -4936,10 +4892,8 @@ do_dcs(XtermWidget xw, Char *dcsbuf, siz sprintf(reply, "%d%s%s", (screen->vtXX_level ? screen->vtXX_level : 1) + 60, - (screen->vtXX_level >= 2) - ? (screen->control_eight_bits - ? ";0" : ";1") - : "", + (screen->control_eight_bits + ? ";0" : ";1"), cp); } else if (!strcmp(cp, "r")) { /* DECSTBM */ TRACE(("DECRQSS -> DECSTBM\n")); @@ -5023,6 +4977,12 @@ do_dcs(XtermWidget xw, Char *dcsbuf, siz okay = False; } } else if (screen->terminal_id == 525 + && !strcmp((cp2 = skip_params(cp)), "){")) { /* DECSTGLT */ + TRACE(("reply DECSTGLT:%s\n", cp)); + sprintf(reply, "%d%s", + 3, /* ANSI SGR color */ + cp); + } else if (screen->terminal_id == 525 && !strcmp((cp2 = skip_params(cp)), ",|")) { /* DECAC */ ival = parse_int_param(&cp); TRACE(("reply DECAC\n")); @@ -5067,7 +5027,44 @@ do_dcs(XtermWidget xw, Char *dcsbuf, siz } } else #endif - { + /* + * This query returns the settings assuming the default value + * of DEF_TITLE_MODES, which is zero. Someone could in + * principle alter that (so that some states could only be + * reached by removing rather than consistently by setting), + * but the default value could be discovered by resetting the + * title modes, querying the resulting reset state. + */ + if (*cp == '>' && !strcmp(skip_params(1 + cp), "t")) { /* XTSMTITLE */ + char buffer[80]; + int n; + + ++cp; + okay = True; + ival = parse_int_param(&cp); + *buffer = '\0'; + if (ival == -1) { /* DEFAULT */ + for (n = 0; n <= MAX_TITLEMODE; ++n) { + int check = xBIT(n); + char *s = buffer + strlen(buffer); + if (s != buffer) + *s++ = ';'; + sprintf(s, "%d", + ((check & screen->title_modes) != 0 + ? 1 + : 0)); + } + } else if (ival >= 0 && ival <= MAX_TITLEMODE) { + sprintf(buffer, "%d", + ((xBIT(ival) & screen->title_modes) != 0 + ? 1 + : 0)); + } else { + okay = False; + } + if (okay) + sprintf(reply, ">%st", buffer); + } else { okay = False; } @@ -5176,7 +5173,7 @@ do_dcs(XtermWidget xw, Char *dcsbuf, siz Boolean first = True; okay = True; while (*cp != '\0' && okay) { - const char *parsed = 0; + const char *parsed = NULL; const char *tmp; char *name = x_decode_hex(cp, &parsed); char *value; @@ -5190,7 +5187,7 @@ do_dcs(XtermWidget xw, Char *dcsbuf, siz break; /* ignore improbable resource */ } TRACE(("query-feature '%s'\n", name)); - if ((value = vt100ResourceToString(xw, name)) != 0) { + if ((value = vt100ResourceToString(xw, name)) != NULL) { okay = True; /* valid */ } else { okay = False; /* invalid */ @@ -5206,7 +5203,7 @@ do_dcs(XtermWidget xw, Char *dcsbuf, siz for (tmp = cp; tmp != parsed; ++tmp) unparseputc(xw, *tmp); - if (value != 0) { + if (value != NULL) { unparseputc1(xw, '='); result = x_encode_hex(value); unparseputs(xw, result); @@ -5274,7 +5271,6 @@ do_dcs(XtermWidget xw, Char *dcsbuf, siz /* FALLTHRU */ default: if (optRegisGraphics(screen) || - optSixelGraphics(screen) || screen->vtXX_level >= 2) { /* VT220 */ parse_ansi_params(¶ms, &cp); switch (params.a_final) { @@ -5287,19 +5283,7 @@ do_dcs(XtermWidget xw, Char *dcsbuf, siz TRACE(("ignoring ReGIS graphic (compilation flag not enabled)\n")); #endif break; - case 'q': /* sixel */ -#if OPT_SIXEL_GRAPHICS - if (optSixelGraphics(screen)) { - parse_sixel_init(xw, ¶ms); - while (*cp) { - parse_sixel_char(*cp++); - } - parse_sixel_finished(xw); - TRACE(("DONE parsed sixel data\n")); - } -#else - TRACE(("ignoring sixel graphic (compilation flag not enabled)\n")); -#endif + case 'q': /* sixel is done in charproc.c */ break; case '|': /* DECUDK */ if (screen->vtXX_level >= 2) { /* VT220 */ @@ -5571,7 +5555,7 @@ do_dec_rqm(XtermWidget xw, int nparams, result = MdFlag(xw->keyboard.flags, MODE_DECSDM); break; #endif - case srm_DECNCSM: + case srm_DECNCSM: /* no clearing screen on column change */ if (screen->vtXX_level >= 5) { /* VT510 */ result = MdFlag(xw->flags, NOCLEAR_COLM); } else { @@ -5716,35 +5700,64 @@ do_dec_rqm(XtermWidget xw, int nparams, result = MdBool(screen->sixel_scrolls_right); break; #endif - case srm_DECARSM: /* ignore */ - case srm_DECATCBM: /* ignore */ - case srm_DECATCUM: /* ignore */ - case srm_DECBBSM: /* ignore */ - case srm_DECCAAM: /* ignore */ - case srm_DECCANSM: /* ignore */ - case srm_DECCAPSLK: /* ignore */ - case srm_DECCRTSM: /* ignore */ - case srm_DECECM: /* ignore */ - case srm_DECFWM: /* ignore */ - case srm_DECHCCM: /* ignore */ - case srm_DECHDPXM: /* ignore */ - case srm_DECHEM: /* ignore */ - case srm_DECHWUM: /* ignore */ - case srm_DECIPEM: /* ignore */ - case srm_DECKBUM: /* ignore */ - case srm_DECKLHIM: /* ignore */ - case srm_DECKPM: /* ignore */ - case srm_DECRLM: /* ignore */ - case srm_DECMCM: /* ignore */ - case srm_DECNAKB: /* ignore */ - case srm_DECNULM: /* ignore */ - case srm_DECNUMLK: /* ignore */ - case srm_DECOSCNM: /* ignore */ - case srm_DECPCCM: /* ignore */ - case srm_DECRLCM: /* ignore */ - case srm_DECRPL: /* ignore */ - case srm_DECVCCM: /* ignore */ - case srm_DECXRLM: /* ignore */ + /* the remainder are recognized but unimplemented */ + /* VT3xx */ + case srm_DEC131TM: /* vt330:VT131 transmit */ + case srm_DECEKEM: /* vt330:edit key execution */ + case srm_DECHCCM: /* vt320:Horizontal Cursor-Coupling Mode */ + case srm_DECKBUM: /* vt330:Keyboard Usage mode */ + case srm_DECKKDM: /* vt382:Kanji/Katakana */ + case srm_DECLTM: /* vt330:line transmit */ + case srm_DECPCCM: /* vt330:Page Cursor-Coupling Mode */ + case srm_DECVCCM: /* vt330:Vertical Cursor-Coupling Mode */ + case srm_DECXRLM: /* vt330:Transmit Rate Limiting */ +#if !OPT_BLINK_CURS + case srm_DECKANAM: /* vt382:Katakana shift */ + case srm_DECSCFDM: /* vt330:space compression field delimiter */ + case srm_DECTEM: /* vt330:transmission execution */ +#endif +#if !OPT_TOOLBAR + case srm_DECEDM: /* vt330:edit */ +#endif + if (screen->vtXX_level >= 3) + result = mdAlwaysReset; + break; + /* VT4xx */ + case srm_DECKPM: /* vt420:Key Position Mode */ + if (screen->vtXX_level >= 4) + result = mdAlwaysReset; + break; + /* VT5xx */ + case srm_DECAAM: /* vt510:auto answerback */ + case srm_DECARSM: /* vt510:auto resize */ + case srm_DECATCBM: /* vt520:alternate text color blink */ + case srm_DECATCUM: /* vt520:alternate text color underline */ + case srm_DECBBSM: /* vt520:bold and blink style */ + case srm_DECCANSM: /* vt510:conceal answerback */ + case srm_DECCAPSLK: /* vt510:Caps Lock Mode */ + case srm_DECCRTSM: /* vt510:CRT save */ + case srm_DECECM: /* vt520:erase color */ + case srm_DECESKM: /* vt510:enable secondary keyboard language */ + case srm_DECFWM: /* vt520:framed windows */ + case srm_DECHDPXM: /* vt510:half duplex */ + case srm_DECHEM: /* vt510:Hebrew encoding */ + case srm_DECHWUM: /* vt520:host wake-up mode (CRT and energy saver) */ + case srm_DECIPEM: /* vt510:IBM ProPrinter Emulation Mode */ + case srm_DECKLHIM: /* vt510:ignore */ + case srm_DECMCM: /* vt510:modem control */ + case srm_DECNAKB: /* vt510:Greek/N-A Keyboard Mapping */ + case srm_DECNULM: /* vt510:Ignoring Null Mode */ + case srm_DECNUMLK: /* vt510:Num Lock Mode */ + case srm_DECOSCNM: /* vt510:Overscan Mode */ + case srm_DECRLCM: /* vt510:Right-to-Left Copy */ + case srm_DECRLM: /* vt510:left-to-right */ + case srm_DECRPL: /* vt520:Review Previous Lines */ +#if !OPT_SHIFT_FONTS + case srm_DECHEBM: /* vt520:Hebrew keyboard mapping */ +#endif + if (screen->vtXX_level >= 5) + result = mdAlwaysReset; + break; default: TRACE(("DATA_ERROR: requested report for unknown private mode %d\n", params[0])); @@ -5810,7 +5823,7 @@ x_find_icon(char **work, int *state, con { const char *prefix = PIXMAP_ROOTDIR; const char *larger = "_48x48"; - char *result = 0; + char *result = NULL; if (*state >= 0) { if ((*state & 1) == 0) @@ -5834,7 +5847,7 @@ x_find_icon(char **work, int *state, con FreeAndNull(*work); length = 3 + strlen(prefix) + strlen(filename) + strlen(larger) + strlen(suffix); - if ((result = malloc(length)) != 0) { + if ((result = malloc(length)) != NULL) { sprintf(result, "%s%s%s%s", prefix, filename, larger, suffix); *work = result; } @@ -5849,7 +5862,7 @@ x_find_icon(char **work, int *state, con static const XPM_DATA * built_in_xpm(const XPM_DATA * table, Cardinal length, const char *find) { - const XPM_DATA *result = 0; + const XPM_DATA *result = NULL; if (!IsEmpty(find)) { Cardinal n; for (n = 0; n < length; ++n) { @@ -5864,10 +5877,10 @@ built_in_xpm(const XPM_DATA * table, Car * As a fallback, check if the icon name matches without the lengths, * which are all _HHxWW format. */ - if (result == 0) { + if (result == NULL) { const char *base = table[0].name; const char *last = strchr(base, '_'); - if (last != 0 + if (last != NULL && !x_strncasecmp(find, base, (unsigned) (last - base))) { result = table + length - 1; ReportIcons(("use builtin-icon %s\n", table[0].name)); @@ -5907,7 +5920,7 @@ xtermLoadIcon(XtermWidget xw, const char Display *dpy = XtDisplay(xw); Pixmap myIcon = 0; Pixmap myMask = 0; - char *workname = 0; + char *workname = NULL; ICON_HINT hint = eHintDefault; #include <builtin_icons.h> @@ -5922,7 +5935,7 @@ xtermLoadIcon(XtermWidget xw, const char if (hint == eHintSearch) { int state = 0; - while (x_find_icon(&workname, &state, icon_hint, ".xpm") != 0) { + while (x_find_icon(&workname, &state, icon_hint, ".xpm") != NULL) { Pixmap resIcon = 0; Pixmap shapemask = 0; XpmAttributes attributes; @@ -5962,15 +5975,15 @@ xtermLoadIcon(XtermWidget xw, const char if (myIcon == 0 && hint != eHintNone) { char **data; #if OPT_BUILTIN_XPMS - const XPM_DATA *myData = 0; + const XPM_DATA *myData = NULL; myData = BuiltInXPM(mini_xterm_xpms); - if (myData == 0) + if (myData == NULL) myData = BuiltInXPM(filled_xterm_xpms); - if (myData == 0) + if (myData == NULL) myData = BuiltInXPM(xterm_color_xpms); - if (myData == 0) + if (myData == NULL) myData = BuiltInXPM(xterm_xpms); - if (myData == 0) + if (myData == NULL) myData = &mini_xterm_xpms[XtNumber(mini_xterm_xpms) - 1]; data = (char **) myData->data; #else @@ -5979,7 +5992,7 @@ xtermLoadIcon(XtermWidget xw, const char if (XpmCreatePixmapFromData(dpy, DefaultRootWindow(dpy), data, - &myIcon, &myMask, 0) == 0) { + &myIcon, &myMask, NULL) == 0) { ReportIcons(("loaded built-in pixmap icon\n")); } else { myIcon = 0; @@ -6034,7 +6047,7 @@ ChangeGroup(XtermWidget xw, const char * /* * Ignore empty or too-long requests. */ - if (value == 0 || strlen(value) > 1000) + if (value == NULL || strlen(value) > 1000) return; if (IsTitleMode(xw, tmSetBase16)) { @@ -6043,7 +6056,7 @@ ChangeGroup(XtermWidget xw, const char * /* this allocates a new string, if no error is detected */ value = x_decode_hex(value, &temp); - if (value == 0 || *temp != '\0') { + if (value == NULL || *temp != '\0') { free(value); return; } @@ -6147,7 +6160,7 @@ ChangeGroup(XtermWidget xw, const char * for (n = 0; c1[n] != '\0'; ++n) { if (c1[n] > 127) { Char *converted; - if ((converted = TypeMallocN(Char, 1 + (6 * limit))) != 0) { + if ((converted = TypeMallocN(Char, 1 + (6 * limit))) != NULL) { Char *temp = converted; while (*c1 != 0) { temp = convertToUTF8(temp, *c1++); @@ -6167,13 +6180,13 @@ ChangeGroup(XtermWidget xw, const char * #if OPT_SAME_NAME /* If the attribute isn't going to change, then don't bother... */ if (resource.sameName) { - char *buf = 0; + char *buf = NULL; XtSetArg(args[0], my_attr, &buf); XtGetValues(top, args, 1); TRACE(("...comparing resource{%s} to new value{%s}\n", NonNull(buf), NonNull(value))); - if (buf != 0 && strcmp(value, buf) == 0) + if (buf != NULL && strcmp(value, buf) == 0) changed = False; } #endif /* OPT_SAME_NAME */ @@ -6204,7 +6217,7 @@ ChangeGroup(XtermWidget xw, const char * long long_length = 1024; unsigned long nitems = 0; unsigned long bytes_after = 0; - unsigned char *prop = 0; + unsigned char *prop = NULL; if (xtermGetWinProp(dpy, VShellWindow(xw), @@ -6219,7 +6232,7 @@ ChangeGroup(XtermWidget xw, const char * &prop)) { if (actual_type == requested_type && actual_format == 8 - && prop != 0 + && prop != NULL && nitems == strlen(value) && memcmp(value, prop, nitems) == 0) { changed = False; @@ -6313,7 +6326,7 @@ ReverseOldColors(XtermWidget xw) pOld->names[TEXT_CURSOR] = NULL; } if (pOld->names[TEXT_BG]) { - if ((tmpName = x_strdup(pOld->names[TEXT_BG])) != 0) { + if ((tmpName = x_strdup(pOld->names[TEXT_BG])) != NULL) { pOld->names[TEXT_CURSOR] = tmpName; } } @@ -6357,7 +6370,7 @@ AllocateTermColor(XtermWidget xw, } if (result - && (newName = x_strdup(name)) != 0) { + && (newName = x_strdup(name)) != NULL) { if (COLOR_DEFINED(pNew, ndx)) { free(pNew->names[ndx]); } @@ -6567,7 +6580,7 @@ validProgram(const char *pathname) if (!IsEmpty(pathname) && *pathname == '/' - && strstr(pathname, "/..") == 0 + && strstr(pathname, "/..") == NULL && stat(pathname, &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFREG && (sb.st_mode & S_IXOTH) != 0) { @@ -6576,7 +6589,6 @@ validProgram(const char *pathname) return result; } -#ifndef VMS #ifndef PATH_MAX #define PATH_MAX 512 /* ... is not defined consistently in Xos.h */ #endif @@ -6597,8 +6609,8 @@ xtermFindShell(char *leaf, Bool warning) size_t need = PATH_MAX; size_t used = strlen(result) + 2; char *buffer = malloc(used + need); - if (buffer != 0) { - if (getcwd(buffer, need) != 0) { + if (buffer != NULL) { + if (getcwd(buffer, need) != NULL) { sprintf(buffer + strlen(buffer), "/%s", result); result = buffer; allocated = True; @@ -6606,10 +6618,10 @@ xtermFindShell(char *leaf, Bool warning) free(buffer); } } - } else if (*result != '\0' && strchr("+/-", *result) == 0) { + } else if (*result != '\0' && strchr("+/-", *result) == NULL) { /* find it in $PATH */ - if ((s = s0 = x_getenv("PATH")) != 0) { - if ((tmp = TypeMallocN(char, strlen(leaf) + strlen(s) + 2)) != 0) { + if ((s = s0 = x_getenv("PATH")) != NULL) { + if ((tmp = TypeMallocN(char, strlen(leaf) + strlen(s) + 2)) != NULL) { Bool found = False; while (*s != '\0') { strcpy(tmp, s); @@ -6643,14 +6655,13 @@ xtermFindShell(char *leaf, Bool warning) xtermWarning("No absolute path found for shell: %s\n", result); if (allocated) free(result); - result = 0; + result = NULL; } /* be consistent, so that caller can always free the result */ - if (result != 0 && !allocated) + if (result != NULL && !allocated) result = x_strdup(result); return result; } -#endif /* VMS */ #define ENV_HUNK(n) (unsigned) ((((n) + 1) | 31) + 1) @@ -6725,7 +6736,7 @@ findEnv(const char *var, int *lengthp) void xtermSetenv(const char *var, const char *value) { - if (value != 0) { + if (value != NULL) { #ifdef HAVE_PUTENV char *both = malloc(2 + strlen(var) + strlen(value)); TRACE(("xtermSetenv(%s=%s)\n", var, value)); @@ -6833,7 +6844,7 @@ xt_error(String message) /* * Check for the obvious - Xt does a poor job of reporting this. */ - if (x_getenv("DISPLAY") == 0) { + if (x_getenv("DISPLAY") == NULL) { xtermWarning("DISPLAY is not set\n"); } exit(ERROR_MISC); @@ -6869,8 +6880,10 @@ set_vt_visibility(Bool on) TScreen *screen = TScreenOf(xw); TRACE(("set_vt_visibility(%d)\n", on)); + if (on) { if (!screen->Vshow && xw) { + resource.notMapped = False; VTInit(xw); XtMapWidget(XtParent(xw)); #if OPT_TOOLBAR @@ -6909,11 +6922,12 @@ set_tek_visibility(Bool on) if (on) { if (!TEK4014_SHOWN(xw)) { - if (tekWidget == 0) { + if (tekWidget == NULL) { TekInit(); /* will exit on failure */ } - if (tekWidget != 0) { + if (tekWidget != NULL) { Widget tekParent = SHELL_OF(tekWidget); + resource.notMapped = False; XtRealizeWidget(tekParent); XtMapWidget(XtParent(tekWidget)); #if OPT_TOOLBAR @@ -7030,21 +7044,21 @@ cmp_resources(const void *a, const void } XrmOptionDescRec * -sortedOptDescs(XrmOptionDescRec * descs, Cardinal res_count) +sortedOptDescs(const XrmOptionDescRec * descs, Cardinal res_count) { - static XrmOptionDescRec *res_array = 0; + static XrmOptionDescRec *res_array = NULL; #ifdef NO_LEAKS - if (descs == 0) { + if (descs == NULL) { FreeAndNull(res_array); } else #endif - if (res_array == 0) { + if (res_array == NULL) { Cardinal j; /* make a sorted index to 'resources' */ res_array = TypeCallocN(XrmOptionDescRec, res_count); - if (res_array != 0) { + if (res_array != NULL) { for (j = 0; j < res_count; j++) res_array[j] = descs[j]; qsort(res_array, (size_t) res_count, sizeof(*res_array), cmp_resources); @@ -7062,19 +7076,19 @@ sortedOptDescs(XrmOptionDescRec * descs, OptionHelp * sortedOpts(OptionHelp * options, XrmOptionDescRec * descs, Cardinal numDescs) { - static OptionHelp *opt_array = 0; + static OptionHelp *opt_array = NULL; #ifdef NO_LEAKS - if (descs == 0 && opt_array != 0) { + if (descs == NULL && opt_array != NULL) { sortedOptDescs(descs, numDescs); FreeAndNull(opt_array); - return 0; - } else if (options == 0 || descs == 0) { - return 0; + return NULL; + } else if (options == NULL || descs == NULL) { + return NULL; } #endif - if (opt_array == 0) { + if (opt_array == NULL) { size_t opt_count, j; #if OPT_TRACE Cardinal k; @@ -7087,7 +7101,7 @@ sortedOpts(OptionHelp * options, XrmOpti #endif /* count 'options' and make a sorted index to it */ - for (opt_count = 0; options[opt_count].opt != 0; ++opt_count) { + for (opt_count = 0; options[opt_count].opt != NULL; ++opt_count) { ; } opt_array = TypeCallocN(OptionHelp, opt_count + 1); @@ -7113,10 +7127,10 @@ sortedOpts(OptionHelp * options, XrmOpti sprintf(temp, "%.*s", (int) sizeof(temp) - 2, opt_array[j].desc); - if (x_strindex(temp, "inhibit") != 0) + if (x_strindex(temp, "inhibit") != NULL) code = -code; if (code != 0 - && res_array[k].value != 0 + && res_array[k].value != NULL && !strcmp(name, res_array[k].option + 1)) { if (((code < 0) && !strcmp(value, "on")) || ((code > 0) && !strcmp(value, "off")) @@ -7149,8 +7163,8 @@ xtermEnvLocale(void) { static String result; - if (result == 0) { - if ((result = x_nonempty(setlocale(LC_CTYPE, 0))) == 0) { + if (result == NULL) { + if ((result = x_nonempty(setlocale(LC_CTYPE, NULL))) == NULL) { result = x_strdup("C"); } else { result = x_strdup(result); @@ -7165,7 +7179,7 @@ xtermEnvEncoding(void) { static char *result; - if (result == 0) { + if (result == NULL) { #ifdef HAVE_LANGINFO_CODESET result = nl_langinfo(CODESET); #else @@ -7225,10 +7239,10 @@ getXtermWidget(Widget w) { XtermWidget xw; - if (w == 0) { + if (w == NULL) { xw = (XtermWidget) CURRENT_EMU(); if (!IsXtermWidget(xw)) { - xw = 0; + xw = NULL; } } else if (IsXtermWidget(w)) { xw = (XtermWidget) w; @@ -7246,7 +7260,7 @@ static void trace_1_SM(const char *tag, String name) { Arg args[1]; - char *buf = 0; + char *buf = NULL; XtSetArg(args[0], name, &buf); XtGetValues(toplevel, args, 1); @@ -7417,7 +7431,7 @@ static char * formatFontParam(char *result, XtermWidget xw, const FontParams * parameter) { sprintf(result, "%s*%s:", ProgramName, parameter->name); - if (xw != None) { + if (xw != NULL) { char *next = result + strlen(result); switch (parameter->type) { case B_ARG: @@ -7491,7 +7505,7 @@ findFontParams(int argc, char **argv) break; if (value) { - formatFontParam(expect, None, fontParams + my_param); + formatFontParam(expect, NULL, fontParams + my_param); } else { strcpy(expect, "-xrm"); } @@ -7551,7 +7565,7 @@ xtermUpdateRestartCommand(XtermWidget xw { if (resource.sessionMgt) { Arg args[1]; - char **argv = 0; + char **argv = NULL; XtSetArg(args[0], XtNrestartCommand, &argv); XtGetValues(toplevel, args, 1); @@ -7933,6 +7947,19 @@ xtermFreeTitle(SaveTitle * item) } #if OPT_XTERM_SGR +void +xtermReportTitleStack(XtermWidget xw) +{ + TScreen *screen = TScreenOf(xw); + char reply[100]; + + sprintf(reply, "%d;%d", screen->saved_titles.used, MAX_SAVED_TITLES); + unparseputc1(xw, ANSI_CSI); + unparseputs(xw, reply); + unparseputc(xw, '#'); + unparseputc(xw, 'S'); + unparse_end(xw); +} #if OPT_TRACE static char * @@ -8033,7 +8060,7 @@ xtermReportSGR(XtermWidget xw, XTermRect memset(&working, 0, sizeof(working)); for (row = value->top - 1; row < value->bottom; ++row) { LineData *ld = getLineData(screen, row); - if (ld == 0) + if (ld == NULL) continue; for (col = value->left - 1; col < value->right; ++col) { if (first) { Index: xsrc/external/mit/xterm/dist/ptyx.h diff -u xsrc/external/mit/xterm/dist/ptyx.h:1.21 xsrc/external/mit/xterm/dist/ptyx.h:1.22 --- xsrc/external/mit/xterm/dist/ptyx.h:1.21 Thu Jul 4 09:09:18 2024 +++ xsrc/external/mit/xterm/dist/ptyx.h Sun Mar 9 23:18:48 2025 @@ -1,7 +1,7 @@ -/* $XTermId: ptyx.h,v 1.1124 2024/05/21 23:30:59 tom Exp $ */ +/* $XTermId: ptyx.h,v 1.1135 2025/01/05 20:36:10 tom Exp $ */ /* - * Copyright 1999-2023,2024 by Thomas E. Dickey + * Copyright 1999-2024,2025 by Thomas E. Dickey * * All Rights Reserved * @@ -186,9 +186,6 @@ #undef USE_PTY_DEVICE #undef USE_PTY_SEARCH #define USE_PTS_DEVICE 1 -#elif defined(VMS) -#undef USE_PTY_DEVICE -#undef USE_PTY_SEARCH #elif defined(PUCC_PTYD) #undef USE_PTY_SEARCH #elif (defined(sun) && defined(SVR4)) || defined(_ALL_SOURCE) || defined(__CYGWIN__) @@ -204,7 +201,7 @@ #if (defined (__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1))) #define USE_USG_PTYS -#elif (defined(ATT) && !defined(__sgi)) || defined(__MVS__) || (defined(SYSV) && defined(i386)) +#elif (defined(ATT) && !defined(__sgi)) || (defined(SYSV) && defined(i386)) #define USE_USG_PTYS #endif @@ -221,8 +218,6 @@ #ifndef PTYDEV #if defined(__hpux) #define PTYDEV "/dev/ptym/ptyxx" -#elif defined(__MVS__) -#define PTYDEV "/dev/ptypxxxx" #else #define PTYDEV "/dev/ptyxx" #endif @@ -231,8 +226,6 @@ #ifndef TTYDEV #if defined(__hpux) #define TTYDEV "/dev/pty/ttyxx" -#elif defined(__MVS__) -#define TTYDEV "/dev/ptypxxxx" #elif defined(USE_PTS_DEVICE) #define TTYDEV "/dev/pts/0" #else @@ -263,8 +256,6 @@ #ifndef TTYFORMAT #if defined(CRAY) #define TTYFORMAT "/dev/ttyp%03d" -#elif defined(__MVS__) -#define TTYFORMAT "/dev/ttyp%04d" #else #define TTYFORMAT "/dev/ttyp%d" #endif @@ -273,8 +264,6 @@ #ifndef PTYFORMAT #ifdef CRAY #define PTYFORMAT "/dev/pty/%03d" -#elif defined(__MVS__) -#define PTYFORMAT "/dev/ptyp%04d" #else #define PTYFORMAT "/dev/ptyp%d" #endif @@ -283,8 +272,6 @@ #ifndef PTYCHARLEN #ifdef CRAY #define PTYCHARLEN 3 -#elif defined(__MVS__) -#define PTYCHARLEN 8 /* OS/390 stores, e.g. ut_id="ttyp1234" */ #else #define PTYCHARLEN 2 #endif @@ -328,7 +315,7 @@ typedef const Char *UString; typedef Char *UString; #endif -#define IsEmpty(s) ((s) == 0 || *(s) == '\0') +#define IsEmpty(s) ((s) == NULL || *(s) == '\0') #define IsSpace(c) ((c) == ' ' || (c) == '\t' || (c) == '\r' || (c) == '\n') /* @@ -336,11 +323,12 @@ typedef Char *UString; * "PartS2L" when more data may follow in the string. */ #define FullS2L(s,d) (PartS2L(s,d) && (*(d) == '\0')) -#define PartS2L(s,d) (isdigit(CharOf(*(s))) && (d) != (s) && (d) != 0) +#define PartS2L(s,d) (isdigit(CharOf(*(s))) && (d) != (s) && (d) != NULL) #define CASETYPE(name) case name: result = #name; break -#define CharOf(n) ((Char)(n)) +#define AsciiOf(n) (0x7f & (n)) /* extract 7-bit character */ +#define CharOf(n) ((Char)(n)) /* extract 8-bit character */ typedef struct { int row; @@ -531,6 +519,10 @@ typedef enum { #define OPT_BLINK_TEXT OPT_BLINK_CURS /* true if xterm has blinking text capability */ #endif +#ifndef OPT_BLOCK_SELECT +#define OPT_BLOCK_SELECT 0 /* true if block-select is supported */ +#endif + #ifndef OPT_BOX_CHARS #define OPT_BOX_CHARS 1 /* true if xterm can simulate box-characters */ #endif @@ -611,14 +603,6 @@ typedef enum { #define OPT_DOUBLE_BUFFER 0 /* true if using double-buffering */ #endif -#ifndef OPT_EBCDIC -#ifdef __MVS__ -#define OPT_EBCDIC 1 -#else -#define OPT_EBCDIC 0 -#endif -#endif - #ifndef OPT_EXEC_SELECTION #define OPT_EXEC_SELECTION 1 /* true if xterm can exec to process selection */ #endif @@ -1015,13 +999,21 @@ typedef enum { tmSetBase16 = 1 /* set title using hex-string */ , tmGetBase16 = 2 /* get title using hex-string */ #if OPT_WIDE_CHARS +#define MAX_TITLEMODE 3 , tmSetUtf8 = 4 /* like utf8Title, but controllable */ , tmGetUtf8 = 8 /* retrieve title encoded as UTF-8 */ +#else +#define MAX_TITLEMODE 1 #endif } TitleModes; +#define ValidTitleMode(code) ((code) >= 0 && (code) <= MAX_TITLEMODE) #define IsTitleMode(xw,mode) (((xw)->screen.title_modes & mode) != 0) +#define IsSetUtf8Title(xw) (IsTitleMode(xw, tmSetUtf8) \ + || ((xw)->screen.utf8_title) \ + || ((xw)->screen.c1_printable)) + #include <xcharmouse.h> /* @@ -1061,6 +1053,8 @@ typedef enum { ,nrc_ISO_Latin_2_Supp /* vt5xx */ ,nrc_ISO_Latin_5_Supp /* vt5xx */ ,nrc_ISO_Latin_Cyrillic /* vt5xx */ + ,nrc_JIS_Katakana /* vt382 */ + ,nrc_JIS_Roman /* vt382 */ ,nrc_Norwegian_Danish /* vt3xx */ ,nrc_Norwegian_Danish2 /* vt2xx */ ,nrc_Norwegian_Danish3 /* vt2xx */ @@ -1099,19 +1093,29 @@ typedef enum { ,srm_X10_MOUSE = SET_X10_MOUSE #if OPT_TOOLBAR ,srm_RXVT_TOOLBAR = 10 +#else + ,srm_DECEDM = 10 /* vt330:edit */ #endif + ,srm_DECLTM = 11 /* vt330:line transmit */ #if OPT_BLINK_CURS ,srm_ATT610_BLINK = 12 ,srm_CURSOR_BLINK_OPS = 13 ,srm_XOR_CURSOR_BLINKS = 14 -#endif - ,srm_DECPFF = 18 /* Print Form Feed Mode */ - ,srm_DECPEX = 19 /* Printer Extent Mode */ +#else + ,srm_DECKANAM = 12 /* vt382:Katakana shift */ + ,srm_DECSCFDM = 13 /* vt330:space compression field delimiter */ + ,srm_DECTEM = 14 /* vt330:transmission execution */ +#endif + ,srm_DECEKEM = 16 /* vt330:edit key execution */ + ,srm_DECPFF = 18 /* vt220:Print Form Feed Mode */ + ,srm_DECPEX = 19 /* vt220:Printer Extent Mode */ ,srm_DECTCEM = 25 /* Text Cursor Enable Mode */ ,srm_RXVT_SCROLLBAR = 30 ,srm_DECRLM = 34 /* vt510:Cursor Right to Left Mode */ #if OPT_SHIFT_FONTS ,srm_RXVT_FONTSIZE = 35 /* also vt520:DECHEBM */ +#else + ,srm_DECHEBM = 35 /* vt520:Hebrew keyboard mapping */ #endif ,srm_DECHEM = 36 /* vt510:Hebrew Encoding Mode */ #if OPT_TEK4014 @@ -1131,8 +1135,10 @@ typedef enum { ,srm_DECGPBM = 46 /* Graphics Print Background Mode */ #endif ,srm_ALTBUF = 47 /* also DECGRPM (Graphics Rotated Print Mode) */ + ,srm_DEC131TM = 53 /* vt330:VT131 transmit */ ,srm_DECNAKB = 57 /* vt510:Greek/N-A Keyboard Mapping */ ,srm_DECIPEM = 58 /* vt510:IBM ProPrinter Emulation Mode */ + ,srm_DECKKDM = 59 /* vt382:Kanji/Katakana */ ,srm_DECHCCM = 60 /* vt420:Horizontal Cursor-Coupling Mode */ ,srm_DECVCCM = 61 /* vt420:Vertical Cursor-Coupling Mode */ ,srm_DECPCCM = 64 /* vt420:Page Cursor-Coupling Mode */ @@ -1142,7 +1148,7 @@ typedef enum { ,srm_DECLRMM = 69 /* vt420:Vertical Split Screen Mode (DECVSSM) */ ,srm_DECXRLM = 73 /* vt420:Transmit Rate Limiting */ #if OPT_SIXEL_GRAPHICS - ,srm_DECSDM = 80 /* Sixel Display Mode */ + ,srm_DECSDM = 80 /* vt320:Sixel Display Mode */ #endif ,srm_DECKPM = 81 /* vt420:Key Position Mode */ ,srm_DECNCSM = 95 /* vt510:No Clearing Screen On Column Change */ @@ -1150,10 +1156,11 @@ typedef enum { ,srm_DECCRTSM = 97 /* vt510:CRT Save Mode */ ,srm_DECARSM = 98 /* vt510:Auto Resize Mode */ ,srm_DECMCM = 99 /* vt510:Modem Control Mode */ - ,srm_DECCAAM = 100 /* vt510:Auto Answerback Mode */ + ,srm_DECAAM = 100 /* vt510:Auto Answerback Mode */ ,srm_DECCANSM = 101 /* vt510:Conceal Answerback Message Mode */ ,srm_DECNULM = 102 /* vt510:Ignoring Null Mode */ ,srm_DECHDPXM = 103 /* vt510:Half-Duplex Mode */ + ,srm_DECESKM = 104 /* vt510:enable secondary keyboard language */ ,srm_DECOSCNM = 106 /* vt510:Overscan Mode */ ,srm_DECNUMLK = 108 /* vt510:Num Lock Mode */ ,srm_DECCAPSLK = 109 /* vt510:Caps Lock Mode */ @@ -1598,7 +1605,7 @@ typedef enum { #define DBLCS_BITS 4 #define DBLCS_MASK BITS2MASK(DBLCS_BITS) -#define GetLineDblCS(ld) (((ld)->bufHead >> LINEFLAG_BITS) & DBLCS_MASK) +#define GetLineDblCS(ld) ((ld) != NULL ? (((ld)->bufHead >> LINEFLAG_BITS) & DBLCS_MASK) : 0) #define SetLineDblCS(ld,cs) (ld)->bufHead = (RowData) ((ld->bufHead & LINEFLAG_MASK) | (cs << LINEFLAG_BITS)) #define LineCharSet(screen, ld) \ @@ -1645,18 +1652,10 @@ typedef enum { /***====================================================================***/ -#if OPT_EBCDIC -extern int E2A(int); -extern int A2E(int); -#else -#define E2A(a) (a) -#define A2E(a) (a) -#endif - -#define CONTROL(a) (A2E(E2A(a)&037)) +#define CONTROL(a) ((a) & 037) -#define XTERM_ERASE A2E(CONTROL('H')) -#define XTERM_LNEXT A2E(CONTROL('V')) +#define XTERM_ERASE CONTROL('H') +#define XTERM_LNEXT CONTROL('V') /***====================================================================***/ @@ -1836,7 +1835,7 @@ typedef unsigned CellColor; #define isSameCColor(p,q) ((p) == (q)) #endif -#define BITS2MASK(b) ((1 << b) - 1) +#define BITS2MASK(b) (xBIT(b) - 1) #define COLOR_MASK BITS2MASK(COLOR_BITS) @@ -2640,6 +2639,7 @@ typedef struct { PrinterState printer_state; /* actual printer state */ PrinterFlags printer_flags; /* working copy of printer flags */ + Boolean print_rawchars; /* true to ignore printer check */ #if OPT_PRINT_ON_EXIT Boolean write_error; #endif @@ -2986,6 +2986,11 @@ typedef struct { int firstValidRow; /* Valid rows for selection clipping */ int lastValidRow; /* " " */ +#if OPT_BLOCK_SELECT + int lastSelectWasBlock; + int blockSelecting; /* non-zero if block selection */ +#endif + Boolean selectToBuffer; /* copy selection to buffer */ InternalSelect internal_select; @@ -3729,7 +3734,7 @@ typedef struct { #endif /* NO_ACTIVE_ICON */ -#define okFont(font) ((font) != 0 && (font)->fid != 0) +#define okFont(font) ((font) != NULL && (font)->fid != 0) /* * Macro to check if we are iconified; do not use render for that case. Index: xsrc/external/mit/xterm/dist/resize.c diff -u xsrc/external/mit/xterm/dist/resize.c:1.6 xsrc/external/mit/xterm/dist/resize.c:1.7 --- xsrc/external/mit/xterm/dist/resize.c:1.6 Thu Jul 4 09:09:18 2024 +++ xsrc/external/mit/xterm/dist/resize.c Sun Mar 9 23:18:48 2025 @@ -1,7 +1,7 @@ -/* $XTermId: resize.c,v 1.150 2023/03/31 23:09:38 tom Exp $ */ +/* $XTermId: resize.c,v 1.153 2024/12/01 20:21:19 tom Exp $ */ /* - * Copyright 2003-2022,2023 by Thomas E. Dickey + * Copyright 2003-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -92,11 +92,7 @@ int ignore_unused; #endif -#ifdef __MVS__ -#define ESCAPE(string) "\047" string -#else #define ESCAPE(string) "\033" string -#endif #define EMULATIONS 2 #define SUN 1 @@ -150,18 +146,18 @@ static const char *const getsize[EMULATI #if defined(USE_STRUCT_WINSIZE) static const char *const getwsize[EMULATIONS] = { /* size in pixels */ - 0, + NULL, ESCAPE("[14t"), }; #endif /* USE_STRUCT_WINSIZE */ static const char *const restore[EMULATIONS] = { ESCAPE("8"), - 0, + NULL, }; static const char *const setsize[EMULATIONS] = { - 0, + NULL, ESCAPE("[8;%s;%st"), }; @@ -190,7 +186,7 @@ static FILE *ttyfp; #if defined(USE_STRUCT_WINSIZE) static const char *wsize[EMULATIONS] = { - 0, + NULL, ESCAPE("[4;%hd;%hdt"), }; #endif /* USE_STRUCT_WINSIZE */ @@ -467,7 +463,7 @@ main(int argc, char **argv ENVP_ARG) } #endif /* USE_TERMCAP */ #ifdef USE_TERMINFO - if (x_getenv("TERM") == 0) { + if (x_getenv("TERM") == NULL) { if (SHELL_BOURNE == shell_type) { setname = "TERM=" DFT_TERMTYPE ";\nexport TERM;\n"; } else { @@ -521,7 +517,7 @@ main(int argc, char **argv ENVP_ARG) strlen(argv[0]) + strlen(argv[1]) + 1); - if (tmpbuf == 0) { + if (tmpbuf == NULL) { fprintf(stderr, "%s: Cannot query size\n", myname); onintr(0); } else { Index: xsrc/external/mit/xterm/dist/scrollback.c diff -u xsrc/external/mit/xterm/dist/scrollback.c:1.9 xsrc/external/mit/xterm/dist/scrollback.c:1.10 --- xsrc/external/mit/xterm/dist/scrollback.c:1.9 Thu Jul 4 09:09:18 2024 +++ xsrc/external/mit/xterm/dist/scrollback.c Sun Mar 9 23:18:48 2025 @@ -1,7 +1,7 @@ -/* $XTermId: scrollback.c,v 1.23 2022/03/09 00:38:51 tom Exp $ */ +/* $XTermId: scrollback.c,v 1.24 2024/12/01 20:27:00 tom Exp $ */ /* - * Copyright 2009-2020,2022 by Thomas E. Dickey + * Copyright 2009-2022,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -44,7 +44,7 @@ LineData * getScrollback(TScreen *screen, int row) { - LineData *result = 0; + LineData *result = NULL; if (screen->saved_fifo > 0 && REAL_ROW(screen, row) >= 0) { unsigned which = ROW2FIFO(screen, row); @@ -64,10 +64,10 @@ getScrollback(TScreen *screen, int row) LineData * addScrollback(TScreen *screen) { - ScrnBuf where = 0; + ScrnBuf where = NULL; unsigned ncols = (unsigned) MaxCols(screen); - if (screen->saveBuf_index != 0 && screen->savelines != 0) { + if (screen->saveBuf_index != NULL && screen->savelines != 0) { unsigned which; Char *block; @@ -84,7 +84,7 @@ addScrollback(TScreen *screen) * setupLineData uses the attribs as the first address used from the * data block. */ - if (prior->attribs != 0) { + if (prior->attribs != NULL) { TRACE(("...freeing prior FIFO data in slot %d: %p->%p\n", which, (void *) prior, (void *) prior->attribs)); FreeAndNull(prior->attribs); @@ -118,7 +118,7 @@ deleteScrollback(TScreen *screen) * setupLineData uses the attribs as the first address used from the * data block. */ - if (prior->attribs != 0) { + if (prior->attribs != NULL) { TRACE(("...freeing prior FIFO data in slot %d: %p->%p\n", which, (void *) prior, (void *) prior->attribs)); FreeAndNull(prior->attribs); Index: xsrc/external/mit/xterm/dist/xterm.h diff -u xsrc/external/mit/xterm/dist/xterm.h:1.9 xsrc/external/mit/xterm/dist/xterm.h:1.10 --- xsrc/external/mit/xterm/dist/xterm.h:1.9 Thu Jul 4 09:09:18 2024 +++ xsrc/external/mit/xterm/dist/xterm.h Sun Mar 9 23:18:48 2025 @@ -1,7 +1,7 @@ -/* $XTermId: xterm.h,v 1.947 2024/05/21 23:33:24 tom Exp $ */ +/* $XTermId: xterm.h,v 1.959 2025/01/05 21:15:01 tom Exp $ */ /* - * Copyright 1999-2023,2024 by Thomas E. Dickey + * Copyright 1999-2024,2025 by Thomas E. Dickey * * All Rights Reserved * @@ -123,7 +123,7 @@ #define HAVE_UTMP 1 #endif -#if (defined(__MVS__) || defined(SVR4) || defined(__SCO__) || defined(BSD_UTMPX)) && !defined(__CYGWIN__) +#if (defined(SVR4) || defined(__SCO__) || defined(BSD_UTMPX)) && !defined(__CYGWIN__) #define UTMPX_FOR_UTMP 1 #endif @@ -131,7 +131,7 @@ #define HAVE_UTMP_UT_HOST 1 #endif -#if defined(UTMPX_FOR_UTMP) && !(defined(__MVS__) || defined(__hpux) || defined(__FreeBSD__)) +#if defined(UTMPX_FOR_UTMP) && !(defined(__hpux) || defined(__FreeBSD__)) #define HAVE_UTMP_UT_SESSION 1 #endif @@ -172,11 +172,11 @@ #define USE_POSIX_WAIT #endif -#if defined(AIXV3) || defined(CRAY) || defined(__SCO__) || defined(SVR4) || (defined(SYSV) && defined(i386)) || defined(__MVS__) || defined(__hpux) || defined(__osf__) || defined(__linux__) || defined(macII) || defined(BSD_UTMPX) +#if defined(AIXV3) || defined(CRAY) || defined(__SCO__) || defined(SVR4) || (defined(SYSV) && defined(i386)) || defined(__hpux) || defined(__osf__) || defined(__linux__) || defined(macII) || defined(BSD_UTMPX) #define USE_SYSV_UTMP #endif -#if defined(__GNU__) || defined(__MVS__) || defined(__osf__) +#if defined(__GNU__) || defined(__osf__) #define USE_TTY_GROUP #endif @@ -188,13 +188,6 @@ #define TTY_GROUP_NAME "terminal" #endif -#if defined(__MVS__) -#undef ut_xstatus -#define ut_name ut_user -#define ut_xstatus ut_exit.ut_e_exit -#define ut_xtime ut_tv.tv_sec -#endif - #if defined(ut_xstatus) #define HAVE_UTMP_UT_XSTATUS 1 #endif @@ -207,7 +200,7 @@ #define HAVE_POSIX_SAVED_IDS #endif -#if defined(__linux__) || defined(__GLIBC__) || (defined(SYSV) && (defined(CRAY) || defined(macII) || defined(__hpux) || defined(__osf__) || defined(__sgi))) || !(defined(SYSV) || defined(__QNX__) || defined(VMS) || defined(__INTERIX)) +#if defined(__linux__) || defined(__GLIBC__) || (defined(SYSV) && (defined(CRAY) || defined(macII) || defined(__hpux) || defined(__osf__) || defined(__sgi))) || !(defined(SYSV) || defined(__QNX__) || defined(__INTERIX)) #define HAVE_INITGROUPS #endif @@ -272,6 +265,7 @@ extern void free(); #ifdef HAVE_UNISTD_H #include <unistd.h> +#undef HAVE_UNISTD_H #endif #ifdef HAVE_SYS_WAIT_H @@ -366,9 +360,6 @@ extern int errno; #else #define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval *)t) #define XFD_COPYSET(src,dst) memcpy((dst)->fds_bits, (src)->fds_bits, sizeof(fd_set)) -#if defined(__MVS__) && !defined(TIME_WITH_SYS_TIME) -#define TIME_WITH_SYS_TIME -#endif #endif #ifdef TIME_WITH_SYS_TIME @@ -398,7 +389,7 @@ extern int errno; #include <setjmp.h> -#if !defined(VMS) && !(defined(__linux__) && defined(__USE_GNU)) && !defined(__hpux) && !defined(_ALL_SOURCE) && !defined(__osf__) +#if !(defined(__linux__) && defined(__USE_GNU)) && !defined(__hpux) && !defined(_ALL_SOURCE) && !defined(__osf__) extern char **environ; #endif @@ -411,7 +402,7 @@ extern char **environ; #define Maybe 2 #define ALLOC_STRING(name) \ - if (name != 0) \ + if (name != NULL) \ name = x_strdup(name) #define FREE_STRING(name) \ free_string(name) @@ -608,6 +599,7 @@ extern char **environ; #define XtNmultiScroll "multiScroll" #define XtNnMarginBell "nMarginBell" #define XtNnextEventDelay "nextEventDelay" +#define XtNnotMapped "notMapped" #define XtNnumColorRegisters "numColorRegisters" #define XtNnumLock "numLock" #define XtNoldXtermFKeys "oldXtermFKeys" @@ -627,6 +619,7 @@ extern char **environ; #define XtNprintModeOnXError "printModeOnXError" #define XtNprintOptsImmediate "printOptsImmediate" #define XtNprintOptsOnXError "printOptsOnXError" +#define XtNprintRawChars "printRawChars" #define XtNprinterAutoClose "printerAutoClose" #define XtNprinterCommand "printerCommand" #define XtNprinterControlMode "printerControlMode" @@ -866,6 +859,7 @@ extern char **environ; #define XtCMultiClickTime "MultiClickTime" #define XtCMultiScroll "MultiScroll" #define XtCNextEventDelay "NextEventDelay" +#define XtCNotMapped "NotMapped" #define XtCNumColorRegisters "NumColorRegisters" #define XtCNumLock "NumLock" #define XtCOldXtermFKeys "OldXtermFKeys" @@ -882,6 +876,7 @@ extern char **environ; #define XtCPrintModeOnXError "PrintModeOnXError" #define XtCPrintOptsImmediate "PrintOptsImmediate" #define XtCPrintOptsOnXError "PrintOptsOnXError" +#define XtCPrintRawChars "PrintRawChars" #define XtCPrinterAutoClose "PrinterAutoClose" #define XtCPrinterCommand "PrinterCommand" #define XtCPrinterControlMode "PrinterControlMode" @@ -1047,7 +1042,7 @@ extern void HandleSelectStart P extern void HandleStartExtend PROTO_XT_ACTIONS_ARGS; extern void ResizeSelection (TScreen * /* screen */, int /* rows */, int /* cols */); extern void ScrollSelection (TScreen * /* screen */, int /* amount */, Bool /* always */); -extern void TrackMouse (XtermWidget /* xw */, int /* func */, CELL * /* start */, int /* firstrow */, int /* lastrow */); +extern void TrackMouse (XtermWidget /* xw */, int /* func */, const CELL * /* start */, int /* firstrow */, int /* lastrow */); extern void ViButton PROTO_XT_ACTIONS_ARGS; extern void UnmapSelections (XtermWidget /* xw */); @@ -1140,7 +1135,7 @@ extern void releaseCursorGCs(XtermWidget extern void releaseWindowGCs(XtermWidget /*xw*/, VTwin * /*win*/); extern void resetCharsets (TScreen * /* screen */); extern void resetMargins (XtermWidget /* xw */); -extern void restoreCharsets (TScreen * /* screen */, DECNRCM_codes * /* source */); +extern void restoreCharsets (TScreen * /* screen */, const DECNRCM_codes * /* source */); extern void saveCharsets (TScreen * /* screen */, DECNRCM_codes * /* target */); extern void set_max_col(TScreen * /* screen */, int /* cols */); extern void set_max_row(TScreen * /* screen */, int /* rows */); @@ -1268,10 +1263,6 @@ extern Atom CachedInternAtom(Display * / extern int get_tty_erase(int /* fd */, int /* default_erase */, const char * /* tag */); extern int get_tty_lnext(int /* fd */, int /* default_lnext */, const char * /* tag */); -#if (defined(VMS) || defined(__VMS)) -#define GetBytesAvailable(dpy) ((dpy)->qlen > 0) -#endif - #if OPT_PTY_HANDSHAKE extern void first_map_occurred (void); #else @@ -1311,7 +1302,7 @@ extern String xtermEnvLocale (void); extern Widget xtermOpenApplication (XtAppContext * /* app_context_return */, String /* application_class */, XrmOptionDescRec */* options */, Cardinal /* num_options */, int * /* argc_in_out */, char **/* argv_in_out */, String * /* fallback_resources */, WidgetClass /* widget_class */, ArgList /* args */, Cardinal /* num_args */); extern Window WMFrameWindow (XtermWidget /* xw */); extern XtInputMask xtermAppPending (void); -extern XrmOptionDescRec * sortedOptDescs (XrmOptionDescRec *, Cardinal); +extern XrmOptionDescRec * sortedOptDescs (const XrmOptionDescRec *, Cardinal); extern XtermWidget getXtermWidget (Widget /* w */); extern XVisualInfo *getVisualInfo (XtermWidget /* xw */); extern char *udk_lookup (XtermWidget /* xw */, int /* keycode */, int * /* len */); @@ -1365,6 +1356,7 @@ extern void hide_tek_window (void); extern void hide_vt_window (void); extern GCC_NORETURN void ice_error (IceConn /* iceConn */); extern void init_colored_cursor (Display * /* dpy */); +extern void parse_ansi_params(ANSI * /* params */, const char ** /* string */); extern void reset_decudk (XtermWidget /* xw */); extern void set_tek_visibility (Bool /* on */); extern void set_vt_visibility (Bool /* on */); @@ -1390,6 +1382,7 @@ extern void xtermWarning (const char * / extern Boolean xtermPopTitle(TScreen * /* screen */, int /* which */, SaveTitle * /* item */); extern void xtermPushTitle(TScreen * /* screen */, int /* which */, SaveTitle * /* item */); extern void xtermFreeTitle(SaveTitle *item); +extern void xtermReportTitleStack(XtermWidget /* xw */); #if OPT_DABBREV extern void HandleDabbrevExpand PROTO_XT_ACTIONS_ARGS; @@ -1513,11 +1506,7 @@ extern void xtermDumpSvg (XtermWidget /* #endif /* ptydata.c */ -#ifdef VMS -#define PtySelect int -#else #define PtySelect fd_set -#endif extern Bool decodeUtf8 (TScreen * /* screen */, PtyData * /* data */); extern int readPtyData (XtermWidget /* xw */, PtySelect * /* select_mask */, PtyData * /* data */); @@ -1719,7 +1708,7 @@ extern char * xtermSetLocale (int /* cat extern int ClearInLine (XtermWidget /* xw */, int /* row */, int /* col */, unsigned /* len */); extern int HandleExposure (XtermWidget /* xw */, XEvent * /* event */); extern int dimRound (double /* value */); -extern int drawXtermText (XTermDraw * /* param */, GC /* gc */, int /* x */, int /* y */, const IChar * /* text */, Cardinal /* len */); +extern int drawXtermText (const XTermDraw * /* param */, GC /* gc */, int /* x */, int /* y */, const IChar * /* text */, Cardinal /* len */); extern int extendedBoolean (const char * /* value */, const FlagList * /* table */, Cardinal /* limit */); extern void ChangeColors (XtermWidget /* xw */, ScrnColors * /* pNew */); extern void ClearLine (XtermWidget /* xw */); Index: xsrc/external/mit/xterm/dist/xterm.man diff -u xsrc/external/mit/xterm/dist/xterm.man:1.23 xsrc/external/mit/xterm/dist/xterm.man:1.24 --- xsrc/external/mit/xterm/dist/xterm.man:1.23 Thu Jul 4 09:09:18 2024 +++ xsrc/external/mit/xterm/dist/xterm.man Sun Mar 9 23:18:48 2025 @@ -1,7 +1,7 @@ '\" t -.\" $XTermId: xterm.man,v 1.902 2024/05/22 08:15:46 tom Exp $ +.\" $XTermId: xterm.man,v 1.911 2025/01/05 20:50:55 tom Exp $ .\" -.\" Copyright 1996-2023,2024 by Thomas E. Dickey +.\" Copyright 1996-2024,2025 by Thomas E. Dickey .\" .\" All Rights Reserved .\" @@ -1017,6 +1017,26 @@ This option specifies the number of char at which the margin bell, if enabled, will ring. The default is \*(``10\*(''. .TP 8 +.B "\-nomap" +This option disables the initial \fImapping\fP of the terminal window. +Mapping an X window makes it visible if it is \fImanaged\fP. +The default is \*(``false\*('' because \fI\*n\fP's window +is normally displayed on startup. +.IP +After startup, an unmapped \fI\*n\fP window can be mapped +by identifying its window-id, e.g., using \fBxwininfo\fP(1) +or \fBxlsclients\fP(1), +and then employing another program such as \fBxdotool\fP(1) +to ask the window manager to make it visible. +.IP +If the \fI\*n\fP window is visible (i.e., mapped), +\fI\*n\fP's menus and actions (i.e., \fBset\-visibility\fP) +allow one to select whether the VT100 or Tek4014 windows should be displayed. +.TP 8 +.B "+nomap" +This option enables the initial \fImapping\fP of the terminal window. +This is the default behavior. +.TP 8 .B "\-nul" This option disables the display of underlining. .TP 8 @@ -1279,11 +1299,11 @@ when your operating system does not supp This option resets the \fButf8\fP resource. .TP 8 .B "\-uc" -This option, corresponding to the \fBcursorUnderline\fP resource, +This option, corresponding to the \fBcursorUnderLine\fP resource, makes the cursor underlined instead of a box. .TP 8 .B "+uc" -This option m, corresponding to the \fBcursorUnderline\fP resource, +This option m, corresponding to the \fBcursorUnderLine\fP resource, akes the cursor a box instead of underlined. .TP 8 .B "\-ulc" @@ -1595,7 +1615,7 @@ First, \fI\*n\fP obtains the initial \fI .bP \fI\*n\fP's internal value is ^H .bP -\fI\*n\fP asks the operating system for the value which \fBstty\fP shows +\fI\*n\fP asks the operating system for the value which \fBstty\fP(1) shows .bP the \fBttyModes\fP resource may override \fIerase\fP .bP @@ -1915,6 +1935,10 @@ with the \fImeta\fP modifier to the \fBc scroll\-lock assigns a key\-binding to the \fBscroll\-lock()\fP action. .TP +block\-select +an optional (compile-time) feature for supporting rectangular selections. +By default, this is bound to \fIMeta button one\fP. +.TP select assigns mouse- and keypress-combinations to actions which manipulate the selection. @@ -2768,7 +2792,7 @@ You may have to set this option to \*(`` if you have some old East Asian terminal based programs that assume that line-drawing characters have a column width of 2. If this resource is false, the \fBmkWidth\fP resource controls the -choice between the system's \fBwcwidth\fP and \fI\*n\fP's built-in tables. +choice between the system's \fBwcwidth\fP(3) and \fI\*n\fP's built-in tables. The default is \*(``false\*(''. .TP 8 .B "color0\fP (class\fB Color0\fP)" @@ -2983,7 +3007,7 @@ The default is \*(``false\*(''. .TP 8 .B "cursorBar\fP (class\fB CursorBar\fP)" Specifies whether to make the cursor a left-bar or a box, -unless the \fBcursorUnderline\fP resource is set. +unless the \fBcursorUnderLine\fP resource is set. The default is \*(``false\*(''. .TP 8 .B "cursorBlink\fP (class\fB CursorBlink\fP)" @@ -3985,7 +4009,7 @@ the cursor position and the time/date: .IP If a \*(``%\*('' marker does not match any of the three special tokens used in the default resource setting, -\fI\*n\fP uses \fBstrftime\fP to interpret it. +\fI\*n\fP uses \fBstrftime\fP(3) to interpret it. .TP 8 .B "initialFont\fP (class\fB InitialFont\fP)" Specifies which of the VT100 fonts to use initially. @@ -4085,7 +4109,7 @@ The default is \*(``1024\*(''. The minimum value is \*(``256\*(''. .TP 8 .B "locale\fP (class\fB Locale\fP)" -Specifies how to use \fIluit\fR, an encoding converter between UTF-8 +Specifies how to use \fBluit\fR(1), an encoding converter between UTF-8 and locale encodings. The resource value (ignoring case) may be: .RS @@ -4243,7 +4267,7 @@ several types of control strings which c \fI\*N\fP reads these strings, accumulating them into a buffer until they are properly terminated. At that point, \fI\*n\fP interprets the strings. -If they happen to be \fBDCS\fP commands to draw ReGIS or SIXEL images, +If they happen to be \fBDCS\fP commands to draw ReGIS images, these strings may be large, in the hundreds of kilobytes. A few \fBOSC\fP commands may be as large as 10 kilobytes. .IP @@ -4860,6 +4884,9 @@ The resource value is interpreted the sa The default is \*(``9\*('', which selects the current visible screen plus saved lines, with no special case for the alternated screen. .TP 8 +.B "printRawChars\fP (class \fBPrintRawChars\fP)" +If \*(``true\*('', \fI\*n\fR allows Unicode non-characters to be printed. +.TP 8 .B "printerAutoClose\fP (class\fB PrinterAutoClose\fP)" If \*(``true\*('', \fI\*n\fR will close the printer (a pipe) when the application switches the printer offline with a Media Copy command. @@ -5960,7 +5987,7 @@ This entry invokes the \fBset\-utf8\-tit This entry invokes the \fBallow\-color\-ops(\fItoggle\fB)\fR action. .TP 8 .B "allow\-font\-ops\fP (class\fB SmeBSB\fP)" -This entry invokes the \fBallow\-fonts\-ops(\fItoggle\fB)\fR action. +This entry invokes the \fBallow\-font\-ops(\fItoggle\fB)\fR action. .TP 8 .B "allow\-tcap\-ops\fP (class\fB SmeBSB\fP)" This entry invokes the \fBallow\-tcap\-ops(\fItoggle\fB)\fR action. @@ -6894,7 +6921,7 @@ Reset origin mode (DECOM). .bP Reset all margins (i.e., top/bottom and left/right). This can be convenient when some program has left the scroll regions -set incorrectly (often a problem when using VMS or TOPS-20). +set incorrectly. .bP Set autowrap and reverse wrapping according to the resource values .BR autoWrap " and" @@ -7421,7 +7448,7 @@ This action sets, unsets or toggles the invoked by the \fBallow\-font\-ops\fP entry in \fIfontMenu\fP. .TP 8 .B "allow\-mouse\-ops(\fIon/off/toggle\fP)" -This action sets, unsets or toggles the \fBallowMousepOps\fP resource +This action sets, unsets or toggles the \fBallowMouseOps\fP resource and is also invoked by the \fBallow\-mouse\-ops\fP entry in \fIfontMenu\fP. .TP 8 .B "allow\-send\-events(\fIon/off/toggle\fP)" @@ -7873,6 +7900,11 @@ without affecting the selection mode. This action begins text selection at the current pointer location. See the section on \fBPOINTER USAGE\fP for information on making selections. +.IP +If \fI\*n\fR is configured to support block-selection, +this action accepts a parameter \*(``block\*('' +which initiates a block-selection +rather than the default character-oriented selection. .TP 8 .B "send\-signal(\fIsigname\fP)" This action sends the signal named by \fIsigname\fP @@ -8225,6 +8257,7 @@ These are for the \fIvt100\fP widget: !Lock Ctrl <Btn1Down>:\fBpopup\-menu\fP(mainMenu) \\n\\\& !Lock Ctrl @Num_Lock <Btn1Down>:\fBpopup\-menu\fP(mainMenu) \\n\\\& ! @Num_Lock Ctrl <Btn1Down>:\fBpopup\-menu\fP(mainMenu) \\n\\\& + Meta <Btn1Down>:\fBselect\-start\fP(block) \\n\\\& ~Meta <Btn1Down>:\fBselect\-start\fP() \\n\\\& ~Meta <Btn1Motion>:\fBselect\-extend\fP() \\n\\\& !Ctrl <Btn2Down>:\fBpopup\-menu\fP(vtMenu) \\n\\\& @@ -8487,7 +8520,7 @@ the shell to interpret the string \*(``\ the \fIescape\fP character and to suppress a trailing newline on output. Those are not portable, nor recommended. -Instead, use \fBprintf\fP (POSIX). +Instead, use \fBprintf\fP(1) (POSIX). .PP For example, to set the \fIwindow title\fP to \*(``Hello world!\*('', you could use one of these commands in a script: @@ -8498,7 +8531,7 @@ printf \*'\\033]2;%s\\033\\\\\*' "Hello printf \*'\\033]2;%s\\007\*' "Hello world!" .NE .PP -The \fBprintf\fP command interprets the octal value \*(``\\033\*('' for +The \fBprintf\fP(1) command interprets the octal value \*(``\\033\*('' for \fIescape\fP, and (since it was not given in the format) omits a trailing newline from the output. .PP @@ -8612,7 +8645,7 @@ to convert a terminal capability with it that can be written to the terminal. .bP Shells lacking a comparable feature (such as \fBbash\fP) can always -use the program \fBtput\fP to do this transformation. +use the program \fBtput\fP(1) to do this transformation. .PP Hard-coded escape sequences are supported by each shell, but are not recommended because those rely upon particular configurations Index: xsrc/external/mit/xterm/include/xtermcfg.h diff -u xsrc/external/mit/xterm/include/xtermcfg.h:1.21 xsrc/external/mit/xterm/include/xtermcfg.h:1.22 --- xsrc/external/mit/xterm/include/xtermcfg.h:1.21 Thu Jul 4 09:09:18 2024 +++ xsrc/external/mit/xterm/include/xtermcfg.h Sun Mar 9 23:18:49 2025 @@ -1,8 +1,8 @@ /* xtermcfg.h. Generated automatically by configure. */ -/* $XTermId: xtermcfg.hin,v 1.228 2023/01/26 00:54:10 tom Exp $ */ +/* $XTermId: xtermcfg.hin,v 1.234 2025/01/03 01:01:56 tom Exp $ */ /* - * Copyright 1997-2023,2024 by Thomas E. Dickey + * Copyright 1997-2024,2025 by Thomas E. Dickey * * All Rights Reserved * @@ -89,12 +89,9 @@ #define HAVE_MKDTEMP 1 /* AC_CHECK_FUNCS(mkdtemp) */ /* #undef HAVE_NCURSES_CURSES_H */ /* AC_CHECK_HEADERS(ncurses/curses.h) */ /* #undef HAVE_NCURSES_TERM_H */ /* AC_CHECK_HEADERS(ncurses/term.h) */ -/* #undef HAVE_PATHS_H */ /* AC_CHECK_HEADERS(paths.h) */ #define HAVE_PATHS_H 1 /* CF_LASTLOG */ -/* #undef HAVE_PCRE2POSIX_H */ /* AC_CHECK_HEADERS(pcre2posix.h) */ /* #undef HAVE_PCRE2POSIX_H */ /* CF_WITH_PCRE2 */ /* #undef HAVE_PCRE2REGCOMP */ /* CF_WITH_PCRE2 */ -/* #undef HAVE_PCREPOSIX_H */ /* AC_CHECK_HEADERS(pcreposix.h) */ /* #undef HAVE_PCREPOSIX_H */ /* CF_WITH_PCRE */ #define HAVE_POSIX_OPENPT 1 /* CF_FUNC_GRANTPT */ #define HAVE_POSIX_SAVED_IDS 1 /* CF_POSIX_SAVED_IDS */ @@ -165,6 +162,7 @@ /* #undef OPT_AIX_COLORS */ /* CF_ARG_DISABLE(16-color) */ /* #undef OPT_BLINK_CURS */ /* CF_ARG_DISABLE(blink-cursor) */ /* #undef OPT_BLINK_TEXT */ /* CF_ARG_DISABLE(blink-text) */ +#define OPT_BLOCK_SELECT 0 /* CF_ARG_ENABLE(block-select) */ /* #undef OPT_BOX_CHARS */ /* CF_ARG_DISABLE(boxchars) */ #define OPT_BROKEN_OSC 0 /* CF_ARG_ENABLE(broken-osc) */ /* #undef OPT_BROKEN_ST */ /* CF_ARG_DISABLE(broken-st) */