diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/Caps | 44 | ||||
| -rw-r--r-- | include/Caps.aix4 | 26 | ||||
| -rw-r--r-- | include/Caps.hpux11 | 26 | ||||
| -rw-r--r-- | include/Caps.keys | 26 | ||||
| -rw-r--r-- | include/Caps.osf1r5 | 20 | ||||
| -rw-r--r-- | include/Caps.uwin | 20 | ||||
| -rwxr-xr-x | include/MKkey_defs.sh | 8 | ||||
| -rw-r--r-- | include/MKterm.h.awk.in | 57 | ||||
| -rw-r--r-- | include/Makefile.in | 9 | ||||
| -rw-r--r-- | include/capdefaults.c | 6 | ||||
| -rw-r--r-- | include/curses.h.in | 104 | ||||
| -rw-r--r-- | include/curses.tail | 54 | ||||
| -rw-r--r-- | include/curses.wide | 7 | ||||
| -rw-r--r-- | include/headers | 9 | ||||
| -rw-r--r-- | include/nc_alloc.h | 25 | ||||
| -rw-r--r-- | include/nc_mingw.h | 88 | ||||
| -rw-r--r-- | include/nc_termios.h | 91 | ||||
| -rw-r--r-- | include/nc_tparm.h | 5 | ||||
| -rw-r--r-- | include/nc_win32.h.in (renamed from include/nc_win32.h) | 131 | ||||
| -rw-r--r-- | include/ncurses_cfg.hin | 6 | ||||
| -rw-r--r-- | include/ncurses_defs | 23 | ||||
| -rw-r--r-- | include/ncurses_mingw.h | 82 | ||||
| -rw-r--r-- | include/term_entry.h | 9 | ||||
| -rw-r--r-- | include/tic.h | 10 | ||||
| -rw-r--r-- | include/unctrl.h.in | 10 | ||||
| -rw-r--r-- | include/win32_curses.h | 75 |
26 files changed, 388 insertions, 583 deletions
diff --git a/include/Caps b/include/Caps index cd077b969192..7a7885274171 100644 --- a/include/Caps +++ b/include/Caps @@ -1,5 +1,5 @@ ############################################################################## -# Copyright 2019-2023,2024 Thomas E. Dickey # +# Copyright 2019-2024,2025 Thomas E. Dickey # # Copyright 1998-2015,2016 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -30,7 +30,7 @@ # Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 # and: Eric S. Raymond <esr@snark.thyrsus.com> # -# $Id: Caps,v 1.56 2024/04/20 21:05:02 tom Exp $ +# $Id: Caps,v 1.62 2025/11/12 01:06:36 Branden.Robinson Exp $ # # This is the master termcap/terminfo capability table. # @@ -167,8 +167,10 @@ # The tables are a tight fit on traditional man(7) implementations that # use a line length of 65n, and the "Description" column has little room # within which the formatter can make breaking or adjustment decisions. -# Words like "micro_..._address" and "parm_..._micro" don't break. -# Reducing the inter-column gaps to 2 ens gives them enough room. --GBR +# (MKterminfo.sh causes such columns to be formatted in tbl(1) text +# blocks.) Words like "micro_..._address" and "parm_..._micro" don't +# break. Reducing the inter-column gaps to 2 ens gives them enough +# room. --GBR # ############################################################################# # @@ -241,12 +243,15 @@ #%behavior, #%for instance if the string contains percent signs. #%. +#%.br +#%.if n .ne 4v +#%.if t .ne 3v #%.PP #%.TS #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Boolean Capability Name TI TC Description #%_ @@ -294,7 +299,7 @@ lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Numeric Capability Name TI TC Description #%_ @@ -311,7 +316,10 @@ label_height lh num lh - - ----- rows in each label label_width lw num lw - - ----- columns in each label max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle maximum_windows wnum num MW - - ----- maximum number of definable windows -# These came in with SVr4's color support +# The following were introduced by SVr3.2's color support. +# https://github.com/ryanwoodsmall/oldsysv/blob/\ +# e68293af91e2dc39f5f29c20d7e429f9e0cabc75/\ +# sysvr3/32/usr/src/lib/libcurses/screen/caps#L64 max_colors colors num Co - - ----- maximum number of colors on screen max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen no_color_video ncv num NC - - ----- video attributes that cannot be used with colors @@ -327,7 +335,7 @@ no_color_video ncv num NC - - ----- video attributes that cannot be used with #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Numeric Capability Name TI TC Description #%_ @@ -355,7 +363,7 @@ bit_image_type bitype num Yp - - ----- type of bit-image device #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ @@ -424,7 +432,7 @@ key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key @@ -451,8 +459,8 @@ key_sf kind str kF KEY_SF 0520 -B-G-* scroll-forward key key_sr kri str kR KEY_SR 0521 -B-G-* scroll-backward key key_stab khts str kT KEY_STAB 0524 -B-G-* set-tab key key_up kcuu1 str ku KEY_UP 0403 YBCGE up-arrow key -keypad_local rmkx str ke - - YBCGE leave keyboard transmit mode -keypad_xmit smkx str ks - - YBCGE enter keyboard transmit mode +keypad_local rmkx str ke - - YBCGE leave keypad transmit mode +keypad_xmit smkx str ks - - YBCGE enter keypad transmit mode lab_f0 lf0 str l0 - - -B-G-* label on function key f0 if not f0 lab_f1 lf1 str l1 - - -B-G-* label on function key f1 if not f1 lab_f10 lf10 str la - - ----- label on function key f10 if not f10 @@ -490,7 +498,7 @@ reset_2string rs2 str r2 - - -B--- reset string #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. reset_3string rs3 str r3 - - -B--- reset string reset_file rf str rf - - -B--- name of reset file restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor @@ -560,7 +568,7 @@ key_undo kund str &8 KEY_UNDO 0630 ----- undo key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key @@ -626,7 +634,7 @@ key_f42 kf42 str FW KEY_F(42) - ----E F42 function key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_f43 kf43 str FX KEY_F(43) - ----E F43 function key key_f44 kf44 str FY KEY_F(44) - ----E F44 function key key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key @@ -698,7 +706,7 @@ enter_doublewide_mode swidm str ZF - - ----- Enter double-wide mode #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. enter_draft_quality sdrfq str ZG - - ----- Enter draft-quality mode enter_italics_mode sitm str ZH - - ----- Enter italic mode enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion @@ -754,7 +762,7 @@ zero_motion zerom str Zx - - ----- No motion for subsequent character #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ @@ -810,7 +818,7 @@ alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulatio #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ diff --git a/include/Caps.aix4 b/include/Caps.aix4 index 1adb848e08b1..0305001abeba 100644 --- a/include/Caps.aix4 +++ b/include/Caps.aix4 @@ -1,5 +1,5 @@ ############################################################################## -# Copyright 2019-2023,2024 Thomas E. Dickey # +# Copyright 2019-2024,2025 Thomas E. Dickey # # Copyright 2001-2015,2016 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -29,7 +29,7 @@ # # Author: Thomas Dickey # -# $Id: Caps.aix4,v 1.28 2024/04/20 21:05:02 tom Exp $ +# $Id: Caps.aix4,v 1.30 2025/11/12 01:27:41 tom Exp $ # # This is an adaptation of ncurses' termcap/terminfo capability table, which # is designed to align with AIX 4.x's terminfo. @@ -246,7 +246,7 @@ #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Boolean Capability Name TI TC Description #%_ @@ -294,7 +294,7 @@ lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Numeric Capability Name TI TC Description #%_ @@ -327,7 +327,7 @@ no_color_video ncv num NC - - ----- video attributes that cannot be used with #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Numeric Capability Name TI TC Description #%_ @@ -355,7 +355,7 @@ bit_image_type bitype num Yp - - ----- type of bit-image device #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ @@ -424,7 +424,7 @@ key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key @@ -490,7 +490,7 @@ reset_2string rs2 str r2 - - -B--- reset string #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. reset_3string rs3 str r3 - - -B--- reset string reset_file rf str rf - - -B--- name of reset file restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor @@ -642,7 +642,7 @@ key_f42 kf42 str FW KEY_F(42) - ----E F42 function key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_f43 kf43 str FX KEY_F(43) - ----E F43 function key key_f44 kf44 str FY KEY_F(44) - ----E F44 function key key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key @@ -719,7 +719,7 @@ key_undo kund str &8 KEY_UNDO 0630 ----- undo key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key @@ -800,7 +800,7 @@ enter_doublewide_mode swidm str ZF - - ----- Enter double-wide mode #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. enter_draft_quality sdrfq str ZG - - ----- Enter draft-quality mode enter_italics_mode sitm str ZH - - ----- Enter italic mode enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion @@ -856,7 +856,7 @@ zero_motion zerom str Zx - - ----- No motion for subsequent character #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ @@ -912,7 +912,7 @@ alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulatio #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ diff --git a/include/Caps.hpux11 b/include/Caps.hpux11 index 723556fa18f4..9fedc4d053ec 100644 --- a/include/Caps.hpux11 +++ b/include/Caps.hpux11 @@ -1,5 +1,5 @@ ############################################################################## -# Copyright 2019-2023,2024 Thomas E. Dickey # +# Copyright 2019-2024,2025 Thomas E. Dickey # # Copyright 2002-2015,2016 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -29,7 +29,7 @@ # # Author: Thomas Dickey # -# $Id: Caps.hpux11,v 1.26 2024/04/20 21:05:02 tom Exp $ +# $Id: Caps.hpux11,v 1.28 2025/11/12 01:27:41 tom Exp $ # # This is an adaptation of ncurses' termcap/terminfo capability table, which # is designed to align with HPUX 11.x's terminfo. @@ -246,7 +246,7 @@ #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Boolean Capability Name TI TC Description #%_ @@ -295,7 +295,7 @@ lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Numeric Capability Name TI TC Description #%_ @@ -329,7 +329,7 @@ no_color_video ncv num NC - - ----- video attributes that cannot be used with #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Numeric Capability Name TI TC Description #%_ @@ -357,7 +357,7 @@ bit_image_type bitype num Yp - - ----- type of bit-image device #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ @@ -426,7 +426,7 @@ key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key @@ -492,7 +492,7 @@ reset_2string rs2 str r2 - - -B--- reset string #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. reset_3string rs3 str r3 - - -B--- reset string reset_file rf str rf - - -B--- name of reset file restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor @@ -561,7 +561,7 @@ key_f42 kf42 str FW KEY_F(42) - ----E F42 function key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_f43 kf43 str FX KEY_F(43) - ----E F43 function key key_f44 kf44 str FY KEY_F(44) - ----E F44 function key key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key @@ -625,7 +625,7 @@ key_undo kund str &8 KEY_UNDO 0630 ----- undo key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key @@ -706,7 +706,7 @@ enter_doublewide_mode swidm str ZF - - ----- Enter double-wide mode #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. enter_draft_quality sdrfq str ZG - - ----- Enter draft-quality mode enter_italics_mode sitm str ZH - - ----- Enter italic mode enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion @@ -762,7 +762,7 @@ zero_motion zerom str Zx - - ----- No motion for subsequent character #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ @@ -820,7 +820,7 @@ alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulatio #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ diff --git a/include/Caps.keys b/include/Caps.keys index 6f8a84e3455f..cf304f89c482 100644 --- a/include/Caps.keys +++ b/include/Caps.keys @@ -1,5 +1,5 @@ ############################################################################## -# Copyright 2019-2023,2024 Thomas E. Dickey # +# Copyright 2019-2024,2025 Thomas E. Dickey # # Copyright 2001-2015,2016 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -30,7 +30,7 @@ # Author: Thomas Dickey # and: Ilya Zakharevich # -# $Id: Caps.keys,v 1.25 2024/04/20 21:05:02 tom Exp $ +# $Id: Caps.keys,v 1.27 2025/11/12 01:27:41 tom Exp $ # # This is an adaptation of ncurses' termcap/terminfo capability table, which # is illustrates an experimental extension to describe alt-, shift- and @@ -249,7 +249,7 @@ #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Boolean Capability Name TI TC Description #%_ @@ -297,7 +297,7 @@ lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Numeric Capability Name TI TC Description #%_ @@ -330,7 +330,7 @@ no_color_video ncv num NC - - ----- video attributes that cannot be used with #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Numeric Capability Name TI TC Description #%_ @@ -358,7 +358,7 @@ bit_image_type bitype num Yp - - ----- type of bit-image device #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ @@ -427,7 +427,7 @@ key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key @@ -493,7 +493,7 @@ reset_2string rs2 str r2 - - -B--- reset string #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. reset_3string rs3 str r3 - - -B--- reset string reset_file rf str rf - - -B--- name of reset file restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor @@ -563,7 +563,7 @@ key_undo kund str &8 KEY_UNDO 0630 ----- undo key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key @@ -629,7 +629,7 @@ key_f42 kf42 str FW KEY_F(42) - ----E F42 function key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_f43 kf43 str FX KEY_F(43) - ----E F43 function key key_f44 kf44 str FY KEY_F(44) - ----E F44 function key key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key @@ -789,7 +789,7 @@ enter_doublewide_mode swidm str ZF - - ----- Enter double-wide mode #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. enter_draft_quality sdrfq str ZG - - ----- Enter draft-quality mode enter_italics_mode sitm str ZH - - ----- Enter italic mode enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion @@ -845,7 +845,7 @@ zero_motion zerom str Zx - - ----- No motion for subsequent character #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ @@ -901,7 +901,7 @@ alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulatio #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ diff --git a/include/Caps.osf1r5 b/include/Caps.osf1r5 index ece14aef2ea7..539f7a0b7b32 100644 --- a/include/Caps.osf1r5 +++ b/include/Caps.osf1r5 @@ -1,5 +1,5 @@ ############################################################################## -# Copyright 2019-2023,2024 Thomas E. Dickey # +# Copyright 2019-2024,2025 Thomas E. Dickey # # Copyright 2002-2015,2016 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -29,7 +29,7 @@ # # Author: Thomas Dickey # -# $Id: Caps.osf1r5,v 1.24 2024/04/20 21:05:02 tom Exp $ +# $Id: Caps.osf1r5,v 1.26 2025/11/12 01:27:41 tom Exp $ # # This is an adaptation of ncurses' termcap/terminfo capability table, which # is designed to align with OSF/1 version 5 (Tru64) terminfo. @@ -246,7 +246,7 @@ #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Boolean Capability Name TI TC Description #%_ @@ -294,7 +294,7 @@ semi_auto_right_margin sam bool YE - - ----- printing in last column causes cr #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%Numeric Capability Name TI TC Description #%_ @@ -338,7 +338,7 @@ wide_char_size widcs num Yn - - ----- character step size when in double wide #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ @@ -407,7 +407,7 @@ key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key @@ -473,7 +473,7 @@ reset_2string rs2 str r2 - - -B--- reset string #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. reset_3string rs3 str r3 - - -B--- reset string reset_file rf str rf - - -B--- name of reset file restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor @@ -632,7 +632,7 @@ enter_doublewide_mode swidm str ZF - - ----- Enter double-wide mode #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. enter_draft_quality sdrfq str ZG - - ----- Enter draft-quality mode enter_italics_mode sitm str ZH - - ----- Enter italic mode enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion @@ -682,7 +682,7 @@ key_f42 kf42 str FW KEY_F(42) - ----E F42 function key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_f43 kf43 str FX KEY_F(43) - ----E F43 function key key_f44 kf44 str FY KEY_F(44) - ----E F44 function key key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key @@ -724,7 +724,7 @@ key_save ksav str &6 KEY_SAVE 0571 ----- save key #%.TE #%.TS #%center; -#%Lbw(25n)2 Lbw(8n)2 Lb2 Lx. +#%Lbw(25n)2 Lbw(8n)2 Lb2 Lw(17n)x. key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key diff --git a/include/Caps.uwin b/include/Caps.uwin index a41e9eca7a30..bef3af766690 100644 --- a/include/Caps.uwin +++ b/include/Caps.uwin @@ -1,5 +1,5 @@ ############################################################################## -# Copyright 2019-2023,2024 Thomas E. Dickey # +# Copyright 2019-2024,2025 Thomas E. Dickey # # Copyright 2001-2015,2016 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -29,7 +29,7 @@ # # Author: Thomas Dickey # -# $Id: Caps.uwin,v 1.23 2024/04/20 21:05:02 tom Exp $ +# $Id: Caps.uwin,v 1.25 2025/11/12 01:06:36 Branden.Robinson Exp $ # # This is an adaptation of ncurses' termcap/terminfo capability table, which # is designed to align with U/Win's terminfo. @@ -246,7 +246,7 @@ #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(24n)2 Lbw(7n)2 Lb2 Lx. +#%Lbw(24n)2 Lbw(7n)2 Lb2 Lw(17n)x. #%\& Code \& #%Boolean Capability Name TI TC Description #%_ @@ -287,7 +287,7 @@ hue_lightness_saturation hls bool hl - - ----- terminal uses only HLS color nota #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(24n)2 Lbw(7n)2 Lb2 Lx. +#%Lbw(24n)2 Lbw(7n)2 Lb2 Lw(17n)x. #%\& Code \& #%Numeric Capability Name TI TC Description #%_ @@ -304,7 +304,7 @@ label_height lh num lh - - ----- rows in each label label_width lw num lw - - ----- columns in each label buttons btns num BT - - ----- number of buttons on mouse #max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle -#maximum_windows wnum num MW - - ----- maximum number of defineable windows +#maximum_windows wnum num MW - - ----- maximum number of definable windows # These came in with SVr4's color support max_colors colors num Co - - ----- maximum number of colors on screen max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen @@ -316,7 +316,7 @@ no_color_video ncv num NC - - ----- video attributes that cannot be used with #%center; #%Lb Cb S Lb #%Lb Lb Lb Lb -#%Lbw(24n)2 Lbw(7n)2 Lb2 Lx. +#%Lbw(24n)2 Lbw(7n)2 Lb2 Lw(17n)x. #%\& Code \& #%String Capability Name TI TC Description #%_ @@ -385,7 +385,7 @@ key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key #%.TE #%.TS #%center; -#%Lbw(24n)2 Lbw(7n)2 Lb2 Lx. +#%Lbw(24n)2 Lbw(7n)2 Lb2 Lw(17n)x. key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key @@ -451,7 +451,7 @@ reset_2string rs2 str r2 - - -B--- reset string #%.TE #%.TS #%center; -#%Lbw(24n)2 Lbw(7n)2 Lb2 Lx. +#%Lbw(24n)2 Lbw(7n)2 Lb2 Lw(17n)x. reset_3string rs3 str r3 - - -B--- reset string reset_file rf str rf - - -B--- name of reset file restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor @@ -521,7 +521,7 @@ key_undo kund str &8 KEY_UNDO 0630 ----- undo key #%.TE #%.TS #%center; -#%Lbw(24n)2 Lbw(7n)2 Lb2 Lx. +#%Lbw(24n)2 Lbw(7n)2 Lb2 Lw(17n)x. key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key @@ -587,7 +587,7 @@ key_f42 kf42 str FW KEY_F(42) - ----E F42 function key #%.TE #%.TS #%center; -#%Lbw(24n)2 Lbw(7n)2 Lb2 Lx. +#%Lbw(24n)2 Lbw(7n)2 Lb2 Lw(17n)x. key_f43 kf43 str FX KEY_F(43) - ----E F43 function key key_f44 kf44 str FY KEY_F(44) - ----E F44 function key key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key diff --git a/include/MKkey_defs.sh b/include/MKkey_defs.sh index e58ee2b65d79..309a59d525b6 100755 --- a/include/MKkey_defs.sh +++ b/include/MKkey_defs.sh @@ -1,7 +1,7 @@ #! /bin/sh -# $Id: MKkey_defs.sh,v 1.24 2024/01/19 12:26:17 tom Exp $ +# $Id: MKkey_defs.sh,v 1.25 2025/06/14 14:44:56 tom Exp $ ############################################################################## -# Copyright 2019-2022,2024 Thomas E. Dickey # +# Copyright 2019-2024,2025 Thomas E. Dickey # # Copyright 2001-2013,2017 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -110,8 +110,8 @@ function decode(keycode) { } BEGIN { - maxkey='$maxkey'; - pass='$pass'; + maxkey='"$maxkey"'; + pass='"$pass"'; key_max=1; bits=1; while (key_max < maxkey) { diff --git a/include/MKterm.h.awk.in b/include/MKterm.h.awk.in index a93d8e86e9c1..fc42dc094460 100644 --- a/include/MKterm.h.awk.in +++ b/include/MKterm.h.awk.in @@ -26,7 +26,7 @@ BEGIN { lcurl = "{"; rcurl = "}"; print "/****************************************************************************" - print " * Copyright 2018-2021,2023 Thomas E. Dickey *" + print " * Copyright 2018-2024,2025 Thomas E. Dickey *" print " * Copyright 1998-2013,2017 Free Software Foundation, Inc. *" print " * *" print " * Permission is hereby granted, free of charge, to any person obtaining a *" @@ -60,7 +60,7 @@ BEGIN { print "/* and: Thomas E. Dickey 1995-on */" print "/****************************************************************************/" print "" - print "/* $Id: MKterm.h.awk.in,v 1.85 2023/04/23 19:15:36 tom Exp $ */" + print "/* $Id: MKterm.h.awk.in,v 1.94 2025/12/26 23:33:14 tom Exp $ */" print "" print "/*" print "** term.h -- Definition of struct term" @@ -86,6 +86,7 @@ BEGIN { print "" print "typedef struct screen SCREEN;" print "" + print "/* configured with --enable-sp-funcs? */" print "#if @NCURSES_SP_FUNCS@" print "#undef NCURSES_SP_FUNCS" print "#define NCURSES_SP_FUNCS @NCURSES_PATCH@" @@ -115,65 +116,62 @@ BEGIN { print "#undef NCURSES_XNAMES" print "#define NCURSES_XNAMES @NCURSES_XNAMES@" print "" - print "/* We will use these symbols to hide differences between" + print "/* TTY, SET_TTY and GET_TTY are used internally */" + print "#ifdef NCURSES_INTERNALS" + print "" + print "/* We use these symbols to hide differences between" print " * termios/termio/sgttyb interfaces." print " */" print "#undef TTY" print "#undef SET_TTY" print "#undef GET_TTY" print "" - print "/* Assume POSIX termio if we have the header and function */" - print "/* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */" - print "#if @HAVE_TERMIOS_H@ && @HAVE_TCGETATTR@" + print "#if @HAVE_TERMIOS_H@ && @HAVE_TCGETATTR@ /* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */" print "" print "#undef TERMIOS" print "#define TERMIOS 1" - print "" print "#include <termios.h>" print "#define TTY struct termios" print "" - print "#else /* !HAVE_TERMIOS_H */" - print "" - print "/* #if HAVE_TERMIO_H */" - print "#if @HAVE_TERMIO_H@" + print "#elif @HAVE_TERMIO_H@ /* HAVE_TERMIO_H */" print "" print "#undef TERMIOS" print "#define TERMIOS 1" - print "" print "#include <termio.h>" print "#define TTY struct termio" print "" - print "#else /* !HAVE_TERMIO_H */" + print "#elif (defined(_WIN32) || defined(_WIN64) || defined(__MINGW32__) || defined(__MINGW64__))" + print "" + print "#include <nc_win32.h>" + print "#define TTY ConsoleMode" + print "" + print "#elif @HAVE_SGTTY_H@ /* HAVE_SGTTY_H */" print "" - print "#if (defined(_WIN32) || defined(_WIN64))" - print "#if @EXP_WIN32_DRIVER@" - print "#include <win32_curses.h>" - print "#define TTY struct winconmode" - print "#else" - print "#include <ncurses_mingw.h>" - print "#define TTY struct termios" - print "#endif" - print "#else" print "#undef TERMIOS" print "#include <sgtty.h>" print "#include <sys/ioctl.h>" print "#define TTY struct sgttyb" - print "#endif /* MINGW32 */" - print "#endif /* HAVE_TERMIO_H */" + print "" + print "#else" + print "" + print "#error no termio/termios/sgtty found" print "" print "#endif /* HAVE_TERMIOS_H */" print "" print "#ifdef TERMIOS" print "#define GET_TTY(fd, buf) tcgetattr(fd, buf)" print "#define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)" - print "#elif @EXP_WIN32_DRIVER@ && (defined(_WIN32) || defined(_WIN64))" + print "/* configured with --enable-exp-win32? */" + print "#elif defined(_WIN32) || defined(_WIN64)" print "#define GET_TTY(fd, buf) _nc_console_getmode(_nc_console_fd2handle(fd),buf)" print "#define SET_TTY(fd, buf) _nc_console_setmode(_nc_console_fd2handle(fd),buf)" - print "#else" + print "#elif @HAVE_SGTTY_H@ /* HAVE_SGTTY_H */" print "#define GET_TTY(fd, buf) gtty(fd, buf)" print "#define SET_TTY(fd, buf) stty(fd, buf)" print "#endif" print "" + print "#endif /* NCURSES_INTERNALS */" + print "" print "#ifndef GCC_NORETURN" print "#define GCC_NORETURN /* nothing */" print "#endif" @@ -255,6 +253,7 @@ END { print "TERMINAL;" print "" if (@NCURSES_EXT_COLORS@) { + print "/* configured with --enable-ext-colors */" declare_termtype("int","2"); } else { print "#undef TERMTYPE2" @@ -268,9 +267,10 @@ END { print "" print "#endif /* NCURSES_INTERNALS */" print "" - print "" + print "/* configured with --enable-broken_linker and reentrancy disabled */" print "#if @BROKEN_LINKER@ && !@cf_cv_enable_reentrant@" print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;" + print "/* reentrancy enabled */" print "#elif @cf_cv_enable_reentrant@" print "NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);" print "#define cur_term NCURSES_PUBLIC_VAR(cur_term())" @@ -278,6 +278,7 @@ END { print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;" print "#endif" print "" + print "/* configured with --enable-broken_linker or reentrancy enabled */" print "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@" print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);" print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);" @@ -348,6 +349,7 @@ END { print "extern NCURSES_EXPORT(int) tigetflag (const char *);" print "extern NCURSES_EXPORT(int) tigetnum (const char *);" print "" + print "/* configured without --disable-tparm-varargs? */" print "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */" print "extern NCURSES_EXPORT(char *) tparm (const char *, ...); /* special */" print "#else" @@ -380,6 +382,7 @@ END { print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tigetflag) (SCREEN*, const char *);" print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tigetnum) (SCREEN*, const char *);" print "" + print "/* configured without --disable-tparm-varargs? */" print "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */" print "extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm) (SCREEN*, const char *, ...); /* special */" print "#else" diff --git a/include/Makefile.in b/include/Makefile.in index 351383b0ebc9..fc45d0811245 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.53 2021/07/03 18:56:51 tom Exp $ +# $Id: Makefile.in,v 1.56 2025/10/18 13:33:46 tom Exp $ ############################################################################## -# Copyright 2019-2020,2021 Thomas E. Dickey # +# Copyright 2019-2024,2025 Thomas E. Dickey # # Copyright 1998-2013,2015 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -44,14 +44,14 @@ SHELL = @SHELL@ VPATH = @srcdir@ THIS = Makefile -DESTDIR = @DESTDIR@ +@SET_DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ includedir = @includedir@ includesubdir = @includesubdir@ -INCLUDEDIR = $(DESTDIR)$(includedir)$(includesubdir) +INCLUDEDIR = $(DESTDIR)$(includedir@MERGE_PREFIX@)$(includesubdir) INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -78,6 +78,7 @@ CAPLIST = $(TERMINFO_CAPS) \ CONFIG_SRC = \ MKterm.h.awk \ curses.head \ + nc_win32.h \ ncurses_dll.h \ termcap.h \ unctrl.h diff --git a/include/capdefaults.c b/include/capdefaults.c index 0bdda14dee2d..2405b89a3751 100644 --- a/include/capdefaults.c +++ b/include/capdefaults.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020,2021 Thomas E. Dickey * + * Copyright 2020-2021,2024 Thomas E. Dickey * * Copyright 1998-2000,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -33,7 +33,7 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: capdefaults.c,v 1.16 2021/09/04 10:52:55 tom Exp $ */ +/* $Id: capdefaults.c,v 1.17 2024/07/27 19:19:23 tom Exp $ */ /* * Compute obsolete capabilities. The reason this is an include file is @@ -45,7 +45,7 @@ * postprocess_termcap(). */ { - char *strp; + const char *strp; short capval; #define EXTRACT_DELAY(str) \ diff --git a/include/curses.h.in b/include/curses.h.in index 8cfa0b9ff8d6..0541e35a78e1 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2023,2024 Thomas E. Dickey * + * Copyright 2018-2024,2025 Thomas E. Dickey * * Copyright 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -33,7 +33,7 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: curses.h.in,v 1.282 2024/01/19 11:50:07 tom Exp $ */ +/* $Id: curses.h.in,v 1.299 2025/08/08 23:19:21 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -109,7 +109,7 @@ * User-definable tweak to disable the include of <stdbool.h>. */ #ifndef NCURSES_ENABLE_STDBOOL_H -#define NCURSES_ENABLE_STDBOOL_H @cf_cv_header_stdbool_h@ +#define NCURSES_ENABLE_STDBOOL_H @USE_STDBOOL_H@ #endif /* @@ -125,10 +125,10 @@ * doing so makes it incompatible with other implementations of X/Open Curses. */ #undef NCURSES_CONST -#define NCURSES_CONST @NCURSES_CONST@ +#define NCURSES_CONST @NCURSES_CONST@ /* for old compilers */ #undef NCURSES_INLINE -#define NCURSES_INLINE @NCURSES_INLINE@ +#define NCURSES_INLINE @NCURSES_INLINE@ /* for old compilers */ /* * The standard type used for color values, and for color-pairs. The latter @@ -175,14 +175,14 @@ * KEY_RESIZE is an extended feature that relies upon the SIGWINCH handler * in ncurses. */ -#if @NCURSES_EXT_FUNCS@ +#if @NCURSES_EXT_FUNCS@ /* NCURSES_EXT_FUNCS */ #ifndef NCURSES_SIGWINCH #define NCURSES_SIGWINCH @cf_cv_enable_sigwinch@ #endif #else #undef NCURSES_SIGWINCH #define NCURSES_SIGWINCH 0 -#endif +#endif /* NCURSES_EXT_FUNCS */ /* * In certain environments, we must work around linker problems for data @@ -232,12 +232,12 @@ #undef NCURSES_CH_T #define NCURSES_CH_T @NCURSES_CH_T@ -#if @cf_cv_enable_lp64@ && defined(_LP64) +#if @cf_cv_enable_lp64@ /* cf_cv_enable_lp64 */ && defined(_LP64) typedef unsigned chtype; typedef unsigned mmask_t; #else -typedef @cf_cv_typeof_chtype@ chtype; -typedef @cf_cv_typeof_mmask_t@ mmask_t; +typedef @cf_cv_typeof_chtype@ chtype; /* cf_cv_typeof_chtype */ +typedef @cf_cv_typeof_mmask_t@ mmask_t; /* cf_cv_typeof_mmask_t */ #endif /* @@ -296,7 +296,7 @@ typedef @cf_cv_type_of_bool@ NCURSES_BOOL; #include <stdbool.h> /* use whatever the C compiler decides bool really is */ #define NCURSES_BOOL bool -#else +#elif !defined(__cplusplus) && !@USE_BUILTIN_BOOL@ /* USE_BUILTIN_BOOL */ /* there is no predefined bool - use our own */ #undef bool #define bool NCURSES_BOOL @@ -311,7 +311,7 @@ extern "C" { #define NCURSES_CAST(type,value) (type)(value) #endif -#define NCURSES_OK_ADDR(p) (0 != NCURSES_CAST(const void *, (p))) +#define NCURSES_OK_ADDR(p) (NULL != NCURSES_CAST(const void *, (p))) /* * X/Open attributes. In the ncurses implementation, they are identical to the @@ -335,7 +335,7 @@ extern "C" { #define WA_TOP A_TOP #define WA_VERTICAL A_VERTICAL -#if @NCURSES_EXT_FUNCS@ +#if @NCURSES_EXT_FUNCS@ /* NCURSES_EXT_FUNCS */ #define WA_ITALIC A_ITALIC /* ncurses extension */ #endif @@ -351,7 +351,7 @@ extern "C" { /* line graphics */ -#if @BROKEN_LINKER@ || NCURSES_REENTRANT +#if @BROKEN_LINKER@ /* BROKEN_LINKER */ || NCURSES_REENTRANT NCURSES_WRAPPED_VAR(chtype*, acs_map); #define acs_map NCURSES_PUBLIC_VAR(acs_map()) #else @@ -459,22 +459,22 @@ typedef chtype attr_t; /* ...must be at least as wide as chtype */ #if NCURSES_WIDECHAR -#if @NCURSES_LIBUTF8@ +#if @NCURSES_LIBUTF8@ /* NCURSES_LIBUTF8 */ #ifdef mblen /* libutf8.h defines it w/o undefining first */ #undef mblen #endif #include <libutf8.h> #endif -#if @NEED_WCHAR_H@ +#if @NEED_WCHAR_H@ /* NEED_WCHAR_H */ #include <wchar.h> /* ...to get mbstate_t, etc. */ #endif -#if @NCURSES_WCHAR_T@ +#if @NCURSES_WCHAR_T@ /* NCURSES_WCHAR_T */ typedef unsigned short wchar_t@NCURSES_OK_WCHAR_T@; #endif -#if @NCURSES_WINT_T@ +#if @NCURSES_WINT_T@ /* NCURSES_WINT_T */ typedef unsigned int wint_t@NCURSES_OK_WCHAR_T@; #endif @@ -484,16 +484,19 @@ typedef unsigned int wint_t@NCURSES_OK_WCHAR_T@; * (spacing and nonspacing) do not fill the array, a null L'\0' follows. * Otherwise, a null is assumed to follow when extracting via getcchar(). */ -#define CCHARW_MAX @NCURSES_CCHARW_MAX@ +#define CCHARW_MAX @NCURSES_CCHARW_MAX@ /* NCURSES_CCHARW_MAX */ typedef struct { attr_t attr; wchar_t chars[CCHARW_MAX]; -#if @NCURSES_EXT_COLORS@ +#if @NCURSES_EXT_COLORS@ /* NCURSES_EXT_COLORS */ #undef NCURSES_EXT_COLORS -#define NCURSES_EXT_COLORS @NCURSES_PATCH@ +#define NCURSES_EXT_COLORS @NCURSES_PATCH@ /* NCURSES_PATCH */ int ext_color; /* color pair, must be more than 16-bits */ +#if @NCURSES_RGB_COLORS@ /* NCURSES_RGB_COLORS */ + int rgb_color; /* extra data for direct-color (rgb) */ #endif +#endif /* NCURSES_EXT_COLORS */ } cchar_t; @@ -549,9 +552,9 @@ struct _win_st NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */ -#if NCURSES_WIDECHAR +#if NCURSES_WIDECHAR /* NCURSES_WIDECHAR */ cchar_t _bkgrnd; /* current background char/attribute pair */ -#if @NCURSES_EXT_COLORS@ +#if @NCURSES_EXT_COLORS@ /* NCURSES_EXT_COLORS */ int _color; /* current color-pair for non-space character */ #endif #endif @@ -833,7 +836,7 @@ extern NCURSES_EXPORT(int) vline (chtype, int); /* generated */ extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *, va_list) GCC_DEPRECATED(use vw_printw) /* implemented */ GCC_PRINTFLIKE(2,0); extern NCURSES_EXPORT(int) vw_printw (WINDOW *, const char *, va_list) /* implemented */ - GCC_PRINTFLIKE(2,0); + GCC_PRINTFLIKE(2,0); extern NCURSES_EXPORT(int) vwscanw (WINDOW *, const char *, va_list) GCC_DEPRECATED(use vw_scanw) /* implemented */ GCC_SCANFLIKE(2,0); extern NCURSES_EXPORT(int) vw_scanw (WINDOW *, const char *, va_list) /* implemented */ @@ -936,9 +939,9 @@ extern NCURSES_EXPORT(int) getpary (const WINDOW *); /* generated */ /* * These functions are extensions - not in X/Open Curses. */ -#if @NCURSES_EXT_FUNCS@ +#if @NCURSES_EXT_FUNCS@ /* NCURSES_EXT_FUNCS */ #undef NCURSES_EXT_FUNCS -#define NCURSES_EXT_FUNCS @NCURSES_PATCH@ +#define NCURSES_EXT_FUNCS @NCURSES_PATCH@ /* NCURSES_PATCH */ typedef int (*NCURSES_WINDOW_CB)(WINDOW *, void *); typedef int (*NCURSES_SCREEN_CB)(SCREEN *, void *); extern NCURSES_EXPORT(int) alloc_pair (int, int); @@ -973,9 +976,9 @@ extern NCURSES_EXPORT(int) use_screen (SCREEN *, NCURSES_SCREEN_CB, void *); extern NCURSES_EXPORT(int) use_window (WINDOW *, NCURSES_WINDOW_CB, void *); extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int); -#if @NCURSES_XNAMES@ +#if @NCURSES_XNAMES@ /* NCURSES_XNAMES */ #undef NCURSES_XNAMES -#define NCURSES_XNAMES @NCURSES_XNAMES@ +#define NCURSES_XNAMES @NCURSES_XNAMES@ /* NCURSES_XNAMES */ extern NCURSES_EXPORT(int) use_extended_names (bool); #endif @@ -999,17 +1002,17 @@ extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *); /* @GENERATED_EXT_FUNCS extern NCURSES_EXPORT(int) wgetdelay (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* @GENERATED_EXT_FUNCS@ */ -#else +#else /* !NCURSES_EXT_FUNCS */ #define curses_version() NCURSES_VERSION -#endif +#endif /* NCURSES_EXT_FUNCS */ /* * Extra extension-functions, which pass a SCREEN pointer rather than using * a global variable SP. */ -#if @NCURSES_SP_FUNCS@ +#if @NCURSES_SP_FUNCS@ /* NCURSES_SP_FUNCS */ #undef NCURSES_SP_FUNCS -#define NCURSES_SP_FUNCS @NCURSES_PATCH@ +#define NCURSES_SP_FUNCS @NCURSES_PATCH@ /* NCURSES_PATCH */ #define NCURSES_SP_NAME(name) name##_sp /* Define the sp-funcs helper function */ @@ -1091,7 +1094,7 @@ extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_env) (SCREEN*, bool); /* impleme extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_tioctl) (SCREEN*, bool); /* implemented:SP_FUNC */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidattr) (SCREEN*, chtype); /* implemented:SP_FUNC */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidputs) (SCREEN*, chtype, NCURSES_SP_OUTC); /* implemented:SP_FUNC */ -#if @NCURSES_EXT_FUNCS@ +#if @NCURSES_EXT_FUNCS@ /* NCURSES_EXT_FUNCS */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(alloc_pair) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(assume_default_colors) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(define_key) (SCREEN*, const char *, int); /* implemented:EXT_SP_FUNC */ @@ -1119,13 +1122,13 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_escdelay) (SCREEN*, int); /* impl extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_tabsize) (SCREEN*, int); /* implemented:EXT_SP_FUNC */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_default_colors) (SCREEN*); /* implemented:EXT_SP_FUNC */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* implemented:EXT_SP_FUNC */ -#endif -#else +#endif /* NCURSES_EXT_FUNCS */ +#else /* !NCURSES_SP_FUNCS */ #undef NCURSES_SP_FUNCS #define NCURSES_SP_FUNCS 0 #define NCURSES_SP_NAME(name) name #define NCURSES_SP_OUTC NCURSES_OUTC -#endif +#endif /* NCURSES_SP_FUNCS */ /* attributes */ @@ -1143,8 +1146,12 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* #define A_DIM NCURSES_BITS(@cf_cv_1UL@,12) #define A_BOLD NCURSES_BITS(@cf_cv_1UL@,13) #define A_ALTCHARSET NCURSES_BITS(@cf_cv_1UL@,14) + +/* SVr4 curses marks these as "subject to change" */ #define A_INVIS NCURSES_BITS(@cf_cv_1UL@,15) #define A_PROTECT NCURSES_BITS(@cf_cv_1UL@,16) + +/* X/Open features not found in SVr4 curses */ #define A_HORIZONTAL NCURSES_BITS(@cf_cv_1UL@,17) #define A_LEFT NCURSES_BITS(@cf_cv_1UL@,18) #define A_LOW NCURSES_BITS(@cf_cv_1UL@,19) @@ -1152,9 +1159,14 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* #define A_TOP NCURSES_BITS(@cf_cv_1UL@,21) #define A_VERTICAL NCURSES_BITS(@cf_cv_1UL@,22) -#if @NCURSES_EXT_FUNCS@ +#if @NCURSES_EXT_FUNCS@ /* NCURSES_EXT_FUNCS */ #define A_ITALIC NCURSES_BITS(@cf_cv_1UL@,23) /* ncurses extension */ -#endif +#if @NCURSES_RGB_COLORS@ /* NCURSES_RGB_COLORS */ +#define A_FOREGROUND NCURSES_BITS(@cf_cv_1UL@,17) /* ncurses extension */ +#define A_BACKGROUND NCURSES_BITS(@cf_cv_1UL@,18) /* ncurses extension */ +#define A_DIRECT (A_FOREGROUND|A_BACKGROUND) +#endif /* NCURSES_RGB_COLORS */ +#endif /* NCURSES_EXT_FUNCS */ /* * Most of the pseudo functions are macros that either provide compatibility @@ -1228,7 +1240,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* #if !NCURSES_OPAQUE #if NCURSES_WATTR_MACROS -#if NCURSES_WIDECHAR && @NCURSES_EXT_COLORS@ +#if NCURSES_WIDECHAR && @NCURSES_EXT_COLORS@ /* NCURSES_EXT_COLORS */ #define wattrset(win,at) \ (NCURSES_OK_ADDR(win) \ ? ((win)->_color = NCURSES_CAST(int, PAIR_NUMBER(at)), \ @@ -1380,7 +1392,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* #if !NCURSES_OPAQUE #if NCURSES_WATTR_MACROS -#if NCURSES_WIDECHAR && @NCURSES_EXT_COLORS@ +#if NCURSES_WIDECHAR && @NCURSES_EXT_COLORS@ /* NCURSES_EXT_COLORS */ #define wattr_set(win,a,p,opts) \ (NCURSES_OK_ADDR(win) \ ? ((void)((win)->_attrs = ((a) & ~A_COLOR), \ @@ -1400,7 +1412,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* : OK), \ OK) \ : ERR) -#else /* !(NCURSES_WIDECHAR && NCURSES_EXE_COLORS) */ +#else /* !(NCURSES_WIDECHAR && NCURSES_EXT_COLORS) */ #define wattr_set(win,a,p,opts) \ (NCURSES_OK_ADDR(win) \ ? ((void)((win)->_attrs = (((a) & ~A_COLOR) | \ @@ -1417,7 +1429,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* : OK), \ OK) \ : ERR) -#endif /* (NCURSES_WIDECHAR && NCURSES_EXE_COLORS) */ +#endif /* (NCURSES_WIDECHAR && NCURSES_EXT_COLORS) */ #endif /* NCURSES_WATTR_MACROS */ #endif /* NCURSES_OPAQUE */ @@ -1433,15 +1445,15 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* /* * Export fallback function for use in C++ binding. */ -#if !@HAVE_VSSCANF@ +#if !@HAVE_VSSCANF@ /* HAVE_VSSCANF */ #define vsscanf(a,b,c) _nc_vsscanf(a,b,c) -NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); +extern NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); #endif /* * These macros are extensions - not in X/Open Curses. */ -#if @NCURSES_EXT_FUNCS@ +#if @NCURSES_EXT_FUNCS@ /* NCURSES_EXT_FUNCS */ #if !NCURSES_OPAQUE #define is_cleared(win) (NCURSES_OK_ADDR(win) ? (win)->_clear : FALSE) #define is_idcok(win) (NCURSES_OK_ADDR(win) ? (win)->_idcok : FALSE) @@ -1459,7 +1471,7 @@ NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); #define wgetparent(win) (NCURSES_OK_ADDR(win) ? (win)->_parent : 0) #define wgetscrreg(win,t,b) (NCURSES_OK_ADDR(win) ? (*(t) = (win)->_regtop, *(b) = (win)->_regbottom, OK) : ERR) #endif -#endif +#endif /* NCURSES_EXT_FUNCS */ /* * X/Open says this returns a bool; SVr4 also checked for out-of-range line. diff --git a/include/curses.tail b/include/curses.tail index 9c9135656048..c1347a9dc051 100644 --- a/include/curses.tail +++ b/include/curses.tail @@ -1,4 +1,4 @@ -/* $Id: curses.tail,v 1.27 2023/08/05 19:43:46 tom Exp $ */ +/* $Id: curses.tail,v 1.29 2025/07/26 15:32:01 tom Exp $ */ /* * vile:cmode: * This file is part of ncurses, designed to be appended after curses.h.in @@ -8,9 +8,9 @@ /* mouse interface */ #if NCURSES_MOUSE_VERSION > 1 -#define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 5)) +#define NCURSES_MOUSE_MASK(b,m) ((mmask_t)(m) << (((b) - 1) * 5)) #else -#define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 6)) +#define NCURSES_MOUSE_MASK(b,m) ((mmask_t)(m) << (((b) - 1) * 6)) #endif #define NCURSES_BUTTON_RELEASED 001UL @@ -62,7 +62,51 @@ #define BUTTON_ALT NCURSES_MOUSE_MASK(6, 0004L) #define REPORT_MOUSE_POSITION NCURSES_MOUSE_MASK(6, 0010L) -#else +/* + * If mmask_T is 64-bits, we can define another 6 button stanzas, for a total + * of 11, which happens to be the maximum number supported in the X11 protocol. + */ +#if NCURSES_MOUSE_VERSION > 2 + +#define BUTTON6_RELEASED NCURSES_MOUSE_MASK(6, NCURSES_BUTTON_RELEASED) +#define BUTTON6_PRESSED NCURSES_MOUSE_MASK(6, NCURSES_BUTTON_PRESSED) +#define BUTTON6_CLICKED NCURSES_MOUSE_MASK(6, NCURSES_BUTTON_CLICKED) +#define BUTTON6_DOUBLE_CLICKED NCURSES_MOUSE_MASK(6, NCURSES_DOUBLE_CLICKED) +#define BUTTON6_TRIPLE_CLICKED NCURSES_MOUSE_MASK(6, NCURSES_TRIPLE_CLICKED) + +#define BUTTON7_RELEASED NCURSES_MOUSE_MASK(7, NCURSES_BUTTON_RELEASED) +#define BUTTON7_PRESSED NCURSES_MOUSE_MASK(7, NCURSES_BUTTON_PRESSED) +#define BUTTON7_CLICKED NCURSES_MOUSE_MASK(7, NCURSES_BUTTON_CLICKED) +#define BUTTON7_DOUBLE_CLICKED NCURSES_MOUSE_MASK(7, NCURSES_DOUBLE_CLICKED) +#define BUTTON7_TRIPLE_CLICKED NCURSES_MOUSE_MASK(7, NCURSES_TRIPLE_CLICKED) + +#define BUTTON8_RELEASED NCURSES_MOUSE_MASK(8, NCURSES_BUTTON_RELEASED) +#define BUTTON8_PRESSED NCURSES_MOUSE_MASK(8, NCURSES_BUTTON_PRESSED) +#define BUTTON8_CLICKED NCURSES_MOUSE_MASK(8, NCURSES_BUTTON_CLICKED) +#define BUTTON8_DOUBLE_CLICKED NCURSES_MOUSE_MASK(8, NCURSES_DOUBLE_CLICKED) +#define BUTTON8_TRIPLE_CLICKED NCURSES_MOUSE_MASK(8, NCURSES_TRIPLE_CLICKED) + +#define BUTTON9_RELEASED NCURSES_MOUSE_MASK(9, NCURSES_BUTTON_RELEASED) +#define BUTTON9_PRESSED NCURSES_MOUSE_MASK(9, NCURSES_BUTTON_PRESSED) +#define BUTTON9_CLICKED NCURSES_MOUSE_MASK(9, NCURSES_BUTTON_CLICKED) +#define BUTTON9_DOUBLE_CLICKED NCURSES_MOUSE_MASK(9, NCURSES_DOUBLE_CLICKED) +#define BUTTON9_TRIPLE_CLICKED NCURSES_MOUSE_MASK(9, NCURSES_TRIPLE_CLICKED) + +#define BUTTON10_RELEASED NCURSES_MOUSE_MASK(10, NCURSES_BUTTON_RELEASED) +#define BUTTON10_PRESSED NCURSES_MOUSE_MASK(10, NCURSES_BUTTON_PRESSED) +#define BUTTON10_CLICKED NCURSES_MOUSE_MASK(10, NCURSES_BUTTON_CLICKED) +#define BUTTON10_DOUBLE_CLICKED NCURSES_MOUSE_MASK(10, NCURSES_DOUBLE_CLICKED) +#define BUTTON10_TRIPLE_CLICKED NCURSES_MOUSE_MASK(10, NCURSES_TRIPLE_CLICKED) + +#define BUTTON11_RELEASED NCURSES_MOUSE_MASK(11, NCURSES_BUTTON_RELEASED) +#define BUTTON11_PRESSED NCURSES_MOUSE_MASK(11, NCURSES_BUTTON_PRESSED) +#define BUTTON11_CLICKED NCURSES_MOUSE_MASK(11, NCURSES_BUTTON_CLICKED) +#define BUTTON11_DOUBLE_CLICKED NCURSES_MOUSE_MASK(11, NCURSES_DOUBLE_CLICKED) +#define BUTTON11_TRIPLE_CLICKED NCURSES_MOUSE_MASK(11, NCURSES_TRIPLE_CLICKED) + +#endif + +#else /* NCURSES_MOUSE_VERSION == 1 */ #define BUTTON1_RESERVED_EVENT NCURSES_MOUSE_MASK(1, NCURSES_RESERVED_EVENT) #define BUTTON2_RESERVED_EVENT NCURSES_MOUSE_MASK(2, NCURSES_RESERVED_EVENT) @@ -74,7 +118,7 @@ #define BUTTON_ALT NCURSES_MOUSE_MASK(5, 0004L) #define REPORT_MOUSE_POSITION NCURSES_MOUSE_MASK(5, 0010L) -#endif +#endif /* NCURSES_MOUSE_VERSION >= 1 */ #define ALL_MOUSE_EVENTS (REPORT_MOUSE_POSITION - 1) diff --git a/include/curses.wide b/include/curses.wide index 33adb070d7b1..1e0f197ec6fd 100644 --- a/include/curses.wide +++ b/include/curses.wide @@ -1,4 +1,4 @@ -/* $Id: curses.wide,v 1.51 2021/05/22 20:28:29 tom Exp $ */ +/* $Id: curses.wide,v 1.53 2025/01/18 21:08:32 Branden.Robinson Exp $ */ /* * vile:cmode: * This file is part of ncurses, designed to be appended after curses.h.in @@ -213,7 +213,7 @@ extern NCURSES_EXPORT(int) winnwstr (WINDOW *, wchar_t *, int); /* implemented extern NCURSES_EXPORT(int) wins_nwstr (WINDOW *, const wchar_t *, int); /* implemented */ extern NCURSES_EXPORT(int) wins_wch (WINDOW *, const cchar_t *); /* implemented */ extern NCURSES_EXPORT(int) wins_wstr (WINDOW *, const wchar_t *); /* generated:WIDEC */ -extern NCURSES_EXPORT(int) winwstr (WINDOW *, wchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) winwstr (WINDOW *, wchar_t *); /* generated:WIDEC */ extern NCURSES_EXPORT(wchar_t*) wunctrl (cchar_t *); /* implemented */ extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int); /* implemented */ @@ -240,7 +240,7 @@ extern NCURSES_EXPORT(wchar_t*) NCURSES_SP_NAME(wunctrl) (SCREEN*, cchar_t *); / #define bkgrnd(c) wbkgrnd(stdscr,(c)) #define bkgrndset(c) wbkgrndset(stdscr,(c)) #define border_set(l,r,t,b,tl,tr,bl,br) wborder_set(stdscr,(l),(r),(t),(b),tl,tr,bl,br) -#define box_set(w,v,h) wborder_set((w),(v),(v),(h),(h),0,0,0,0) +#define box_set(w,v,h) wborder_set((w),(v),(v),(h),(h),NULL,NULL,NULL,NULL) #define echo_wchar(c) wecho_wchar(stdscr,(c)) #define get_wch(c) wget_wch(stdscr,(c)) #define get_wstr(t) wget_wstr(stdscr,(t)) @@ -261,6 +261,7 @@ extern NCURSES_EXPORT(wchar_t*) NCURSES_SP_NAME(wunctrl) (SCREEN*, cchar_t *); / #define wget_wstr(w,t) wgetn_wstr((w),(t),-1) #define win_wchstr(w,c) win_wchnstr((w),(c),-1) #define wins_wstr(w,t) wins_nwstr((w),(t),-1) +#define winwstr(w,c) winnwstr((w),(c),-1) #if !NCURSES_OPAQUE #define wgetbkgrnd(win,wch) (NCURSES_OK_ADDR(wch) ? ((win) ? (*(wch) = (win)->_bkgrnd) : *(wch), OK) : ERR) diff --git a/include/headers b/include/headers index e1293b28a549..8a871ee3de36 100644 --- a/include/headers +++ b/include/headers @@ -1,6 +1,6 @@ -# $Id: headers,v 1.16 2023/04/22 12:09:09 tom Exp $ +# $Id: headers,v 1.22 2025/12/26 23:33:03 tom Exp $ ############################################################################## -# Copyright 2020,2023 Thomas E. Dickey # +# Copyright 2020-2023,2025 Thomas E. Dickey # # Copyright 1998-2012,2013 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -45,9 +45,8 @@ $(srcdir)/term_entry.h # Porting @ port_win32con -$(srcdir)/ncurses_mingw.h -$(srcdir)/nc_mingw.h +nc_win32.h @ port_win32 -$(srcdir)/win32_curses.h +nc_win32.h # vile:makemode diff --git a/include/nc_alloc.h b/include/nc_alloc.h index cfea2beb6daf..1fd54095e19c 100644 --- a/include/nc_alloc.h +++ b/include/nc_alloc.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019-2020,2021 Thomas E. Dickey * + * Copyright 2019-2021,2025 Thomas E. Dickey * * Copyright 1998-2013,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -30,7 +30,7 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: nc_alloc.h,v 1.30 2021/11/20 23:33:38 tom Exp $ */ +/* $Id: nc_alloc.h,v 1.36 2025/03/01 15:02:06 tom Exp $ */ #ifndef NC_ALLOC_included #define NC_ALLOC_included 1 @@ -118,6 +118,27 @@ extern NCURSES_EXPORT(void) _nc_leaks_tinfo(void); #define typeCalloc(type,elts) (type *)calloc((size_t)(elts),sizeof(type)) #define typeRealloc(type,elts,ptr) (type *)_nc_doalloc(ptr, (size_t)(elts)*sizeof(type)) +/* provide for using VLAs if supported, otherwise assume alloca() */ + +#ifndef __STDC_VERSION__ +#define __STDC_VERSION__ 0 +#endif + +#ifndef __STDC_NO_VLA__ +#define __STDC_NO_VLA__ 1 +#endif + +#if __STDC_VERSION__ >= 19901L && (__STDC_VERSION__ < 201000L || !__STDC_NO_VLA__) +#define MakeArray(name,type,count) type name[count] +#else +#if HAVE_ALLOCA_H +#include <alloca.h> +#elif HAVE_MALLOC_H +#include <malloc.h> +#endif +#define MakeArray(name,type,count) type *name = (type*) alloca(sizeof(type) * (size_t) (count)) +#endif + #ifdef __cplusplus } #endif diff --git a/include/nc_mingw.h b/include/nc_mingw.h deleted file mode 100644 index 1bfc4b0d37c1..000000000000 --- a/include/nc_mingw.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** - * Copyright 2018-2020,2023 Thomas E. Dickey * - * Copyright 2008-2010,2017 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Thomas Dickey, 2008-on * - ****************************************************************************/ - -/* $Id: nc_mingw.h,v 1.10 2023/02/25 19:59:24 tom Exp $ */ - -#ifndef NC_MINGW_H -#define NC_MINGW_H 1 - -#ifdef _WIN32 - -#ifdef WINVER -# if WINVER < 0x0501 -# error WINVER must at least be 0x0501 -# endif -#else -# define WINVER 0x0501 -#endif -#include <windows.h> - -#undef sleep -#define sleep(n) Sleep((n) * 1000) - -#if HAVE_SYS_TIME_H -#include <sys/time.h> /* for struct timeval */ -#endif - -#ifdef _MSC_VER -#include <winsock2.h> /* for struct timeval */ -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#include <ncurses_dll.h> - -#if !HAVE_CLOCK_GETTIME && !HAVE_GETTIMEOFDAY -NCURSES_EXPORT(int) _nc_gettimeofday(struct timeval *, void *); -#undef HAVE_GETTIMEOFDAY -#define HAVE_GETTIMEOFDAY 2 -#define gettimeofday(tv,tz) _nc_gettimeofday(tv,tz) -#endif - -#define SIGHUP 1 -#define SIGKILL 9 -#define getlogin() "username" - -#undef wcwidth -#define wcwidth(ucs) _nc_wcwidth((wchar_t)(ucs)) -NCURSES_EXPORT(int) _nc_wcwidth(wchar_t); - -#ifdef __cplusplus -} -#endif - -#endif /* _WIN32 */ - -#endif /* NC_MINGW_H */ diff --git a/include/nc_termios.h b/include/nc_termios.h index 13cc0af7ab53..69bda0f26f65 100644 --- a/include/nc_termios.h +++ b/include/nc_termios.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018,2020 Thomas E. Dickey * + * Copyright 2018-2020,2025 Thomas E. Dickey * * Copyright 2011-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -31,7 +31,7 @@ * Author: Thomas E. Dickey 2011 * ****************************************************************************/ -/* $Id: nc_termios.h,v 1.8 2020/08/29 20:53:19 tom Exp $ */ +/* $Id: nc_termios.h,v 1.10 2025/10/18 17:53:13 tom Exp $ */ #ifndef NC_TERMIOS_included #define NC_TERMIOS_included 1 @@ -70,97 +70,14 @@ #define tcflush(fd, arg) ioctl(fd, TCFLSH, arg) #endif -#if defined(EXP_WIN32_DRIVER) +#if defined(_WIN32) #undef TERMIOS #endif #else /* !HAVE_TERMIO_H */ -#if defined(_WIN32) && !defined(EXP_WIN32_DRIVER) - -/* lflag bits */ -#define ISIG 0x0001 -#define ICANON 0x0002 -#define ECHO 0x0004 -#define ECHOE 0x0008 -#define ECHOK 0x0010 -#define ECHONL 0x0020 -#define NOFLSH 0x0040 -#define IEXTEN 0x0100 - -#define VEOF 4 -#define VERASE 5 -#define VINTR 6 -#define VKILL 7 -#define VMIN 9 -#define VQUIT 10 -#define VTIME 16 - -/* iflag bits */ -#define IGNBRK 0x00001 -#define BRKINT 0x00002 -#define IGNPAR 0x00004 -#define INPCK 0x00010 -#define ISTRIP 0x00020 -#define INLCR 0x00040 -#define IGNCR 0x00080 -#define ICRNL 0x00100 -#define IXON 0x00400 -#define IXOFF 0x01000 -#define PARMRK 0x10000 - -/* oflag bits */ -#define OPOST 0x00001 - -/* cflag bits */ -#define CBAUD 0x0100f -#define B0 0x00000 -#define B50 0x00001 -#define B75 0x00002 -#define B110 0x00003 -#define B134 0x00004 -#define B150 0x00005 -#define B200 0x00006 -#define B300 0x00007 -#define B600 0x00008 -#define B1200 0x00009 -#define B1800 0x0000a -#define B2400 0x0000b -#define B4800 0x0000c -#define B9600 0x0000d - -#define CSIZE 0x00030 -#define CS8 0x00030 -#define CSTOPB 0x00040 -#define CREAD 0x00080 -#define PARENB 0x00100 -#define PARODD 0x00200 -#define HUPCL 0x00400 -#define CLOCAL 0x00800 - -#define TCIFLUSH 0 -#define TCSADRAIN 3 - -#ifndef cfgetospeed -#define cfgetospeed(t) ((t)->c_cflag & CBAUD) -#endif - -#ifndef tcsetattr -#define tcsetattr(fd, opt, arg) _nc_mingw_tcsetattr(fd, opt, arg) -#endif - -#ifndef tcgetattr -#define tcgetattr(fd, arg) _nc_mingw_tcgetattr(fd, arg) -#endif - -#ifndef tcflush -#define tcflush(fd, queue) _nc_mingw_tcflush(fd, queue) -#endif - -#undef ttyname -#define ttyname(fd) NULL +#undef TERMIOS -#endif /* _WIN32 */ #endif /* HAVE_TERMIO_H */ #endif /* HAVE_TERMIOS_H */ diff --git a/include/nc_tparm.h b/include/nc_tparm.h index 78170993fa17..12fb422ecb9d 100644 --- a/include/nc_tparm.h +++ b/include/nc_tparm.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2020,2023 Thomas E. Dickey * + * Copyright 2018-2023,2025 Thomas E. Dickey * * Copyright 2006-2012,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -31,7 +31,7 @@ * Author: Thomas E. Dickey 2006 * ****************************************************************************/ -/* $Id: nc_tparm.h,v 1.12 2023/04/16 17:57:28 tom Exp $ */ +/* $Id: nc_tparm.h,v 1.13 2025/01/04 23:42:30 tom Exp $ */ #ifndef NC_TPARM_included #define NC_TPARM_included 1 @@ -88,6 +88,7 @@ #define TIPARM_7(s,a,b,c,d,e,f,g) _nc_tiparm(7,s,a,b,c,d,e,f,g) #define TIPARM_8(s,a,b,c,d,e,f,g,h) _nc_tiparm(8,s,a,b,c,d,e,f,g,h) #define TIPARM_9(s,a,b,c,d,e,f,g,h,i) _nc_tiparm(9,s,a,b,c,d,e,f,g,h,i) +#define TIPARM_N(N,s,a,b,c,d,e,f,g,h,i) _nc_tiparm(N,s,a,b,c,d,e,f,g,h,i) #endif #endif /* NC_TPARM_included */ diff --git a/include/nc_win32.h b/include/nc_win32.h.in index e67b8e045506..271e40aa33ee 100644 --- a/include/nc_win32.h +++ b/include/nc_win32.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2020,2023 Thomas E. Dickey * + * Copyright 2018-2024,2025 Thomas E. Dickey * * Copyright 2008-2010,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -31,23 +31,27 @@ * Author: Thomas Dickey, 2008-on * ****************************************************************************/ -/* $Id: nc_win32.h,v 1.10 2023/02/25 20:09:23 tom Exp $ */ +/* $Id: nc_win32.h.in,v 1.19 2025/12/26 23:32:43 tom Exp $ */ #ifndef NC_WIN32_H #define NC_WIN32_H 1 -#if defined(_WIN32) || defined(_WIN64) +#include <ncurses_cfg.h> -#ifndef _NC_WINDOWS -#define _NC_WINDOWS +#if defined(_WIN32) || defined(_WIN64) || defined(USE_WIN32CON_DRIVER) + +#if @USE_NAMED_PIPES@ /* USE_NAMED_PIPES */ + +#ifndef _NC_WINDOWS_NATIVE +#define _NC_WINDOWS_NATIVE #endif #ifdef TERMIOS #error TERMIOS must not be defined on Windows #endif -/* We no longer support WindowsXP. - Minimum requirement is Windows Vista or Server2008, +/* + Minimum requirement for named pipes is Windows Vista or Server2008, aka Windows NT 6.0 */ #ifdef WINVER @@ -65,59 +69,46 @@ #include <windows.h> +#else /* !USE_NAMED_PIPES */ + +#ifdef WINVER +# if WINVER < 0x0501 +# error WINVER must at least be 0x0501 +# endif +#else +# define WINVER 0x0501 +#endif + +#include <windows.h> + +#undef sleep +#define sleep(n) Sleep((n) * 1000) + +#endif /* USE_NAMED_PIPES */ + #if HAVE_SYS_TIME_H #include <sys/time.h> /* for struct timeval */ #endif -#ifdef _NC_MSC +#ifdef _MSC_VER #include <winsock2.h> /* for struct timeval */ #endif -#ifdef __cplusplus -extern "C" { -#endif - -#include <ncurses_dll.h> - -#if !HAVE_CLOCK_GETTIME && !HAVE_GETTIMEOFDAY -#undef HAVE_GETTIMEOFDAY -#define HAVE_GETTIMEOFDAY 2 -extern NCURSES_EXPORT(int) _nc_gettimeofday(struct timeval *, void *); -#endif +#include <stdint.h> /* for uint32_t */ -#undef wcwidth -#define wcwidth(ucs) _nc_wcwidth((wchar_t)(ucs)) -extern NCURSES_EXPORT(int) _nc_wcwidth(wchar_t); - -#ifdef EVENTLIST_2nd /* test.priv.h just needs the preceding */ - -extern NCURSES_EXPORT(void) _nc_console_size(int* Lines, int* Cols); -extern NCURSES_EXPORT(HANDLE) _nc_console_handle(int fd); -extern NCURSES_EXPORT(int) _nc_console_isatty(int fd); -extern NCURSES_EXPORT(int) _nc_console_test(int fd); -extern NCURSES_EXPORT(int) _nc_console_read(SCREEN *sp,HANDLE hdl,int *buf); -extern NCURSES_EXPORT(int) _nc_console_twait(SCREEN *, HANDLE,int,int,int * EVENTLIST_2nd(_nc_eventlist * evl)); -extern NCURSES_EXPORT(WORD) _nc_console_MapColor(bool fore, int color); -extern NCURSES_EXPORT(void) _nc_console_selectActiveHandle(void); -extern NCURSES_EXPORT(bool) _nc_console_get_SBI(void); -extern NCURSES_EXPORT(void) _nc_console_set_scrollback(bool normal, CONSOLE_SCREEN_BUFFER_INFO * info); -extern NCURSES_EXPORT(int) _nc_console_testmouse(SCREEN *,HANDLE,int EVENTLIST_2nd(_nc_eventlist*)); -extern NCURSES_EXPORT(int) _nc_console_keyok(int keycode,int flag); -extern NCURSES_EXPORT(bool) _nc_console_keyExist(int keycode); -extern NCURSES_EXPORT(bool) _nc_console_checkinit(bool initFlag, bool assumeTermInfo); -extern NCURSES_EXPORT(int) _nc_console_vt_supported(void); - -#ifdef _NC_CHECK_MINTTY -extern NCURSES_EXPORT(int) _nc_console_checkmintty(int fd, LPHANDLE pMinTTY); +/* + * Allow for build-override, e.g., MinGW used "cygwin". + */ +#ifndef DEFAULT_TERM_ENV +#define DEFAULT_TERM_ENV "ms-terminal" #endif #undef VALID_TERM_ENV -#define MS_TERMINAL "ms-terminal" #define VALID_TERM_ENV(term_env, no_terminal) \ (term_env = (NonEmpty(term_env) \ ? term_env \ : (_nc_console_vt_supported() \ - ? MS_TERMINAL \ + ? DEFAULT_TERM_ENV \ : no_terminal)), \ NonEmpty(term_env)) @@ -137,11 +128,35 @@ extern NCURSES_EXPORT(int) _nc_console_checkmintty(int fd, LPHANDLE pMinTTY); #define CONMODE_NORAW (ENABLE_PROCESSED_INPUT|ENABLE_LINE_INPUT) #define CONMODE_NOCBREAK (ENABLE_LINE_INPUT) +#include <ncurses_dll.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(CURSES_PRIV_H) || defined(TEST_PRIV_H) -#if defined(USE_TERM_DRIVER) && defined(USE_WIN32CON_DRIVER) -extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_WIN_DRIVER; +#if !HAVE_CLOCK_GETTIME && !HAVE_GETTIMEOFDAY +extern NCURSES_EXPORT(int) _nc_gettimeofday(struct timeval *, void *); +#undef HAVE_GETTIMEOFDAY +#define HAVE_GETTIMEOFDAY 2 +#define gettimeofday(tv,tz) _nc_gettimeofday(tv,tz) #endif +#endif /* defined(CURSES_PRIV_H) || defined(TEST_PRIV_H) */ + +#if !HAVE_WCWIDTH +#undef wcwidth +#define wcwidth(ucs) _nc_wcwidth((wchar_t)(ucs)) +extern NCURSES_EXPORT(int) _nc_wcwidth(uint32_t); +#endif + +typedef struct +{ + DWORD dwFlagIn; + DWORD dwFlagOut; +} ConsoleMode; + #define CON_NUMPAIRS 64 typedef struct { BOOL initialized; @@ -166,20 +181,32 @@ typedef struct { CONSOLE_SCREEN_BUFFER_INFO SBI; CONSOLE_SCREEN_BUFFER_INFO save_SBI; CONSOLE_CURSOR_INFO save_CI; - TTY originalMode; + ConsoleMode originalMode; } ConsoleInfo; extern NCURSES_EXPORT_VAR(ConsoleInfo) _nc_CONSOLE; #define WINCONSOLE _nc_CONSOLE -#define TypeAlloca(type,count)(type*) _alloca(sizeof(type)*(size_t)(count)) - -#endif /* EVENTLIST_2nd */ - #ifdef __cplusplus } #endif +#ifdef CURSES_PRIV_H /* test.priv.h just needs the preceding */ +#include <term.h> +#endif + +#if USE_DOS_PATHS +NCURSES_EXPORT(const char *) _nc_to_dospath(const char *, char *); +#define FixupPathname(path) \ + char fixed_pathname[PATH_MAX]; \ + path = _nc_to_dospath(path, fixed_pathname) +#define FixupPathname2(path,buffer) \ + path = _nc_to_dospath(path, buffer) +#endif + +#undef ttyname +#define ttyname(fd) NULL + #endif /* _WIN32 || _WIN64 */ #endif /* NC_WIN32_H */ diff --git a/include/ncurses_cfg.hin b/include/ncurses_cfg.hin index 8d9ed81a8406..0744fa0c6710 100644 --- a/include/ncurses_cfg.hin +++ b/include/ncurses_cfg.hin @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2024 Thomas E. Dickey * * Copyright 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -31,7 +31,7 @@ * Author: Thomas E. Dickey 1997-on * ****************************************************************************/ /* - * $Id: ncurses_cfg.hin,v 1.13 2020/03/08 12:37:59 tom Exp $ + * $Id: ncurses_cfg.hin,v 1.15 2024/06/08 14:04:14 tom Exp $ * * Both ncurses_cfg.h and ncurses_def.h are internal header-files used when * building ncurses. @@ -44,7 +44,7 @@ * * See: * https://invisible-island.net/autoconf/ - * ftp://ftp.invisible-island.net/autoconf/ + * https://invisible-island.net/archives/autoconf/ */ #ifndef NC_CONFIG_H #define NC_CONFIG_H diff --git a/include/ncurses_defs b/include/ncurses_defs index c0da3ad53ecc..8058fb25bd09 100644 --- a/include/ncurses_defs +++ b/include/ncurses_defs @@ -1,6 +1,6 @@ -# $Id: ncurses_defs,v 1.110 2024/03/02 20:38:23 tom Exp $ +# $Id: ncurses_defs,v 1.123 2025/12/27 12:45:14 tom Exp $ ############################################################################## -# Copyright 2018-2023,2024 Thomas E. Dickey # +# Copyright 2018-2024,2025 Thomas E. Dickey # # Copyright 2000-2016,2017 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -42,6 +42,7 @@ DECL_ERRNO ETIP_NEEDS_MATH_H GCC_NORETURN /* nothing */ GCC_UNUSED /* nothing */ +HAVE_ALLOCA_H HAVE_ALLOC_PAIR HAVE_ASSUME_DEFAULT_COLORS HAVE_BIG_CORE @@ -50,6 +51,7 @@ HAVE_BSD_SIGNAL_H HAVE_BSD_STRING_H HAVE_BTOWC HAVE_BUILTIN_H +HAVE_CC_T HAVE_CHGAT 1 HAVE_CLOCK_GETTIME HAVE_COLOR_CONTENT 1 @@ -111,6 +113,7 @@ HAVE_LINK HAVE_LOCALECONV HAVE_LOCALE_H HAVE_LONG_FILE_NAMES +HAVE_MALLOC_H HAVE_MATH_FUNCS HAVE_MATH_H HAVE_MBLEN @@ -158,11 +161,13 @@ HAVE_SETUPTERM 1 HAVE_SETVBUF HAVE_SGTTY_H HAVE_SIGACTION +HAVE_SIGSET_T HAVE_SIGVEC HAVE_SIZECHANGE HAVE_SLK_COLOR HAVE_SLK_INIT 1 HAVE_SNPRINTF +HAVE_SPEED_T HAVE_STDINT_H HAVE_STRDUP HAVE_STRLCAT @@ -170,8 +175,9 @@ HAVE_STRLCPY HAVE_STRSTR HAVE_SYMLINK HAVE_SYSCONF -HAVE_SYS_BSDTYPES_H HAVE_SYS_AUXV_H +HAVE_SYS_BSDTYPES_H +HAVE_SYS_FSUID_H HAVE_SYS_IOCTL_H HAVE_SYS_PARAM_H HAVE_SYS_POLL_H @@ -180,6 +186,7 @@ HAVE_SYS_TERMIO_H HAVE_SYS_TIMES_H HAVE_SYS_TIME_H HAVE_SYS_TIME_SELECT +HAVE_TCFLAG_T HAVE_TCGETATTR HAVE_TCGETPGRP HAVE_TELL @@ -193,10 +200,10 @@ HAVE_TERM_H 1 HAVE_TGETENT 1 HAVE_TIGETNUM 1 HAVE_TIGETSTR 1 +HAVE_TIMES HAVE_TIPARM 1 HAVE_TIPARM_S 1 HAVE_TISCAN_S 1 -HAVE_TIMES HAVE_TPUTS_SP HAVE_TSEARCH HAVE_TYPEAHEAD 1 @@ -224,6 +231,7 @@ HAVE_WCSTOMBS HAVE_WCTOB HAVE_WCTOMB HAVE_WCTYPE_H +HAVE_WCWIDTH HAVE_WINSDELLN 1 HAVE_WINSSTR 1 HAVE_WMEMCHR @@ -231,8 +239,8 @@ HAVE_WORKING_POLL HAVE_WRESIZE HAVE_WSYNCDOWN 1 HAVE__DOSCAN -HAVE__TRACEF HAVE__NC_TPARM_ANALYZE 1 +HAVE__TRACEF MIXEDCASE_FILENAMES NCURSES_CHAR_EQ NCURSES_EXPANDED @@ -242,6 +250,7 @@ NCURSES_EXT_PUTWIN NCURSES_NO_PADDING NCURSES_OSPEED_COMPAT NCURSES_PATHSEP ':' +NCURSES_RGB_COLORS NCURSES_WIDECHAR NEED_PTEM_H NO_LEAKS @@ -255,6 +264,7 @@ TERMPATH "none" TIME_WITH_SYS_TIME TYPEOF_CHTYPE USE_COLORFGBG +USE_DOS_PATHS USE_FOPEN_BIN_R USE_GETCAP USE_GETCAP_CACHE @@ -264,6 +274,7 @@ USE_HASHMAP USE_HOME_TERMINFO USE_LINKS USE_MY_MEMMOVE +USE_NAMED_PIPES USE_OK_BCOPY USE_PTHREADS_EINTR USE_RCS_IDS @@ -271,9 +282,11 @@ USE_REENTRANT USE_SAFE_SPRINTF USE_SCROLL_HINTS USE_SIGWINCH +USE_STDBOOL_H USE_STRING_HACKS USE_SYMLINKS USE_SYSMOUSE +USE_TERM_DRIVER USE_WEAK_SYMBOLS USE_WIDEC_SUPPORT USE_XMC_SUPPORT diff --git a/include/ncurses_mingw.h b/include/ncurses_mingw.h deleted file mode 100644 index 8b11272de64d..000000000000 --- a/include/ncurses_mingw.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - * Copyright 2018-2020,2021 Thomas E. Dickey * - * Copyright 2008-2014,2017 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Juergen Pfeifer, 2008-on * - ****************************************************************************/ - -/* $Id: ncurses_mingw.h,v 1.7 2021/06/17 21:26:02 tom Exp $ */ - -/* - * This is a placeholder up to now and describes what needs to be implemented - * to support I/O to external terminals with ncurses on the Windows OS. - */ - -#ifdef _WIN32 -#ifndef _NC_MINGWH -#define _NC_MINGWH - -#define USE_CONSOLE_DRIVER 1 - -#undef TERMIOS -#define TERMIOS 1 - -typedef unsigned char cc_t; -typedef unsigned int tcflag_t; -typedef unsigned int speed_t; -typedef unsigned short otcflag_t; -typedef unsigned char ospeed_t; - -#define NCCS 18 -struct termios -{ - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; -}; - -extern NCURSES_EXPORT(int) _nc_mingw_tcsetattr( - int fd, - int optional_actions, - const struct termios* arg); -extern NCURSES_EXPORT(int) _nc_mingw_tcgetattr( - int fd, - struct termios* arg); -extern NCURSES_EXPORT(int) _nc_mingw_tcflush( - int fd, - int queue); -extern NCURSES_EXPORT(void) _nc_set_term_driver(void* term); - -#endif /* _NC_MINGWH */ -#endif /* _WIN32 */ diff --git a/include/term_entry.h b/include/term_entry.h index 24389ad3837e..8d5a65405866 100644 --- a/include/term_entry.h +++ b/include/term_entry.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2022,2023 Thomas E. Dickey * + * Copyright 2018-2023,2025 Thomas E. Dickey * * Copyright 1998-2015,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -33,7 +33,7 @@ * and: Thomas E. Dickey 1998-on * ****************************************************************************/ -/* $Id: term_entry.h,v 1.64 2023/04/22 13:37:14 tom Exp $ */ +/* $Id: term_entry.h,v 1.65 2025/01/11 20:37:28 tom Exp $ */ /* * term_entry.h -- interface to entry-manipulation code @@ -108,7 +108,8 @@ typedef enum { dbdLAST } DBDIRS; -#define MAX_USES 32 +#define WARN_MAX_USES 32 +#define HARD_MAX_USES 40 #define MAX_CROSSLINKS 16 typedef struct entry ENTRY; @@ -122,7 +123,7 @@ typedef struct { struct entry { TERMTYPE2 tterm; unsigned nuses; - ENTRY_USES uses[MAX_USES]; + ENTRY_USES uses[HARD_MAX_USES]; int ncrosslinks; ENTRY *crosslinks[MAX_CROSSLINKS]; long cstart; diff --git a/include/tic.h b/include/tic.h index 7569aae9fb5f..27db7d723315 100644 --- a/include/tic.h +++ b/include/tic.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2022,2023 Thomas E. Dickey * + * Copyright 2018-2023,2025 Thomas E. Dickey * * Copyright 1998-2012,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $Id: tic.h,v 1.87 2023/04/22 13:37:21 tom Exp $ + * $Id: tic.h,v 1.91 2025/12/25 21:23:29 tom Exp $ * tic.h - Global variables and structures for the terminfo compiler. */ @@ -47,6 +47,7 @@ extern "C" { #include <ncurses_cfg.h> +#include <sys/stat.h> #include <curses.h> /* for the _tracef() prototype, ERR/OK, bool defs */ /* @@ -270,6 +271,7 @@ extern NCURSES_EXPORT(unsigned) _nc_pathlast (const char *); extern NCURSES_EXPORT(bool) _nc_is_abs_path (const char *); extern NCURSES_EXPORT(bool) _nc_is_dir_path (const char *); extern NCURSES_EXPORT(bool) _nc_is_file_path (const char *); +extern NCURSES_EXPORT(bool) _nc_is_path_found (const char *, struct stat *); extern NCURSES_EXPORT(char *) _nc_basename (char *); extern NCURSES_EXPORT(char *) _nc_rootname (char *); @@ -313,8 +315,8 @@ extern NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings; extern NCURSES_EXPORT_VAR(struct token) _nc_curr_token; /* comp_userdefs.c */ -NCURSES_EXPORT(const struct user_table_entry *) _nc_get_userdefs_table (void); -NCURSES_EXPORT(const HashData *) _nc_get_hash_user (void); +extern NCURSES_EXPORT(const struct user_table_entry *) _nc_get_userdefs_table (void); +extern NCURSES_EXPORT(const HashData *) _nc_get_hash_user (void); /* captoinfo.c: capability conversion */ extern NCURSES_EXPORT(char *) _nc_captoinfo (const char *, const char *, int const); diff --git a/include/unctrl.h.in b/include/unctrl.h.in index f76f44343e73..65c73335c3e5 100644 --- a/include/unctrl.h.in +++ b/include/unctrl.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2025 Thomas E. Dickey * * Copyright 1998-2001,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -40,7 +40,7 @@ * as ^?. Printable characters are displayed as is. */ -/* $Id: unctrl.h.in,v 1.12 2020/02/02 23:34:34 tom Exp $ */ +/* $Id: unctrl.h.in,v 1.14 2025/08/08 23:19:21 tom Exp $ */ #ifndef NCURSES_UNCTRL_H_incl #define NCURSES_UNCTRL_H_incl 1 @@ -55,10 +55,10 @@ extern "C" { #include <curses.h> #undef unctrl -NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype); +extern NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype); -#if @NCURSES_SP_FUNCS@ -NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype); +#if @NCURSES_SP_FUNCS@ /* NCURSES_SP_FUNCS */ +extern NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype); #endif #ifdef __cplusplus diff --git a/include/win32_curses.h b/include/win32_curses.h deleted file mode 100644 index 0c807a022b15..000000000000 --- a/include/win32_curses.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * Copyright 2018-2020,2021 Thomas E. Dickey * - * Copyright 2008-2014,2017 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Juergen Pfeifer, 2008-on * - ****************************************************************************/ - -/* $Id: win32_curses.h,v 1.3 2021/06/17 21:26:02 tom Exp $ */ - -/* - * This is the interface we use on Windows to mimic the control of the settings - * of what acts like the classic TTY - the Windows Console. - */ - -#if (defined(_WIN32) || defined(_WIN64)) -#ifndef _NC_WIN32_CURSES_H -#define _NC_WIN32_CURSES_H 1 - -struct winconmode -{ - unsigned long dwFlagIn; - unsigned long dwFlagOut; -}; - -extern NCURSES_EXPORT(void*) _nc_console_fd2handle(int fd); -extern NCURSES_EXPORT(int) _nc_console_setmode(void* handle, const struct winconmode* arg); -extern NCURSES_EXPORT(int) _nc_console_getmode(void* handle, struct winconmode* arg); -extern NCURSES_EXPORT(int) _nc_console_flush(void* handle); - -/* - A few definitions of Unix functions we need to emulate -*/ -#define SIGHUP 1 -#define SIGKILL 9 - -#undef getlogin -#define getlogin() getenv("USERNAME") - -#undef ttyname -#define ttyname(fd) NULL - -#undef sleep -#define sleep(n) Sleep((n) * 1000) - -#undef gettimeofday -#define gettimeofday(tv,tz) _nc_gettimeofday(tv,tz) - -#endif /* _NC_WIN32_CURSES_H */ -#endif /* _WIN32||_WIN64 */ |
