AdaCurses-20170708/0000755000175100001440000000000013130303161012344 5ustar tomusersAdaCurses-20170708/gen/0000755000175100001440000000000013130303161013115 5ustar tomusersAdaCurses-20170708/gen/terminal_interface-curses.ads.m40000644000175100001440000022373612340207715021311 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses__ads.htm')dnl include(M4MACRO)------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.47 $ -- $Date: 2014/05/24 21:31:57 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System.Storage_Elements; with Interfaces.C; -- We need this for some assertions. with Terminal_Interface.Curses_Constants; package Terminal_Interface.Curses is pragma Preelaborate (Terminal_Interface.Curses); pragma Linker_Options ("-lncurses" & Curses_Constants.DFT_ARG_SUFFIX); Major_Version : constant := Curses_Constants.NCURSES_VERSION_MAJOR; Minor_Version : constant := Curses_Constants.NCURSES_VERSION_MINOR; NC_Version : String renames Curses_Constants.Version; type Window is private; Null_Window : constant Window; type Line_Position is new Integer; -- line coordinate type Column_Position is new Integer; -- column coordinate subtype Line_Count is Line_Position range 1 .. Line_Position'Last; -- Type to count lines. We do not allow null windows, so must be positive subtype Column_Count is Column_Position range 1 .. Column_Position'Last; -- Type to count columns. We do not allow null windows, so must be positive type Key_Code is new Integer; -- That is anything including real characters, special keys and logical -- request codes. -- FIXME: The "-1" should be Curses_Err subtype Real_Key_Code is Key_Code range -1 .. Curses_Constants.KEY_MAX; -- This are the codes that potentially represent a real keystroke. -- Not all codes may be possible on a specific terminal. To check the -- availability of a special key, the Has_Key function is provided. subtype Special_Key_Code is Real_Key_Code range Curses_Constants. KEY_MIN - 1 .. Real_Key_Code'Last; -- Type for a function- or special key number subtype Normal_Key_Code is Real_Key_Code range Character'Pos (Character'First) .. Character'Pos (Character'Last); -- This are the codes for regular (incl. non-graphical) characters. -- For those who like to use the original key names we produce them were -- they differ from the original. -- Constants for function- and special keys Key_None : constant Special_Key_Code := Curses_Constants.KEY_MIN - 1; Key_Min : constant Special_Key_Code := Curses_Constants.KEY_MIN; Key_Break : constant Special_Key_Code := Curses_Constants.KEY_BREAK; KEY_DOWN : constant Special_Key_Code := Curses_Constants.KEY_DOWN; Key_Cursor_Down : Special_Key_Code renames KEY_DOWN; KEY_UP : constant Special_Key_Code := Curses_Constants.KEY_UP; Key_Cursor_Up : Special_Key_Code renames KEY_UP; KEY_LEFT : constant Special_Key_Code := Curses_Constants.KEY_LEFT; Key_Cursor_Left : Special_Key_Code renames KEY_LEFT; KEY_RIGHT : constant Special_Key_Code := Curses_Constants.KEY_RIGHT; Key_Cursor_Right : Special_Key_Code renames KEY_RIGHT; Key_Home : constant Special_Key_Code := Curses_Constants.KEY_HOME; Key_Backspace : constant Special_Key_Code := Curses_Constants.KEY_BACKSPACE; Key_F0 : constant Special_Key_Code := Curses_Constants.KEY_F0; Key_F1 : constant Special_Key_Code := Curses_Constants.KEY_F1; Key_F2 : constant Special_Key_Code := Curses_Constants.KEY_F2; Key_F3 : constant Special_Key_Code := Curses_Constants.KEY_F3; Key_F4 : constant Special_Key_Code := Curses_Constants.KEY_F4; Key_F5 : constant Special_Key_Code := Curses_Constants.KEY_F5; Key_F6 : constant Special_Key_Code := Curses_Constants.KEY_F6; Key_F7 : constant Special_Key_Code := Curses_Constants.KEY_F7; Key_F8 : constant Special_Key_Code := Curses_Constants.KEY_F8; Key_F9 : constant Special_Key_Code := Curses_Constants.KEY_F9; Key_F10 : constant Special_Key_Code := Curses_Constants.KEY_F10; Key_F11 : constant Special_Key_Code := Curses_Constants.KEY_F11; Key_F12 : constant Special_Key_Code := Curses_Constants.KEY_F12; Key_F13 : constant Special_Key_Code := Curses_Constants.KEY_F13; Key_F14 : constant Special_Key_Code := Curses_Constants.KEY_F14; Key_F15 : constant Special_Key_Code := Curses_Constants.KEY_F15; Key_F16 : constant Special_Key_Code := Curses_Constants.KEY_F16; Key_F17 : constant Special_Key_Code := Curses_Constants.KEY_F17; Key_F18 : constant Special_Key_Code := Curses_Constants.KEY_F18; Key_F19 : constant Special_Key_Code := Curses_Constants.KEY_F19; Key_F20 : constant Special_Key_Code := Curses_Constants.KEY_F20; Key_F21 : constant Special_Key_Code := Curses_Constants.KEY_F21; Key_F22 : constant Special_Key_Code := Curses_Constants.KEY_F22; Key_F23 : constant Special_Key_Code := Curses_Constants.KEY_F23; Key_F24 : constant Special_Key_Code := Curses_Constants.KEY_F24; KEY_DL : constant Special_Key_Code := Curses_Constants.KEY_DL; Key_Delete_Line : Special_Key_Code renames KEY_DL; KEY_IL : constant Special_Key_Code := Curses_Constants.KEY_IL; Key_Insert_Line : Special_Key_Code renames KEY_IL; KEY_DC : constant Special_Key_Code := Curses_Constants.KEY_DC; Key_Delete_Char : Special_Key_Code renames KEY_DC; KEY_IC : constant Special_Key_Code := Curses_Constants.KEY_IC; Key_Insert_Char : Special_Key_Code renames KEY_IC; KEY_EIC : constant Special_Key_Code := Curses_Constants.KEY_EIC; Key_Exit_Insert_Mode : Special_Key_Code renames KEY_EIC; KEY_CLEAR : constant Special_Key_Code := Curses_Constants.KEY_CLEAR; Key_Clear_Screen : Special_Key_Code renames KEY_CLEAR; KEY_EOS : constant Special_Key_Code := Curses_Constants.KEY_EOS; Key_Clear_End_Of_Screen : Special_Key_Code renames KEY_EOS; KEY_EOL : constant Special_Key_Code := Curses_Constants.KEY_EOL; Key_Clear_End_Of_Line : Special_Key_Code renames KEY_EOL; KEY_SF : constant Special_Key_Code := Curses_Constants.KEY_SF; Key_Scroll_1_Forward : Special_Key_Code renames KEY_SF; KEY_SR : constant Special_Key_Code := Curses_Constants.KEY_SR; Key_Scroll_1_Backward : Special_Key_Code renames KEY_SR; KEY_NPAGE : constant Special_Key_Code := Curses_Constants.KEY_NPAGE; Key_Next_Page : Special_Key_Code renames KEY_NPAGE; KEY_PPAGE : constant Special_Key_Code := Curses_Constants.KEY_PPAGE; Key_Previous_Page : Special_Key_Code renames KEY_PPAGE; KEY_STAB : constant Special_Key_Code := Curses_Constants.KEY_STAB; Key_Set_Tab : Special_Key_Code renames KEY_STAB; KEY_CTAB : constant Special_Key_Code := Curses_Constants.KEY_CTAB; Key_Clear_Tab : Special_Key_Code renames KEY_CTAB; KEY_CATAB : constant Special_Key_Code := Curses_Constants.KEY_CATAB; Key_Clear_All_Tabs : Special_Key_Code renames KEY_CATAB; KEY_ENTER : constant Special_Key_Code := Curses_Constants.KEY_ENTER; Key_Enter_Or_Send : Special_Key_Code renames KEY_ENTER; KEY_SRESET : constant Special_Key_Code := Curses_Constants.KEY_SRESET; Key_Soft_Reset : Special_Key_Code renames KEY_SRESET; Key_Reset : constant Special_Key_Code := Curses_Constants.KEY_RESET; Key_Print : constant Special_Key_Code := Curses_Constants.KEY_PRINT; KEY_LL : constant Special_Key_Code := Curses_Constants.KEY_LL; Key_Bottom : Special_Key_Code renames KEY_LL; KEY_A1 : constant Special_Key_Code := Curses_Constants.KEY_A1; Key_Upper_Left_Of_Keypad : Special_Key_Code renames KEY_A1; KEY_A3 : constant Special_Key_Code := Curses_Constants.KEY_A3; Key_Upper_Right_Of_Keypad : Special_Key_Code renames KEY_A3; KEY_B2 : constant Special_Key_Code := Curses_Constants.KEY_B2; Key_Center_Of_Keypad : Special_Key_Code renames KEY_B2; KEY_C1 : constant Special_Key_Code := Curses_Constants.KEY_C1; Key_Lower_Left_Of_Keypad : Special_Key_Code renames KEY_C1; KEY_C3 : constant Special_Key_Code := Curses_Constants.KEY_C3; Key_Lower_Right_Of_Keypad : Special_Key_Code renames KEY_C3; KEY_BTAB : constant Special_Key_Code := Curses_Constants.KEY_BTAB; Key_Back_Tab : Special_Key_Code renames KEY_BTAB; KEY_BEG : constant Special_Key_Code := Curses_Constants.KEY_BEG; Key_Beginning : Special_Key_Code renames KEY_BEG; Key_Cancel : constant Special_Key_Code := Curses_Constants.KEY_CANCEL; Key_Close : constant Special_Key_Code := Curses_Constants.KEY_CLOSE; Key_Command : constant Special_Key_Code := Curses_Constants.KEY_COMMAND; Key_Copy : constant Special_Key_Code := Curses_Constants.KEY_COPY; Key_Create : constant Special_Key_Code := Curses_Constants.KEY_CREATE; Key_End : constant Special_Key_Code := Curses_Constants.KEY_END; Key_Exit : constant Special_Key_Code := Curses_Constants.KEY_EXIT; Key_Find : constant Special_Key_Code := Curses_Constants.KEY_FIND; Key_Help : constant Special_Key_Code := Curses_Constants.KEY_HELP; Key_Mark : constant Special_Key_Code := Curses_Constants.KEY_MARK; Key_Message : constant Special_Key_Code := Curses_Constants.KEY_MESSAGE; Key_Move : constant Special_Key_Code := Curses_Constants.KEY_MOVE; Key_Next : constant Special_Key_Code := Curses_Constants.KEY_NEXT; Key_Open : constant Special_Key_Code := Curses_Constants.KEY_OPEN; Key_Options : constant Special_Key_Code := Curses_Constants.KEY_OPTIONS; Key_Previous : constant Special_Key_Code := Curses_Constants.KEY_PREVIOUS; Key_Redo : constant Special_Key_Code := Curses_Constants.KEY_REDO; Key_Reference : constant Special_Key_Code := Curses_Constants.KEY_REFERENCE; Key_Refresh : constant Special_Key_Code := Curses_Constants.KEY_REFRESH; Key_Replace : constant Special_Key_Code := Curses_Constants.KEY_REPLACE; Key_Restart : constant Special_Key_Code := Curses_Constants.KEY_RESTART; Key_Resume : constant Special_Key_Code := Curses_Constants.KEY_RESUME; Key_Save : constant Special_Key_Code := Curses_Constants.KEY_SAVE; KEY_SBEG : constant Special_Key_Code := Curses_Constants.KEY_SBEG; Key_Shift_Begin : Special_Key_Code renames KEY_SBEG; KEY_SCANCEL : constant Special_Key_Code := Curses_Constants.KEY_SCANCEL; Key_Shift_Cancel : Special_Key_Code renames KEY_SCANCEL; KEY_SCOMMAND : constant Special_Key_Code := Curses_Constants.KEY_SCOMMAND; Key_Shift_Command : Special_Key_Code renames KEY_SCOMMAND; KEY_SCOPY : constant Special_Key_Code := Curses_Constants.KEY_SCOPY; Key_Shift_Copy : Special_Key_Code renames KEY_SCOPY; KEY_SCREATE : constant Special_Key_Code := Curses_Constants.KEY_SCREATE; Key_Shift_Create : Special_Key_Code renames KEY_SCREATE; KEY_SDC : constant Special_Key_Code := Curses_Constants.KEY_SDC; Key_Shift_Delete_Char : Special_Key_Code renames KEY_SDC; KEY_SDL : constant Special_Key_Code := Curses_Constants.KEY_SDL; Key_Shift_Delete_Line : Special_Key_Code renames KEY_SDL; Key_Select : constant Special_Key_Code := Curses_Constants.KEY_SELECT; KEY_SEND : constant Special_Key_Code := Curses_Constants.KEY_SEND; Key_Shift_End : Special_Key_Code renames KEY_SEND; KEY_SEOL : constant Special_Key_Code := Curses_Constants.KEY_SEOL; Key_Shift_Clear_End_Of_Line : Special_Key_Code renames KEY_SEOL; KEY_SEXIT : constant Special_Key_Code := Curses_Constants.KEY_SEXIT; Key_Shift_Exit : Special_Key_Code renames KEY_SEXIT; KEY_SFIND : constant Special_Key_Code := Curses_Constants.KEY_SFIND; Key_Shift_Find : Special_Key_Code renames KEY_SFIND; KEY_SHELP : constant Special_Key_Code := Curses_Constants.KEY_SHELP; Key_Shift_Help : Special_Key_Code renames KEY_SHELP; KEY_SHOME : constant Special_Key_Code := Curses_Constants.KEY_SHOME; Key_Shift_Home : Special_Key_Code renames KEY_SHOME; KEY_SIC : constant Special_Key_Code := Curses_Constants.KEY_SIC; Key_Shift_Insert_Char : Special_Key_Code renames KEY_SIC; KEY_SLEFT : constant Special_Key_Code := Curses_Constants.KEY_SLEFT; Key_Shift_Cursor_Left : Special_Key_Code renames KEY_SLEFT; KEY_SMESSAGE : constant Special_Key_Code := Curses_Constants.KEY_SMESSAGE; Key_Shift_Message : Special_Key_Code renames KEY_SMESSAGE; KEY_SMOVE : constant Special_Key_Code := Curses_Constants.KEY_SMOVE; Key_Shift_Move : Special_Key_Code renames KEY_SMOVE; KEY_SNEXT : constant Special_Key_Code := Curses_Constants.KEY_SNEXT; Key_Shift_Next_Page : Special_Key_Code renames KEY_SNEXT; KEY_SOPTIONS : constant Special_Key_Code := Curses_Constants.KEY_SOPTIONS; Key_Shift_Options : Special_Key_Code renames KEY_SOPTIONS; KEY_SPREVIOUS : constant Special_Key_Code := Curses_Constants.KEY_SPREVIOUS; Key_Shift_Previous_Page : Special_Key_Code renames KEY_SPREVIOUS; KEY_SPRINT : constant Special_Key_Code := Curses_Constants.KEY_SPRINT; Key_Shift_Print : Special_Key_Code renames KEY_SPRINT; KEY_SREDO : constant Special_Key_Code := Curses_Constants.KEY_SREDO; Key_Shift_Redo : Special_Key_Code renames KEY_SREDO; KEY_SREPLACE : constant Special_Key_Code := Curses_Constants.KEY_SREPLACE; Key_Shift_Replace : Special_Key_Code renames KEY_SREPLACE; KEY_SRIGHT : constant Special_Key_Code := Curses_Constants.KEY_SRIGHT; Key_Shift_Cursor_Right : Special_Key_Code renames KEY_SRIGHT; KEY_SRSUME : constant Special_Key_Code := Curses_Constants.KEY_SRSUME; Key_Shift_Resume : Special_Key_Code renames KEY_SRSUME; KEY_SSAVE : constant Special_Key_Code := Curses_Constants.KEY_SSAVE; Key_Shift_Save : Special_Key_Code renames KEY_SSAVE; KEY_SSUSPEND : constant Special_Key_Code := Curses_Constants.KEY_SSUSPEND; Key_Shift_Suspend : Special_Key_Code renames KEY_SSUSPEND; KEY_SUNDO : constant Special_Key_Code := Curses_Constants.KEY_SUNDO; Key_Shift_Undo : Special_Key_Code renames KEY_SUNDO; Key_Suspend : constant Special_Key_Code := Curses_Constants.KEY_SUSPEND; Key_Undo : constant Special_Key_Code := Curses_Constants.KEY_UNDO; Key_Mouse : constant Special_Key_Code := Curses_Constants.KEY_MOUSE; Key_Resize : constant Special_Key_Code := Curses_Constants.KEY_RESIZE; Key_Max : constant Special_Key_Code := Special_Key_Code'Last; subtype User_Key_Code is Key_Code range (Key_Max + 129) .. Key_Code'Last; -- This is reserved for user defined key codes. The range between Key_Max -- and the first user code is reserved for subsystems like menu and forms. -------------------------------------------------------------------------- type Color_Number is range -1 .. Integer (Interfaces.C.short'Last); for Color_Number'Size use Interfaces.C.short'Size; -- (n)curses uses a short for the color index -- The model is, that a Color_Number is an index into an array of -- (potentially) definable colors. Some of those indices are -- predefined (see below), although they may not really exist. Black : constant Color_Number := Curses_Constants.COLOR_BLACK; Red : constant Color_Number := Curses_Constants.COLOR_RED; Green : constant Color_Number := Curses_Constants.COLOR_GREEN; Yellow : constant Color_Number := Curses_Constants.COLOR_YELLOW; Blue : constant Color_Number := Curses_Constants.COLOR_BLUE; Magenta : constant Color_Number := Curses_Constants.COLOR_MAGENTA; Cyan : constant Color_Number := Curses_Constants.COLOR_CYAN; White : constant Color_Number := Curses_Constants.COLOR_WHITE; type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last); for RGB_Value'Size use Interfaces.C.short'Size; -- Some system may allow to redefine a color by setting RGB values. type Color_Pair is range 0 .. 255; for Color_Pair'Size use 8; subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255; -- (n)curses reserves 1 Byte for the color-pair number. Color Pair 0 -- is fixed (Black & White). A color pair is simply a combination of -- two colors described by Color_Numbers, one for the foreground and -- the other for the background type Character_Attribute_Set is record Stand_Out : Boolean; Under_Line : Boolean; Reverse_Video : Boolean; Blink : Boolean; Dim_Character : Boolean; Bold_Character : Boolean; Protected_Character : Boolean; Invisible_Character : Boolean; Alternate_Character_Set : Boolean; Horizontal : Boolean; Left : Boolean; Low : Boolean; Right : Boolean; Top : Boolean; Vertical : Boolean; end record; for Character_Attribute_Set use record Stand_Out at 0 range Curses_Constants.A_STANDOUT_First - Curses_Constants.Attr_First .. Curses_Constants.A_STANDOUT_Last - Curses_Constants.Attr_First; Under_Line at 0 range Curses_Constants.A_UNDERLINE_First - Curses_Constants.Attr_First .. Curses_Constants.A_UNDERLINE_Last - Curses_Constants.Attr_First; Reverse_Video at 0 range Curses_Constants.A_REVERSE_First - Curses_Constants.Attr_First .. Curses_Constants.A_REVERSE_Last - Curses_Constants.Attr_First; Blink at 0 range Curses_Constants.A_BLINK_First - Curses_Constants.Attr_First .. Curses_Constants.A_BLINK_Last - Curses_Constants.Attr_First; Dim_Character at 0 range Curses_Constants.A_DIM_First - Curses_Constants.Attr_First .. Curses_Constants.A_DIM_Last - Curses_Constants.Attr_First; Bold_Character at 0 range Curses_Constants.A_BOLD_First - Curses_Constants.Attr_First .. Curses_Constants.A_BOLD_Last - Curses_Constants.Attr_First; Protected_Character at 0 range Curses_Constants.A_PROTECT_First - Curses_Constants.Attr_First .. Curses_Constants.A_PROTECT_Last - Curses_Constants.Attr_First; Invisible_Character at 0 range Curses_Constants.A_INVIS_First - Curses_Constants.Attr_First .. Curses_Constants.A_INVIS_Last - Curses_Constants.Attr_First; Alternate_Character_Set at 0 range Curses_Constants.A_ALTCHARSET_First - Curses_Constants.Attr_First .. Curses_Constants.A_ALTCHARSET_Last - Curses_Constants.Attr_First; Horizontal at 0 range Curses_Constants.A_HORIZONTAL_First - Curses_Constants.Attr_First .. Curses_Constants.A_HORIZONTAL_Last - Curses_Constants.Attr_First; Left at 0 range Curses_Constants.A_LEFT_First - Curses_Constants.Attr_First .. Curses_Constants.A_LEFT_Last - Curses_Constants.Attr_First; Low at 0 range Curses_Constants.A_LOW_First - Curses_Constants.Attr_First .. Curses_Constants.A_LOW_Last - Curses_Constants.Attr_First; Right at 0 range Curses_Constants.A_RIGHT_First - Curses_Constants.Attr_First .. Curses_Constants.A_RIGHT_Last - Curses_Constants.Attr_First; Top at 0 range Curses_Constants.A_TOP_First - Curses_Constants.Attr_First .. Curses_Constants.A_TOP_Last - Curses_Constants.Attr_First; Vertical at 0 range Curses_Constants.A_VERTICAL_First - Curses_Constants.Attr_First .. Curses_Constants.A_VERTICAL_Last - Curses_Constants.Attr_First; end record; Normal_Video : constant Character_Attribute_Set := (others => False); type Attributed_Character is record Attr : Character_Attribute_Set; Color : Color_Pair; Ch : Character; end record; pragma Convention (C_Pass_By_Copy, Attributed_Character); -- This is the counterpart for the chtype in C. for Attributed_Character use record Ch at 0 range Curses_Constants.A_CHARTEXT_First .. Curses_Constants.A_CHARTEXT_Last; Color at 0 range Curses_Constants.A_COLOR_First .. Curses_Constants.A_COLOR_Last; pragma Warnings (Off); Attr at 0 range Curses_Constants.Attr_First .. Curses_Constants.Attr_Last; pragma Warnings (On); end record; for Attributed_Character'Size use Curses_Constants.chtype_Size; Default_Character : constant Attributed_Character := (Ch => Character'First, Color => Color_Pair'First, Attr => (others => False)); -- preelaboratable Normal_Video type Attributed_String is array (Positive range <>) of Attributed_Character; pragma Convention (C, Attributed_String); -- In this binding we allow strings of attributed characters. ------------------ -- Exceptions -- ------------------ Curses_Exception : exception; Wrong_Curses_Version : exception; -- Those exceptions are raised by the ETI (Extended Terminal Interface) -- subpackets for Menu and Forms handling. -- Eti_System_Error : exception; Eti_Bad_Argument : exception; Eti_Posted : exception; Eti_Connected : exception; Eti_Bad_State : exception; Eti_No_Room : exception; Eti_Not_Posted : exception; Eti_Unknown_Command : exception; Eti_No_Match : exception; Eti_Not_Selectable : exception; Eti_Not_Connected : exception; Eti_Request_Denied : exception; Eti_Invalid_Field : exception; Eti_Current : exception; -------------------------------------------------------------------------- -- External C variables -- Conceptually even in C this are kind of constants, but they are -- initialized and sometimes changed by the library routines at runtime -- depending on the type of terminal. I believe the best way to model -- this is to use functions. -------------------------------------------------------------------------- function Lines return Line_Count; pragma Inline (Lines); function Columns return Column_Count; pragma Inline (Columns); function Tab_Size return Natural; pragma Inline (Tab_Size); function Number_Of_Colors return Natural; pragma Inline (Number_Of_Colors); function Number_Of_Color_Pairs return Natural; pragma Inline (Number_Of_Color_Pairs); subtype ACS_Index is Character range Character'Val (0) .. Character'Val (127); function ACS_Map (Index : ACS_Index) return Attributed_Character; pragma Import (C, ACS_Map, "acs_map_as_function"); -- Constants for several characters from the Alternate Character Set -- You must use these constants as indices into the ACS_Map function -- to get the corresponding attributed character at runtime ACS_Upper_Left_Corner : constant ACS_Index := Character'Val (Curses_Constants.ACS_ULCORNER); ACS_Lower_Left_Corner : constant ACS_Index := Character'Val (Curses_Constants.ACS_LLCORNER); ACS_Upper_Right_Corner : constant ACS_Index := Character'Val (Curses_Constants.ACS_URCORNER); ACS_Lower_Right_Corner : constant ACS_Index := Character'Val (Curses_Constants.ACS_LRCORNER); ACS_Left_Tee : constant ACS_Index := Character'Val (Curses_Constants.ACS_LTEE); ACS_Right_Tee : constant ACS_Index := Character'Val (Curses_Constants.ACS_RTEE); ACS_Bottom_Tee : constant ACS_Index := Character'Val (Curses_Constants.ACS_BTEE); ACS_Top_Tee : constant ACS_Index := Character'Val (Curses_Constants.ACS_TTEE); ACS_Horizontal_Line : constant ACS_Index := Character'Val (Curses_Constants.ACS_HLINE); ACS_Vertical_Line : constant ACS_Index := Character'Val (Curses_Constants.ACS_VLINE); ACS_Plus_Symbol : constant ACS_Index := Character'Val (Curses_Constants.ACS_PLUS); ACS_Scan_Line_1 : constant ACS_Index := Character'Val (Curses_Constants.ACS_S1); ACS_Scan_Line_9 : constant ACS_Index := Character'Val (Curses_Constants.ACS_S9); ACS_Diamond : constant ACS_Index := Character'Val (Curses_Constants.ACS_DIAMOND); ACS_Checker_Board : constant ACS_Index := Character'Val (Curses_Constants.ACS_CKBOARD); ACS_Degree : constant ACS_Index := Character'Val (Curses_Constants.ACS_DEGREE); ACS_Plus_Minus : constant ACS_Index := Character'Val (Curses_Constants.ACS_PLMINUS); ACS_Bullet : constant ACS_Index := Character'Val (Curses_Constants.ACS_BULLET); ACS_Left_Arrow : constant ACS_Index := Character'Val (Curses_Constants.ACS_LARROW); ACS_Right_Arrow : constant ACS_Index := Character'Val (Curses_Constants.ACS_RARROW); ACS_Down_Arrow : constant ACS_Index := Character'Val (Curses_Constants.ACS_DARROW); ACS_Up_Arrow : constant ACS_Index := Character'Val (Curses_Constants.ACS_UARROW); ACS_Board_Of_Squares : constant ACS_Index := Character'Val (Curses_Constants.ACS_BOARD); ACS_Lantern : constant ACS_Index := Character'Val (Curses_Constants.ACS_LANTERN); ACS_Solid_Block : constant ACS_Index := Character'Val (Curses_Constants.ACS_BLOCK); ACS_Scan_Line_3 : constant ACS_Index := Character'Val (Curses_Constants.ACS_S3); ACS_Scan_Line_7 : constant ACS_Index := Character'Val (Curses_Constants.ACS_S7); ACS_Less_Or_Equal : constant ACS_Index := Character'Val (Curses_Constants.ACS_LEQUAL); ACS_Greater_Or_Equal : constant ACS_Index := Character'Val (Curses_Constants.ACS_GEQUAL); ACS_PI : constant ACS_Index := Character'Val (Curses_Constants.ACS_PI); ACS_Not_Equal : constant ACS_Index := Character'Val (Curses_Constants.ACS_NEQUAL); ACS_Sterling : constant ACS_Index := Character'Val (Curses_Constants.ACS_STERLING); -- MANPAGE(`curs_initscr.3x') -- | Not implemented: newterm, set_term, delscreen -- ANCHOR(`stdscr',`Standard_Window') function Standard_Window return Window; -- AKA pragma Import (C, Standard_Window, "stdscr_as_function"); pragma Inline (Standard_Window); -- ANCHOR(`curscr',`Current_Window') function Current_Window return Window; -- AKA pragma Import (C, Current_Window, "curscr_as_function"); pragma Inline (Current_Window); -- ANCHOR(`initscr()',`Init_Screen') procedure Init_Screen; -- ANCHOR(`initscr()',`Init_Windows') procedure Init_Windows renames Init_Screen; -- AKA pragma Inline (Init_Screen); -- pragma Inline (Init_Windows); -- ANCHOR(`endwin()',`End_Windows') procedure End_Windows; -- AKA procedure End_Screen renames End_Windows; pragma Inline (End_Windows); -- pragma Inline (End_Screen); -- ANCHOR(`isendwin()',`Is_End_Window') function Is_End_Window return Boolean; -- AKA pragma Inline (Is_End_Window); -- MANPAGE(`curs_move.3x') -- ANCHOR(`wmove()',`Move_Cursor') procedure Move_Cursor (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position); -- AKA -- ALIAS(`move()') pragma Inline (Move_Cursor); -- MANPAGE(`curs_addch.3x') -- ANCHOR(`waddch()',`Add') procedure Add (Win : Window := Standard_Window; Ch : Attributed_Character); -- AKA -- ALIAS(`addch()') procedure Add (Win : Window := Standard_Window; Ch : Character); -- Add a single character at the current logical cursor position to -- the window. Use the current windows attributes. -- ANCHOR(`mvwaddch()',`Add') procedure Add (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Ch : Attributed_Character); -- AKA -- ALIAS(`mvaddch()') procedure Add (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Ch : Character); -- Move to the position and add a single character into the window -- There are more Add routines, so the Inline pragma follows later -- ANCHOR(`wechochar()',`Add_With_Immediate_Echo') procedure Add_With_Immediate_Echo (Win : Window := Standard_Window; Ch : Attributed_Character); -- AKA -- ALIAS(`echochar()') procedure Add_With_Immediate_Echo (Win : Window := Standard_Window; Ch : Character); -- Add a character and do an immediate refresh of the screen. pragma Inline (Add_With_Immediate_Echo); -- MANPAGE(`curs_window.3x') -- Not Implemented: wcursyncup -- ANCHOR(`newwin()',`Create') function Create (Number_Of_Lines : Line_Count; Number_Of_Columns : Column_Count; First_Line_Position : Line_Position; First_Column_Position : Column_Position) return Window; -- Not Implemented: Default Number_Of_Lines, Number_Of_Columns -- the C version lets them be 0, see the man page. -- AKA pragma Inline (Create); function New_Window (Number_Of_Lines : Line_Count; Number_Of_Columns : Column_Count; First_Line_Position : Line_Position; First_Column_Position : Column_Position) return Window renames Create; -- pragma Inline (New_Window); -- ANCHOR(`delwin()',`Delete') procedure Delete (Win : in out Window); -- AKA -- Reset Win to Null_Window pragma Inline (Delete); -- ANCHOR(`subwin()',`Sub_Window') function Sub_Window (Win : Window := Standard_Window; Number_Of_Lines : Line_Count; Number_Of_Columns : Column_Count; First_Line_Position : Line_Position; First_Column_Position : Column_Position) return Window; -- AKA pragma Inline (Sub_Window); -- ANCHOR(`derwin()',`Derived_Window') function Derived_Window (Win : Window := Standard_Window; Number_Of_Lines : Line_Count; Number_Of_Columns : Column_Count; First_Line_Position : Line_Position; First_Column_Position : Column_Position) return Window; -- AKA pragma Inline (Derived_Window); -- ANCHOR(`dupwin()',`Duplicate') function Duplicate (Win : Window) return Window; -- AKA pragma Inline (Duplicate); -- ANCHOR(`mvwin()',`Move_Window') procedure Move_Window (Win : Window; Line : Line_Position; Column : Column_Position); -- AKA pragma Inline (Move_Window); -- ANCHOR(`mvderwin()',`Move_Derived_Window') procedure Move_Derived_Window (Win : Window; Line : Line_Position; Column : Column_Position); -- AKA pragma Inline (Move_Derived_Window); -- ANCHOR(`wsyncup()',`Synchronize_Upwards') procedure Synchronize_Upwards (Win : Window); -- AKA pragma Import (C, Synchronize_Upwards, "wsyncup"); -- ANCHOR(`wsyncdown()',`Synchronize_Downwards') procedure Synchronize_Downwards (Win : Window); -- AKA pragma Import (C, Synchronize_Downwards, "wsyncdown"); -- ANCHOR(`syncok()',`Set_Synch_Mode') procedure Set_Synch_Mode (Win : Window := Standard_Window; Mode : Boolean := False); -- AKA pragma Inline (Set_Synch_Mode); -- MANPAGE(`curs_addstr.3x') -- ANCHOR(`waddnstr()',`Add') procedure Add (Win : Window := Standard_Window; Str : String; Len : Integer := -1); -- AKA -- ALIAS(`waddstr()') -- ALIAS(`addnstr()') -- ALIAS(`addstr()') -- ANCHOR(`mvwaddnstr()',`Add') procedure Add (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Str : String; Len : Integer := -1); -- AKA -- ALIAS(`mvwaddstr()') -- ALIAS(`mvaddnstr()') -- ALIAS(`mvaddstr()') -- MANPAGE(`curs_addchstr.3x') -- ANCHOR(`waddchnstr()',`Add') procedure Add (Win : Window := Standard_Window; Str : Attributed_String; Len : Integer := -1); -- AKA -- ALIAS(`waddchstr()') -- ALIAS(`addchnstr()') -- ALIAS(`addchstr()') -- ANCHOR(`mvwaddchnstr()',`Add') procedure Add (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Str : Attributed_String; Len : Integer := -1); -- AKA -- ALIAS(`mvwaddchstr()') -- ALIAS(`mvaddchnstr()') -- ALIAS(`mvaddchstr()') pragma Inline (Add); -- MANPAGE(`curs_border.3x') -- | Not implemented: mvhline, mvwhline, mvvline, mvwvline -- | use Move_Cursor then Horizontal_Line or Vertical_Line -- ANCHOR(`wborder()',`Border') procedure Border (Win : Window := Standard_Window; Left_Side_Symbol : Attributed_Character := Default_Character; Right_Side_Symbol : Attributed_Character := Default_Character; Top_Side_Symbol : Attributed_Character := Default_Character; Bottom_Side_Symbol : Attributed_Character := Default_Character; Upper_Left_Corner_Symbol : Attributed_Character := Default_Character; Upper_Right_Corner_Symbol : Attributed_Character := Default_Character; Lower_Left_Corner_Symbol : Attributed_Character := Default_Character; Lower_Right_Corner_Symbol : Attributed_Character := Default_Character ); -- AKA -- ALIAS(`border()') pragma Inline (Border); -- ANCHOR(`box()',`Box') procedure Box (Win : Window := Standard_Window; Vertical_Symbol : Attributed_Character := Default_Character; Horizontal_Symbol : Attributed_Character := Default_Character); -- AKA pragma Inline (Box); -- ANCHOR(`whline()',`Horizontal_Line') procedure Horizontal_Line (Win : Window := Standard_Window; Line_Size : Natural; Line_Symbol : Attributed_Character := Default_Character); -- AKA -- ALIAS(`hline()') pragma Inline (Horizontal_Line); -- ANCHOR(`wvline()',`Vertical_Line') procedure Vertical_Line (Win : Window := Standard_Window; Line_Size : Natural; Line_Symbol : Attributed_Character := Default_Character); -- AKA -- ALIAS(`vline()') pragma Inline (Vertical_Line); -- MANPAGE(`curs_getch.3x') -- Not implemented: mvgetch, mvwgetch -- ANCHOR(`wgetch()',`Get_Keystroke') function Get_Keystroke (Win : Window := Standard_Window) return Real_Key_Code; -- AKA -- ALIAS(`getch()') -- Get a character from the keyboard and echo it - if enabled - to the -- window. -- If for any reason (i.e. a timeout) we could not get a character the -- returned keycode is Key_None. pragma Inline (Get_Keystroke); -- ANCHOR(`ungetch()',`Undo_Keystroke') procedure Undo_Keystroke (Key : Real_Key_Code); -- AKA pragma Inline (Undo_Keystroke); -- ANCHOR(`has_key()',`Has_Key') function Has_Key (Key : Special_Key_Code) return Boolean; -- AKA pragma Inline (Has_Key); -- | -- | Some helper functions -- | function Is_Function_Key (Key : Special_Key_Code) return Boolean; -- Return True if the Key is a function key (i.e. one of F0 .. F63) pragma Inline (Is_Function_Key); subtype Function_Key_Number is Integer range 0 .. 63; -- (n)curses allows for 64 function keys. function Function_Key (Key : Real_Key_Code) return Function_Key_Number; -- Return the number of the function key. If the code is not a -- function key, a CONSTRAINT_ERROR will be raised. pragma Inline (Function_Key); function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code; -- Return the key code for a given function-key number. pragma Inline (Function_Key_Code); -- MANPAGE(`curs_attr.3x') -- | Not implemented attr_off, wattr_off, -- | attr_on, wattr_on, attr_set, wattr_set -- PAIR_NUMBER -- PAIR_NUMBER(c) is the same as c.Color -- ANCHOR(`standout()',`Standout') procedure Standout (Win : Window := Standard_Window; On : Boolean := True); -- ALIAS(`wstandout()') -- ALIAS(`wstandend()') -- ANCHOR(`wattron()',`Switch_Character_Attribute') procedure Switch_Character_Attribute (Win : Window := Standard_Window; Attr : Character_Attribute_Set := Normal_Video; On : Boolean := True); -- if False we switch Off. -- Switches those Attributes set to true in the list. -- AKA -- ALIAS(`wattroff()') -- ALIAS(`attron()') -- ALIAS(`attroff()') -- ANCHOR(`wattrset()',`Set_Character_Attributes') procedure Set_Character_Attributes (Win : Window := Standard_Window; Attr : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First); -- AKA -- ALIAS(`attrset()') pragma Inline (Set_Character_Attributes); -- ANCHOR(`wattr_get()',`Get_Character_Attributes') function Get_Character_Attribute (Win : Window := Standard_Window) return Character_Attribute_Set; -- AKA -- ALIAS(`attr_get()') -- ANCHOR(`wattr_get()',`Get_Character_Attribute') function Get_Character_Attribute (Win : Window := Standard_Window) return Color_Pair; -- AKA pragma Inline (Get_Character_Attribute); -- ANCHOR(`wcolor_set()',`Set_Color') procedure Set_Color (Win : Window := Standard_Window; Pair : Color_Pair); -- AKA -- ALIAS(`color_set()') pragma Inline (Set_Color); -- ANCHOR(`wchgat()',`Change_Attributes') procedure Change_Attributes (Win : Window := Standard_Window; Count : Integer := -1; Attr : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First); -- AKA -- ALIAS(`chgat()') -- ANCHOR(`mvwchgat()',`Change_Attributes') procedure Change_Attributes (Win : Window := Standard_Window; Line : Line_Position := Line_Position'First; Column : Column_Position := Column_Position'First; Count : Integer := -1; Attr : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First); -- AKA -- ALIAS(`mvchgat()') pragma Inline (Change_Attributes); -- MANPAGE(`curs_beep.3x') -- ANCHOR(`beep()',`Beep') procedure Beep; -- AKA pragma Inline (Beep); -- ANCHOR(`flash()',`Flash_Screen') procedure Flash_Screen; -- AKA pragma Inline (Flash_Screen); -- MANPAGE(`curs_inopts.3x') -- | Not implemented : typeahead -- -- ANCHOR(`cbreak()',`Set_Cbreak_Mode') procedure Set_Cbreak_Mode (SwitchOn : Boolean := True); -- AKA -- ALIAS(`nocbreak()') pragma Inline (Set_Cbreak_Mode); -- ANCHOR(`raw()',`Set_Raw_Mode') procedure Set_Raw_Mode (SwitchOn : Boolean := True); -- AKA -- ALIAS(`noraw()') pragma Inline (Set_Raw_Mode); -- ANCHOR(`echo()',`Set_Echo_Mode') procedure Set_Echo_Mode (SwitchOn : Boolean := True); -- AKA -- ALIAS(`noecho()') pragma Inline (Set_Echo_Mode); -- ANCHOR(`meta()',`Set_Meta_Mode') procedure Set_Meta_Mode (Win : Window := Standard_Window; SwitchOn : Boolean := True); -- AKA pragma Inline (Set_Meta_Mode); -- ANCHOR(`keypad()',`Set_KeyPad_Mode') procedure Set_KeyPad_Mode (Win : Window := Standard_Window; SwitchOn : Boolean := True); -- AKA pragma Inline (Set_KeyPad_Mode); function Get_KeyPad_Mode (Win : Window := Standard_Window) return Boolean; -- This has no pendant in C. There you've to look into the WINDOWS -- structure to get the value. Bad practice, not repeated in Ada. type Half_Delay_Amount is range 1 .. 255; -- ANCHOR(`halfdelay()',`Half_Delay') procedure Half_Delay (Amount : Half_Delay_Amount); -- AKA pragma Inline (Half_Delay); -- ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode') procedure Set_Flush_On_Interrupt_Mode (Win : Window := Standard_Window; Mode : Boolean := True); -- AKA pragma Inline (Set_Flush_On_Interrupt_Mode); -- ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode') procedure Set_Queue_Interrupt_Mode (Win : Window := Standard_Window; Flush : Boolean := True); -- AKA -- ALIAS(`noqiflush()') pragma Inline (Set_Queue_Interrupt_Mode); -- ANCHOR(`nodelay()',`Set_NoDelay_Mode') procedure Set_NoDelay_Mode (Win : Window := Standard_Window; Mode : Boolean := False); -- AKA pragma Inline (Set_NoDelay_Mode); type Timeout_Mode is (Blocking, Non_Blocking, Delayed); -- ANCHOR(`wtimeout()',`Set_Timeout_Mode') procedure Set_Timeout_Mode (Win : Window := Standard_Window; Mode : Timeout_Mode; Amount : Natural); -- in Milliseconds -- AKA -- ALIAS(`timeout()') -- Instead of overloading the semantic of the sign of amount, we -- introduce the Timeout_Mode parameter. This should improve -- readability. For Blocking and Non_Blocking, the Amount is not -- evaluated. -- We do not inline this procedure. -- ANCHOR(`notimeout()',`Set_Escape_Time_Mode') procedure Set_Escape_Timer_Mode (Win : Window := Standard_Window; Timer_Off : Boolean := False); -- AKA pragma Inline (Set_Escape_Timer_Mode); -- MANPAGE(`curs_outopts.3x') -- ANCHOR(`nl()',`Set_NL_Mode') procedure Set_NL_Mode (SwitchOn : Boolean := True); -- AKA -- ALIAS(`nonl()') pragma Inline (Set_NL_Mode); -- ANCHOR(`clearok()',`Clear_On_Next_Update') procedure Clear_On_Next_Update (Win : Window := Standard_Window; Do_Clear : Boolean := True); -- AKA pragma Inline (Clear_On_Next_Update); -- ANCHOR(`idlok()',`Use_Insert_Delete_Line') procedure Use_Insert_Delete_Line (Win : Window := Standard_Window; Do_Idl : Boolean := True); -- AKA pragma Inline (Use_Insert_Delete_Line); -- ANCHOR(`idcok()',`Use_Insert_Delete_Character') procedure Use_Insert_Delete_Character (Win : Window := Standard_Window; Do_Idc : Boolean := True); -- AKA pragma Inline (Use_Insert_Delete_Character); -- ANCHOR(`leaveok()',`Leave_Cursor_After_Update') procedure Leave_Cursor_After_Update (Win : Window := Standard_Window; Do_Leave : Boolean := True); -- AKA pragma Inline (Leave_Cursor_After_Update); -- ANCHOR(`immedok()',`Immediate_Update_Mode') procedure Immediate_Update_Mode (Win : Window := Standard_Window; Mode : Boolean := False); -- AKA pragma Inline (Immediate_Update_Mode); -- ANCHOR(`scrollok()',`Allow_Scrolling') procedure Allow_Scrolling (Win : Window := Standard_Window; Mode : Boolean := False); -- AKA pragma Inline (Allow_Scrolling); function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean; -- There is no such function in the C interface. pragma Inline (Scrolling_Allowed); -- ANCHOR(`wsetscrreg()',`Set_Scroll_Region') procedure Set_Scroll_Region (Win : Window := Standard_Window; Top_Line : Line_Position; Bottom_Line : Line_Position); -- AKA -- ALIAS(`setscrreg()') pragma Inline (Set_Scroll_Region); -- MANPAGE(`curs_refresh.3x') -- ANCHOR(`doupdate()',`Update_Screen') procedure Update_Screen; -- AKA pragma Inline (Update_Screen); -- ANCHOR(`wrefresh()',`Refresh') procedure Refresh (Win : Window := Standard_Window); -- AKA -- There is an overloaded Refresh for Pads. -- The Inline pragma appears there -- ALIAS(`refresh()') -- ANCHOR(`wnoutrefresh()',`Refresh_Without_Update') procedure Refresh_Without_Update (Win : Window := Standard_Window); -- AKA -- There is an overloaded Refresh_Without_Update for Pads. -- The Inline pragma appears there -- ANCHOR(`redrawwin()',`Redraw') procedure Redraw (Win : Window := Standard_Window); -- AKA -- ANCHOR(`wredrawln()',`Redraw') procedure Redraw (Win : Window := Standard_Window; Begin_Line : Line_Position; Line_Count : Positive); -- AKA pragma Inline (Redraw); -- MANPAGE(`curs_clear.3x') -- ANCHOR(`werase()',`Erase') procedure Erase (Win : Window := Standard_Window); -- AKA -- ALIAS(`erase()') pragma Inline (Erase); -- ANCHOR(`wclear()',`Clear') procedure Clear (Win : Window := Standard_Window); -- AKA -- ALIAS(`clear()') pragma Inline (Clear); -- ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen') procedure Clear_To_End_Of_Screen (Win : Window := Standard_Window); -- AKA -- ALIAS(`clrtobot()') pragma Inline (Clear_To_End_Of_Screen); -- ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line') procedure Clear_To_End_Of_Line (Win : Window := Standard_Window); -- AKA -- ALIAS(`clrtoeol()') pragma Inline (Clear_To_End_Of_Line); -- MANPAGE(`curs_bkgd.3x') -- ANCHOR(`wbkgdset()',`Set_Background') -- TODO: we could have Set_Background(Window; Character_Attribute_Set) -- because in C it is common to see bkgdset(A_BOLD) or -- bkgdset(COLOR_PAIR(n)) procedure Set_Background (Win : Window := Standard_Window; Ch : Attributed_Character); -- AKA -- ALIAS(`bkgdset()') pragma Inline (Set_Background); -- ANCHOR(`wbkgd()',`Change_Background') procedure Change_Background (Win : Window := Standard_Window; Ch : Attributed_Character); -- AKA -- ALIAS(`bkgd()') pragma Inline (Change_Background); -- ANCHOR(`wbkgdget()',`Get_Background') -- ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough. function Get_Background (Win : Window := Standard_Window) return Attributed_Character; -- AKA -- ALIAS(`bkgdget()') pragma Inline (Get_Background); -- MANPAGE(`curs_touch.3x') -- ANCHOR(`untouchwin()',`Untouch') procedure Untouch (Win : Window := Standard_Window); -- AKA pragma Inline (Untouch); -- ANCHOR(`touchwin()',`Touch') procedure Touch (Win : Window := Standard_Window); -- AKA -- ANCHOR(`touchline()',`Touch') procedure Touch (Win : Window := Standard_Window; Start : Line_Position; Count : Positive); -- AKA pragma Inline (Touch); -- ANCHOR(`wtouchln()',`Change_Line_Status') procedure Change_Lines_Status (Win : Window := Standard_Window; Start : Line_Position; Count : Positive; State : Boolean); -- AKA pragma Inline (Change_Lines_Status); -- ANCHOR(`is_linetouched()',`Is_Touched') function Is_Touched (Win : Window := Standard_Window; Line : Line_Position) return Boolean; -- AKA -- ANCHOR(`is_wintouched()',`Is_Touched') function Is_Touched (Win : Window := Standard_Window) return Boolean; -- AKA pragma Inline (Is_Touched); -- MANPAGE(`curs_overlay.3x') -- ANCHOR(`copywin()',`Copy') procedure Copy (Source_Window : Window; Destination_Window : Window; Source_Top_Row : Line_Position; Source_Left_Column : Column_Position; Destination_Top_Row : Line_Position; Destination_Left_Column : Column_Position; Destination_Bottom_Row : Line_Position; Destination_Right_Column : Column_Position; Non_Destructive_Mode : Boolean := True); -- AKA pragma Inline (Copy); -- ANCHOR(`overwrite()',`Overwrite') procedure Overwrite (Source_Window : Window; Destination_Window : Window); -- AKA pragma Inline (Overwrite); -- ANCHOR(`overlay()',`Overlay') procedure Overlay (Source_Window : Window; Destination_Window : Window); -- AKA pragma Inline (Overlay); -- MANPAGE(`curs_deleteln.3x') -- ANCHOR(`winsdelln()',`Insert_Delete_Lines') procedure Insert_Delete_Lines (Win : Window := Standard_Window; Lines : Integer := 1); -- default is to insert one line above -- AKA -- ALIAS(`insdelln()') pragma Inline (Insert_Delete_Lines); -- ANCHOR(`wdeleteln()',`Delete_Line') procedure Delete_Line (Win : Window := Standard_Window); -- AKA -- ALIAS(`deleteln()') pragma Inline (Delete_Line); -- ANCHOR(`winsertln()',`Insert_Line') procedure Insert_Line (Win : Window := Standard_Window); -- AKA -- ALIAS(`insertln()') pragma Inline (Insert_Line); -- MANPAGE(`curs_getyx.3x') -- ANCHOR(`getmaxyx()',`Get_Size') procedure Get_Size (Win : Window := Standard_Window; Number_Of_Lines : out Line_Count; Number_Of_Columns : out Column_Count); -- AKA pragma Inline (Get_Size); -- ANCHOR(`getbegyx()',`Get_Window_Position') procedure Get_Window_Position (Win : Window := Standard_Window; Top_Left_Line : out Line_Position; Top_Left_Column : out Column_Position); -- AKA pragma Inline (Get_Window_Position); -- ANCHOR(`getyx()',`Get_Cursor_Position') procedure Get_Cursor_Position (Win : Window := Standard_Window; Line : out Line_Position; Column : out Column_Position); -- AKA pragma Inline (Get_Cursor_Position); -- ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent') procedure Get_Origin_Relative_To_Parent (Win : Window; Top_Left_Line : out Line_Position; Top_Left_Column : out Column_Position; Is_Not_A_Subwindow : out Boolean); -- AKA -- Instead of placing -1 in the coordinates as return, we use a Boolean -- to return the info that the window has no parent. pragma Inline (Get_Origin_Relative_To_Parent); -- MANPAGE(`curs_pad.3x') -- ANCHOR(`newpad()',`New_Pad') function New_Pad (Lines : Line_Count; Columns : Column_Count) return Window; -- AKA pragma Inline (New_Pad); -- ANCHOR(`subpad()',`Sub_Pad') function Sub_Pad (Pad : Window; Number_Of_Lines : Line_Count; Number_Of_Columns : Column_Count; First_Line_Position : Line_Position; First_Column_Position : Column_Position) return Window; -- AKA pragma Inline (Sub_Pad); -- ANCHOR(`prefresh()',`Refresh') procedure Refresh (Pad : Window; Source_Top_Row : Line_Position; Source_Left_Column : Column_Position; Destination_Top_Row : Line_Position; Destination_Left_Column : Column_Position; Destination_Bottom_Row : Line_Position; Destination_Right_Column : Column_Position); -- AKA pragma Inline (Refresh); -- ANCHOR(`pnoutrefresh()',`Refresh_Without_Update') procedure Refresh_Without_Update (Pad : Window; Source_Top_Row : Line_Position; Source_Left_Column : Column_Position; Destination_Top_Row : Line_Position; Destination_Left_Column : Column_Position; Destination_Bottom_Row : Line_Position; Destination_Right_Column : Column_Position); -- AKA pragma Inline (Refresh_Without_Update); -- ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It') procedure Add_Character_To_Pad_And_Echo_It (Pad : Window; Ch : Attributed_Character); -- AKA procedure Add_Character_To_Pad_And_Echo_It (Pad : Window; Ch : Character); pragma Inline (Add_Character_To_Pad_And_Echo_It); -- MANPAGE(`curs_scroll.3x') -- ANCHOR(`wscrl()',`Scroll') procedure Scroll (Win : Window := Standard_Window; Amount : Integer := 1); -- AKA -- ALIAS(`scroll()') -- ALIAS(`scrl()') pragma Inline (Scroll); -- MANPAGE(`curs_delch.3x') -- ANCHOR(`wdelch()',`Delete_Character') procedure Delete_Character (Win : Window := Standard_Window); -- AKA -- ALIAS(`delch()') -- ANCHOR(`mvwdelch()',`Delete_Character') procedure Delete_Character (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position); -- AKA -- ALIAS(`mvdelch()') pragma Inline (Delete_Character); -- MANPAGE(`curs_inch.3x') -- ANCHOR(`winch()',`Peek') function Peek (Win : Window := Standard_Window) return Attributed_Character; -- ALIAS(`inch()') -- AKA -- ANCHOR(`mvwinch()',`Peek') function Peek (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position) return Attributed_Character; -- AKA -- ALIAS(`mvinch()') -- More Peek's follow, pragma Inline appears later. -- MANPAGE(`curs_insch.3x') -- ANCHOR(`winsch()',`Insert') procedure Insert (Win : Window := Standard_Window; Ch : Attributed_Character); -- AKA -- ALIAS(`insch()') -- ANCHOR(`mvwinsch()',`Insert') procedure Insert (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Ch : Attributed_Character); -- AKA -- ALIAS(`mvinsch()') -- MANPAGE(`curs_insstr.3x') -- ANCHOR(`winsnstr()',`Insert') procedure Insert (Win : Window := Standard_Window; Str : String; Len : Integer := -1); -- AKA -- ALIAS(`winsstr()') -- ALIAS(`insnstr()') -- ALIAS(`insstr()') -- ANCHOR(`mvwinsnstr()',`Insert') procedure Insert (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Str : String; Len : Integer := -1); -- AKA -- ALIAS(`mvwinsstr()') -- ALIAS(`mvinsnstr()') -- ALIAS(`mvinsstr()') pragma Inline (Insert); -- MANPAGE(`curs_instr.3x') -- ANCHOR(`winnstr()',`Peek') procedure Peek (Win : Window := Standard_Window; Str : out String; Len : Integer := -1); -- AKA -- ALIAS(`winstr()') -- ALIAS(`innstr()') -- ALIAS(`instr()') -- ANCHOR(`mvwinnstr()',`Peek') procedure Peek (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Str : out String; Len : Integer := -1); -- AKA -- ALIAS(`mvwinstr()') -- ALIAS(`mvinnstr()') -- ALIAS(`mvinstr()') -- MANPAGE(`curs_inchstr.3x') -- ANCHOR(`winchnstr()',`Peek') procedure Peek (Win : Window := Standard_Window; Str : out Attributed_String; Len : Integer := -1); -- AKA -- ALIAS(`winchstr()') -- ALIAS(`inchnstr()') -- ALIAS(`inchstr()') -- ANCHOR(`mvwinchnstr()',`Peek') procedure Peek (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Str : out Attributed_String; Len : Integer := -1); -- AKA -- ALIAS(`mvwinchstr()') -- ALIAS(`mvinchnstr()') -- ALIAS(`mvinchstr()') -- We do not inline the Peek procedures -- MANPAGE(`curs_getstr.3x') -- ANCHOR(`wgetnstr()',`Get') procedure Get (Win : Window := Standard_Window; Str : out String; Len : Integer := -1); -- AKA -- ALIAS(`wgetstr()') -- ALIAS(`getnstr()') -- ALIAS(`getstr()') -- actually getstr is not supported because that results in buffer -- overflows. -- ANCHOR(`mvwgetnstr()',`Get') procedure Get (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Str : out String; Len : Integer := -1); -- AKA -- ALIAS(`mvwgetstr()') -- ALIAS(`mvgetnstr()') -- ALIAS(`mvgetstr()') -- Get is not inlined -- MANPAGE(`curs_slk.3x') -- Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set type Soft_Label_Key_Format is (Three_Two_Three, Four_Four, PC_Style, -- ncurses specific PC_Style_With_Index); -- " type Label_Number is new Positive range 1 .. 12; type Label_Justification is (Left, Centered, Right); -- ANCHOR(`slk_init()',`Init_Soft_Label_Keys') procedure Init_Soft_Label_Keys (Format : Soft_Label_Key_Format := Three_Two_Three); -- AKA pragma Inline (Init_Soft_Label_Keys); -- ANCHOR(`slk_set()',`Set_Soft_Label_Key') procedure Set_Soft_Label_Key (Label : Label_Number; Text : String; Fmt : Label_Justification := Left); -- AKA -- We do not inline this procedure -- ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key') procedure Refresh_Soft_Label_Keys; -- AKA pragma Inline (Refresh_Soft_Label_Keys); -- ANCHOR(`slk_noutrefresh()',`Refresh_Soft_Label_Keys_Without_Update') procedure Refresh_Soft_Label_Keys_Without_Update; -- AKA pragma Inline (Refresh_Soft_Label_Keys_Without_Update); -- ANCHOR(`slk_label()',`Get_Soft_Label_Key') procedure Get_Soft_Label_Key (Label : Label_Number; Text : out String); -- AKA -- ANCHOR(`slk_label()',`Get_Soft_Label_Key') function Get_Soft_Label_Key (Label : Label_Number) return String; -- AKA -- Same as function pragma Inline (Get_Soft_Label_Key); -- ANCHOR(`slk_clear()',`Clear_Soft_Label_Keys') procedure Clear_Soft_Label_Keys; -- AKA pragma Inline (Clear_Soft_Label_Keys); -- ANCHOR(`slk_restore()',`Restore_Soft_Label_Keys') procedure Restore_Soft_Label_Keys; -- AKA pragma Inline (Restore_Soft_Label_Keys); -- ANCHOR(`slk_touch()',`Touch_Soft_Label_Keys') procedure Touch_Soft_Label_Keys; -- AKA pragma Inline (Touch_Soft_Label_Keys); -- ANCHOR(`slk_attron()',`Switch_Soft_Label_Key_Attributes') procedure Switch_Soft_Label_Key_Attributes (Attr : Character_Attribute_Set; On : Boolean := True); -- AKA -- ALIAS(`slk_attroff()') pragma Inline (Switch_Soft_Label_Key_Attributes); -- ANCHOR(`slk_attrset()',`Set_Soft_Label_Key_Attributes') procedure Set_Soft_Label_Key_Attributes (Attr : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First); -- AKA pragma Inline (Set_Soft_Label_Key_Attributes); -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes') function Get_Soft_Label_Key_Attributes return Character_Attribute_Set; -- AKA -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes') function Get_Soft_Label_Key_Attributes return Color_Pair; -- AKA pragma Inline (Get_Soft_Label_Key_Attributes); -- ANCHOR(`slk_color()',`Set_Soft_Label_Key_Color') procedure Set_Soft_Label_Key_Color (Pair : Color_Pair); -- AKA pragma Inline (Set_Soft_Label_Key_Color); -- MANPAGE(`keybound.3x') -- Not Implemented: keybound -- MANPAGE(`keyok.3x') -- ANCHOR(`keyok()',`Enable_Key') procedure Enable_Key (Key : Special_Key_Code; Enable : Boolean := True); -- AKA pragma Inline (Enable_Key); -- MANPAGE(`define_key.3x') -- ANCHOR(`define_key()',`Define_Key') procedure Define_Key (Definition : String; Key : Special_Key_Code); -- AKA pragma Inline (Define_Key); -- MANPAGE(`curs_util.3x') -- | Not implemented : filter, use_env -- | putwin, getwin are in the child package PutWin -- -- ANCHOR(`keyname()',`Key_Name') procedure Key_Name (Key : Real_Key_Code; Name : out String); -- AKA -- The external name for a real keystroke. -- ANCHOR(`keyname()',`Key_Name') function Key_Name (Key : Real_Key_Code) return String; -- AKA -- Same as function -- We do not inline this routine -- ANCHOR(`unctrl()',`Un_Control') procedure Un_Control (Ch : Attributed_Character; Str : out String); -- AKA -- ANCHOR(`unctrl()',`Un_Control') function Un_Control (Ch : Attributed_Character) return String; -- AKA -- Same as function pragma Inline (Un_Control); -- ANCHOR(`delay_output()',`Delay_Output') procedure Delay_Output (Msecs : Natural); -- AKA pragma Inline (Delay_Output); -- ANCHOR(`flushinp()',`Flush_Input') procedure Flush_Input; -- AKA pragma Inline (Flush_Input); -- MANPAGE(`curs_termattrs.3x') -- ANCHOR(`baudrate()',`Baudrate') function Baudrate return Natural; -- AKA pragma Inline (Baudrate); -- ANCHOR(`erasechar()',`Erase_Character') function Erase_Character return Character; -- AKA pragma Inline (Erase_Character); -- ANCHOR(`killchar()',`Kill_Character') function Kill_Character return Character; -- AKA pragma Inline (Kill_Character); -- ANCHOR(`has_ic()',`Has_Insert_Character') function Has_Insert_Character return Boolean; -- AKA pragma Inline (Has_Insert_Character); -- ANCHOR(`has_il()',`Has_Insert_Line') function Has_Insert_Line return Boolean; -- AKA pragma Inline (Has_Insert_Line); -- ANCHOR(`termattrs()',`Supported_Attributes') function Supported_Attributes return Character_Attribute_Set; -- AKA pragma Inline (Supported_Attributes); -- ANCHOR(`longname()',`Long_Name') procedure Long_Name (Name : out String); -- AKA -- ANCHOR(`longname()',`Long_Name') function Long_Name return String; -- AKA -- Same as function pragma Inline (Long_Name); -- ANCHOR(`termname()',`Terminal_Name') procedure Terminal_Name (Name : out String); -- AKA -- ANCHOR(`termname()',`Terminal_Name') function Terminal_Name return String; -- AKA -- Same as function pragma Inline (Terminal_Name); -- MANPAGE(`curs_color.3x') -- COLOR_PAIR -- COLOR_PAIR(n) in C is the same as -- Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video) -- In C you often see something like c = c | COLOR_PAIR(n); -- This is equivalent to c.Color := n; -- ANCHOR(`start_color()',`Start_Color') procedure Start_Color; -- AKA pragma Import (C, Start_Color, "start_color"); -- ANCHOR(`init_pair()',`Init_Pair') procedure Init_Pair (Pair : Redefinable_Color_Pair; Fore : Color_Number; Back : Color_Number); -- AKA pragma Inline (Init_Pair); -- ANCHOR(`pair_content()',`Pair_Content') procedure Pair_Content (Pair : Color_Pair; Fore : out Color_Number; Back : out Color_Number); -- AKA pragma Inline (Pair_Content); -- ANCHOR(`has_colors()',`Has_Colors') function Has_Colors return Boolean; -- AKA pragma Inline (Has_Colors); -- ANCHOR(`init_color()',`Init_Color') procedure Init_Color (Color : Color_Number; Red : RGB_Value; Green : RGB_Value; Blue : RGB_Value); -- AKA pragma Inline (Init_Color); -- ANCHOR(`can_change_color()',`Can_Change_Color') function Can_Change_Color return Boolean; -- AKA pragma Inline (Can_Change_Color); -- ANCHOR(`color_content()',`Color_Content') procedure Color_Content (Color : Color_Number; Red : out RGB_Value; Green : out RGB_Value; Blue : out RGB_Value); -- AKA pragma Inline (Color_Content); -- MANPAGE(`curs_kernel.3x') -- | Not implemented: getsyx, setsyx -- type Curses_Mode is (Curses, Shell); -- ANCHOR(`def_prog_mode()',`Save_Curses_Mode') procedure Save_Curses_Mode (Mode : Curses_Mode); -- AKA -- ALIAS(`def_shell_mode()') pragma Inline (Save_Curses_Mode); -- ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode') procedure Reset_Curses_Mode (Mode : Curses_Mode); -- AKA -- ALIAS(`reset_shell_mode()') pragma Inline (Reset_Curses_Mode); -- ANCHOR(`savetty()',`Save_Terminal_State') procedure Save_Terminal_State; -- AKA pragma Inline (Save_Terminal_State); -- ANCHOR(`resetty();',`Reset_Terminal_State') procedure Reset_Terminal_State; -- AKA pragma Inline (Reset_Terminal_State); type Stdscr_Init_Proc is access function (Win : Window; Columns : Column_Count) return Integer; pragma Convention (C, Stdscr_Init_Proc); -- N.B.: the return value is actually ignored, but it seems to be -- a good practice to return 0 if you think all went fine -- and -1 otherwise. -- ANCHOR(`ripoffline()',`Rip_Off_Lines') procedure Rip_Off_Lines (Lines : Integer; Proc : Stdscr_Init_Proc); -- AKA -- N.B.: to be more precise, this uses a ncurses specific enhancement of -- ripoffline(), in which the Lines argument absolute value is the -- number of lines to be ripped of. The official ripoffline() only -- uses the sign of Lines to remove a single line from bottom or top. pragma Inline (Rip_Off_Lines); type Cursor_Visibility is (Invisible, Normal, Very_Visible); -- ANCHOR(`curs_set()',`Set_Cursor_Visibility') procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility); -- AKA pragma Inline (Set_Cursor_Visibility); -- ANCHOR(`napms()',`Nap_Milli_Seconds') procedure Nap_Milli_Seconds (Ms : Natural); -- AKA pragma Inline (Nap_Milli_Seconds); -- |===================================================================== -- | Some useful helpers. -- |===================================================================== type Transform_Direction is (From_Screen, To_Screen); procedure Transform_Coordinates (W : Window := Standard_Window; Line : in out Line_Position; Column : in out Column_Position; Dir : Transform_Direction := From_Screen); -- This procedure transforms screen coordinates into coordinates relative -- to the window and vice versa, depending on the Dir parameter. -- Screen coordinates are the position information for the physical device. -- An Curses_Exception will be raised if Line and Column are not in the -- Window or if you pass the Null_Window as argument. -- We do not inline this procedure -- MANPAGE(`default_colors.3x') Default_Color : constant Color_Number := -1; -- ANCHOR(`use_default_colors()',`Use_Default_Colors') procedure Use_Default_Colors; -- AKA pragma Inline (Use_Default_Colors); -- ANCHOR(`assume_default_colors()',`Assume_Default_Colors') procedure Assume_Default_Colors (Fore : Color_Number := Default_Color; Back : Color_Number := Default_Color); -- AKA pragma Inline (Assume_Default_Colors); -- MANPAGE(`curs_extend.3x') -- ANCHOR(`curses_version()',`Curses_Version') function Curses_Version return String; -- AKA -- ANCHOR(`use_extended_names()',`Use_Extended_Names') -- The returnvalue is the previous setting of the flag function Use_Extended_Names (Enable : Boolean) return Boolean; -- AKA -- MANPAGE(`curs_trace.3x') -- ANCHOR(`_nc_freeall()',`Curses_Free_All') procedure Curses_Free_All; -- AKA -- MANPAGE(`curs_scr_dump.3x') -- ANCHOR(`scr_dump()',`Screen_Dump_To_File') procedure Screen_Dump_To_File (Filename : String); -- AKA -- ANCHOR(`scr_restore()',`Screen_Restore_From_File') procedure Screen_Restore_From_File (Filename : String); -- AKA -- ANCHOR(`scr_init()',`Screen_Init_From_File') procedure Screen_Init_From_File (Filename : String); -- AKA -- ANCHOR(`scr_set()',`Screen_Set_File') procedure Screen_Set_File (Filename : String); -- AKA -- MANPAGE(`curs_print.3x') -- Not implemented: mcprint -- MANPAGE(`curs_printw.3x') -- Not implemented: printw, wprintw, mvprintw, mvwprintw, vwprintw, -- vw_printw -- Please use the Ada style Text_IO child packages for formatted -- printing. It does not make a lot of sense to map the printf style -- C functions to Ada. -- MANPAGE(`curs_scanw.3x') -- Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw -- MANPAGE(`resizeterm.3x') -- Not Implemented: resizeterm -- MANPAGE(`wresize.3x') -- ANCHOR(`wresize()',`Resize') procedure Resize (Win : Window := Standard_Window; Number_Of_Lines : Line_Count; Number_Of_Columns : Column_Count); -- AKA private type Window is new System.Storage_Elements.Integer_Address; Null_Window : constant Window := 0; -- The next constants are generated and may be different on your -- architecture. -- Sizeof_Bool : constant := Curses_Constants.Sizeof_Bool; type Curses_Bool is mod 2 ** Sizeof_Bool; Curses_Bool_False : constant Curses_Bool := 0; end Terminal_Interface.Curses; AdaCurses-20170708/gen/terminal_interface-curses-aux.ads.m40000644000175100001440000001364712340207631022077 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses-aux__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Aux -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.23 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; with Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; package Terminal_Interface.Curses.Aux is pragma Preelaborate (Terminal_Interface.Curses.Aux); use type Interfaces.C.int; subtype C_Int is Interfaces.C.int; subtype C_Short is Interfaces.C.short; subtype C_Long_Int is Interfaces.C.long; subtype C_Size_T is Interfaces.C.size_t; subtype C_UInt is Interfaces.C.unsigned; subtype C_ULong is Interfaces.C.unsigned_long; subtype C_Char_Ptr is Interfaces.C.Strings.chars_ptr; type C_Void_Ptr is new System.Address; -- This is how those constants are defined in ncurses. I see them also -- exactly like this in all ETI implementations I ever tested. So it -- could be that this is quite general, but please check with your curses. -- This is critical, because curses sometime mixes Boolean returns with -- returning an error status. Curses_Ok : constant C_Int := Curses_Constants.OK; Curses_Err : constant C_Int := Curses_Constants.ERR; Curses_True : constant C_Int := Curses_Constants.TRUE; Curses_False : constant C_Int := Curses_Constants.FALSE; -- Eti_Error: type for error codes returned by the menu and form subsystem type Eti_Error is (E_Current, E_Invalid_Field, E_Request_Denied, E_Not_Connected, E_Not_Selectable, E_No_Match, E_Unknown_Command, E_Not_Posted, E_No_Room, E_Bad_State, E_Connected, E_Posted, E_Bad_Argument, E_System_Error, E_Ok); procedure Eti_Exception (Code : Eti_Error); -- Do nothing if Code = E_Ok. -- Else dispatch the error code and raise the appropriate exception. procedure Fill_String (Cp : chars_ptr; Str : out String); -- Fill the Str parameter with the string denoted by the chars_ptr -- C-Style string. function Fill_String (Cp : chars_ptr) return String; -- Same but as function. private for Eti_Error'Size use C_Int'Size; pragma Convention (C, Eti_Error); for Eti_Error use (E_Current => Curses_Constants.E_CURRENT, E_Invalid_Field => Curses_Constants.E_INVALID_FIELD, E_Request_Denied => Curses_Constants.E_REQUEST_DENIED, E_Not_Connected => Curses_Constants.E_NOT_CONNECTED, E_Not_Selectable => Curses_Constants.E_NOT_SELECTABLE, E_No_Match => Curses_Constants.E_NO_MATCH, E_Unknown_Command => Curses_Constants.E_UNKNOWN_COMMAND, E_Not_Posted => Curses_Constants.E_NOT_POSTED, E_No_Room => Curses_Constants.E_NO_ROOM, E_Bad_State => Curses_Constants.E_BAD_STATE, E_Connected => Curses_Constants.E_CONNECTED, E_Posted => Curses_Constants.E_POSTED, E_Bad_Argument => Curses_Constants.E_BAD_ARGUMENT, E_System_Error => Curses_Constants.E_SYSTEM_ERROR, E_Ok => Curses_Constants.E_OK); end Terminal_Interface.Curses.Aux; AdaCurses-20170708/gen/gen.c0000644000175100001440000004526612657723566014103 0ustar tomusers/**************************************************************************** * Copyright (c) 1998-2014,2016 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, 1996 * ****************************************************************************/ /* Version Control $Id: gen.c,v 1.70 2016/02/13 22:00:22 tom Exp $ --------------------------------------------------------------------------*/ /* This program prints on its standard output the source for the Terminal_Interface.Curses_Constants Ada package specification. This pure package only exports C constants to the Ada compiler. */ #ifdef HAVE_CONFIG_H #include #else #include #endif #include #include #include #include #undef UCHAR #undef UINT typedef unsigned char UCHAR; typedef unsigned int UINT; /* These global variables will be set by main () */ static int little_endian; static const char *my_program_invocation_name = NULL; static void my_error(const char *message) { fprintf(stderr, "%s: %s\n", my_program_invocation_name, message); exit(EXIT_FAILURE); } static void print_constant(const char *name, long value) { printf(" %-28s : constant := %ld;\n", name, value); } #define PRINT_NAMED_CONSTANT(name) \ print_constant (#name, name) static void print_comment(const char *message) { printf("\n -- %s\n\n", message); } /* * Make sure that KEY_MIN and KEY_MAX are defined. * main () will protest if KEY_MIN == 256 */ #ifndef KEY_MAX # define KEY_MAX 0777 #endif #ifndef KEY_MIN # define KEY_MIN 0401 #endif static UCHAR bit_is_set(const UCHAR * const data, const UINT offset) { const UCHAR byte = data[offset >> 3]; UINT bit; if (little_endian) bit = offset; /* offset */ else /* or */ bit = ~offset; /* 7 - offset */ bit &= 7; /* modulo 8 */ return (UCHAR) (byte & (1 << bit)); } /* Find lowest and highest used offset in a byte array. */ /* Returns 0 if and only if all bits are unset. */ static int find_pos(const UCHAR * const data, const UINT sizeof_data, UINT * const low, UINT * const high) { const UINT last = (sizeof_data << 3) - 1; UINT offset; for (offset = last; !bit_is_set(data, offset); offset--) if (!offset) /* All bits are 0. */ return 0; *high = offset; for (offset = 0; !bit_is_set(data, offset); offset++) { } *low = offset; return -1; } #define PRINT_BITMASK(c_type, ada_name, mask_macro) \ { \ UINT first, last; \ c_type mask = (mask_macro); \ if (!find_pos ((UCHAR *)&mask, sizeof (mask), &first, &last)) \ my_error ("failed to locate " ada_name); \ print_constant (ada_name "_First", first); \ print_constant (ada_name "_Last", last); \ } #define PRINT_NAMED_BITMASK(c_type, mask_macro) \ PRINT_BITMASK (c_type, #mask_macro, mask_macro) #define STRUCT_OFFSET(record, field) \ { \ UINT first, last; \ record mask; \ memset (&mask, 0, sizeof (mask)); \ memset (&mask.field, 0xff, sizeof(mask.field)); \ if (!find_pos ((UCHAR *)&mask, sizeof (mask), &first, &last)) \ my_error ("failed to locate" #record "_" #field); \ print_constant (#record "_" #field "_First", first); \ print_constant (#record "_" #field "_Last", last); \ } /*--------------------*/ /* Start of main (). */ /*--------------------*/ int main(int argc, const char *argv[]) { const int x = 0x12345678; little_endian = (*((const char *)&x) == 0x78); my_program_invocation_name = argv[0]; if (KEY_MIN == 256) my_error("unexpected value for KEY_MIN: 256"); if (argc != 2) my_error("Only one argument expected (DFT_ARG_SUFFIX)"); printf("-- Generated by the C program %s (source " __FILE__ ").\n", my_program_invocation_name); printf("-- Do not edit this file directly.\n"); printf("-- The values provided here may vary on your system.\n"); printf("\n"); printf("with System;\n"); printf("package Terminal_Interface.Curses_Constants is\n"); printf(" pragma Pure;\n"); printf("\n"); printf(" DFT_ARG_SUFFIX : constant String := \"%s\";\n", argv[1]); printf(" Bit_Order : constant System.Bit_Order := System.%s_Order_First;\n", little_endian ? "Low" : "High"); print_constant("Sizeof_Bool", 8 * sizeof(bool)); PRINT_NAMED_CONSTANT(OK); PRINT_NAMED_CONSTANT(ERR); printf(" pragma Warnings (Off); -- redefinition of Standard.True and False\n"); PRINT_NAMED_CONSTANT(TRUE); PRINT_NAMED_CONSTANT(FALSE); printf(" pragma Warnings (On);\n"); print_comment("Version of the ncurses library from extensions(3NCURSES)"); PRINT_NAMED_CONSTANT(NCURSES_VERSION_MAJOR); PRINT_NAMED_CONSTANT(NCURSES_VERSION_MINOR); printf(" Version : constant String := \"%d.%d\";\n", NCURSES_VERSION_MAJOR, NCURSES_VERSION_MINOR); print_comment("Character non-color attributes from attr(3NCURSES)"); printf(" -- attr_t and chtype may be signed in C.\n"); printf(" type attr_t is mod 2 ** %lu;\n", (long unsigned)(8 * sizeof(attr_t))); PRINT_NAMED_BITMASK(attr_t, A_CHARTEXT); PRINT_NAMED_BITMASK(attr_t, A_COLOR); PRINT_BITMASK(attr_t, "Attr", A_ATTRIBUTES & ~A_COLOR); PRINT_NAMED_BITMASK(attr_t, A_STANDOUT); PRINT_NAMED_BITMASK(attr_t, A_UNDERLINE); PRINT_NAMED_BITMASK(attr_t, A_REVERSE); PRINT_NAMED_BITMASK(attr_t, A_BLINK); PRINT_NAMED_BITMASK(attr_t, A_DIM); PRINT_NAMED_BITMASK(attr_t, A_BOLD); PRINT_NAMED_BITMASK(attr_t, A_PROTECT); PRINT_NAMED_BITMASK(attr_t, A_INVIS); PRINT_NAMED_BITMASK(attr_t, A_ALTCHARSET); PRINT_NAMED_BITMASK(attr_t, A_HORIZONTAL); PRINT_NAMED_BITMASK(attr_t, A_LEFT); PRINT_NAMED_BITMASK(attr_t, A_LOW); PRINT_NAMED_BITMASK(attr_t, A_RIGHT); PRINT_NAMED_BITMASK(attr_t, A_TOP); PRINT_NAMED_BITMASK(attr_t, A_VERTICAL); print_constant("chtype_Size", 8 * sizeof(chtype)); print_comment("predefined color numbers from color(3NCURSES)"); PRINT_NAMED_CONSTANT(COLOR_BLACK); PRINT_NAMED_CONSTANT(COLOR_RED); PRINT_NAMED_CONSTANT(COLOR_GREEN); PRINT_NAMED_CONSTANT(COLOR_YELLOW); PRINT_NAMED_CONSTANT(COLOR_BLUE); PRINT_NAMED_CONSTANT(COLOR_MAGENTA); PRINT_NAMED_CONSTANT(COLOR_CYAN); PRINT_NAMED_CONSTANT(COLOR_WHITE); print_comment("ETI return codes from ncurses.h"); PRINT_NAMED_CONSTANT(E_OK); PRINT_NAMED_CONSTANT(E_SYSTEM_ERROR); PRINT_NAMED_CONSTANT(E_BAD_ARGUMENT); PRINT_NAMED_CONSTANT(E_POSTED); PRINT_NAMED_CONSTANT(E_CONNECTED); PRINT_NAMED_CONSTANT(E_BAD_STATE); PRINT_NAMED_CONSTANT(E_NO_ROOM); PRINT_NAMED_CONSTANT(E_NOT_POSTED); PRINT_NAMED_CONSTANT(E_UNKNOWN_COMMAND); PRINT_NAMED_CONSTANT(E_NO_MATCH); PRINT_NAMED_CONSTANT(E_NOT_SELECTABLE); PRINT_NAMED_CONSTANT(E_NOT_CONNECTED); PRINT_NAMED_CONSTANT(E_REQUEST_DENIED); PRINT_NAMED_CONSTANT(E_INVALID_FIELD); PRINT_NAMED_CONSTANT(E_CURRENT); print_comment("Input key codes not defined in any ncurses manpage"); PRINT_NAMED_CONSTANT(KEY_MIN); PRINT_NAMED_CONSTANT(KEY_MAX); #ifdef KEY_CODE_YES PRINT_NAMED_CONSTANT(KEY_CODE_YES); #endif print_comment("Input key codes from getch(3NCURSES)"); PRINT_NAMED_CONSTANT(KEY_BREAK); PRINT_NAMED_CONSTANT(KEY_DOWN); PRINT_NAMED_CONSTANT(KEY_UP); PRINT_NAMED_CONSTANT(KEY_LEFT); PRINT_NAMED_CONSTANT(KEY_RIGHT); PRINT_NAMED_CONSTANT(KEY_HOME); PRINT_NAMED_CONSTANT(KEY_BACKSPACE); PRINT_NAMED_CONSTANT(KEY_F0); print_constant("KEY_F1", KEY_F(1)); print_constant("KEY_F2", KEY_F(2)); print_constant("KEY_F3", KEY_F(3)); print_constant("KEY_F4", KEY_F(4)); print_constant("KEY_F5", KEY_F(5)); print_constant("KEY_F6", KEY_F(6)); print_constant("KEY_F7", KEY_F(7)); print_constant("KEY_F8", KEY_F(8)); print_constant("KEY_F9", KEY_F(9)); print_constant("KEY_F10", KEY_F(10)); print_constant("KEY_F11", KEY_F(11)); print_constant("KEY_F12", KEY_F(12)); print_constant("KEY_F13", KEY_F(13)); print_constant("KEY_F14", KEY_F(14)); print_constant("KEY_F15", KEY_F(15)); print_constant("KEY_F16", KEY_F(16)); print_constant("KEY_F17", KEY_F(17)); print_constant("KEY_F18", KEY_F(18)); print_constant("KEY_F19", KEY_F(19)); print_constant("KEY_F20", KEY_F(20)); print_constant("KEY_F21", KEY_F(21)); print_constant("KEY_F22", KEY_F(22)); print_constant("KEY_F23", KEY_F(23)); print_constant("KEY_F24", KEY_F(24)); PRINT_NAMED_CONSTANT(KEY_DL); PRINT_NAMED_CONSTANT(KEY_IL); PRINT_NAMED_CONSTANT(KEY_DC); PRINT_NAMED_CONSTANT(KEY_IC); PRINT_NAMED_CONSTANT(KEY_EIC); PRINT_NAMED_CONSTANT(KEY_CLEAR); PRINT_NAMED_CONSTANT(KEY_EOS); PRINT_NAMED_CONSTANT(KEY_EOL); PRINT_NAMED_CONSTANT(KEY_SF); PRINT_NAMED_CONSTANT(KEY_SR); PRINT_NAMED_CONSTANT(KEY_NPAGE); PRINT_NAMED_CONSTANT(KEY_PPAGE); PRINT_NAMED_CONSTANT(KEY_STAB); PRINT_NAMED_CONSTANT(KEY_CTAB); PRINT_NAMED_CONSTANT(KEY_CATAB); PRINT_NAMED_CONSTANT(KEY_ENTER); PRINT_NAMED_CONSTANT(KEY_SRESET); PRINT_NAMED_CONSTANT(KEY_RESET); PRINT_NAMED_CONSTANT(KEY_PRINT); PRINT_NAMED_CONSTANT(KEY_LL); PRINT_NAMED_CONSTANT(KEY_A1); PRINT_NAMED_CONSTANT(KEY_A3); PRINT_NAMED_CONSTANT(KEY_B2); PRINT_NAMED_CONSTANT(KEY_C1); PRINT_NAMED_CONSTANT(KEY_C3); PRINT_NAMED_CONSTANT(KEY_BTAB); PRINT_NAMED_CONSTANT(KEY_BEG); PRINT_NAMED_CONSTANT(KEY_CANCEL); PRINT_NAMED_CONSTANT(KEY_CLOSE); PRINT_NAMED_CONSTANT(KEY_COMMAND); PRINT_NAMED_CONSTANT(KEY_COPY); PRINT_NAMED_CONSTANT(KEY_CREATE); PRINT_NAMED_CONSTANT(KEY_END); PRINT_NAMED_CONSTANT(KEY_EXIT); PRINT_NAMED_CONSTANT(KEY_FIND); PRINT_NAMED_CONSTANT(KEY_HELP); PRINT_NAMED_CONSTANT(KEY_MARK); PRINT_NAMED_CONSTANT(KEY_MESSAGE); PRINT_NAMED_CONSTANT(KEY_MOVE); PRINT_NAMED_CONSTANT(KEY_NEXT); PRINT_NAMED_CONSTANT(KEY_OPEN); PRINT_NAMED_CONSTANT(KEY_OPTIONS); PRINT_NAMED_CONSTANT(KEY_PREVIOUS); PRINT_NAMED_CONSTANT(KEY_REDO); PRINT_NAMED_CONSTANT(KEY_REFERENCE); PRINT_NAMED_CONSTANT(KEY_REFRESH); PRINT_NAMED_CONSTANT(KEY_REPLACE); PRINT_NAMED_CONSTANT(KEY_RESTART); PRINT_NAMED_CONSTANT(KEY_RESUME); PRINT_NAMED_CONSTANT(KEY_SAVE); PRINT_NAMED_CONSTANT(KEY_SBEG); PRINT_NAMED_CONSTANT(KEY_SCANCEL); PRINT_NAMED_CONSTANT(KEY_SCOMMAND); PRINT_NAMED_CONSTANT(KEY_SCOPY); PRINT_NAMED_CONSTANT(KEY_SCREATE); PRINT_NAMED_CONSTANT(KEY_SDC); PRINT_NAMED_CONSTANT(KEY_SDL); PRINT_NAMED_CONSTANT(KEY_SELECT); PRINT_NAMED_CONSTANT(KEY_SEND); PRINT_NAMED_CONSTANT(KEY_SEOL); PRINT_NAMED_CONSTANT(KEY_SEXIT); PRINT_NAMED_CONSTANT(KEY_SFIND); PRINT_NAMED_CONSTANT(KEY_SHELP); PRINT_NAMED_CONSTANT(KEY_SHOME); PRINT_NAMED_CONSTANT(KEY_SIC); PRINT_NAMED_CONSTANT(KEY_SLEFT); PRINT_NAMED_CONSTANT(KEY_SMESSAGE); PRINT_NAMED_CONSTANT(KEY_SMOVE); PRINT_NAMED_CONSTANT(KEY_SNEXT); PRINT_NAMED_CONSTANT(KEY_SOPTIONS); PRINT_NAMED_CONSTANT(KEY_SPREVIOUS); PRINT_NAMED_CONSTANT(KEY_SPRINT); PRINT_NAMED_CONSTANT(KEY_SREDO); PRINT_NAMED_CONSTANT(KEY_SREPLACE); PRINT_NAMED_CONSTANT(KEY_SRIGHT); PRINT_NAMED_CONSTANT(KEY_SRSUME); PRINT_NAMED_CONSTANT(KEY_SSAVE); PRINT_NAMED_CONSTANT(KEY_SSUSPEND); PRINT_NAMED_CONSTANT(KEY_SUNDO); PRINT_NAMED_CONSTANT(KEY_SUSPEND); PRINT_NAMED_CONSTANT(KEY_UNDO); PRINT_NAMED_CONSTANT(KEY_MOUSE); PRINT_NAMED_CONSTANT(KEY_RESIZE); print_comment("alternate character codes (ACS) from addch(3NCURSES)"); #define PRINT_ACS(name) print_constant (#name, &name - &acs_map[0]) PRINT_ACS(ACS_ULCORNER); PRINT_ACS(ACS_LLCORNER); PRINT_ACS(ACS_URCORNER); PRINT_ACS(ACS_LRCORNER); PRINT_ACS(ACS_LTEE); PRINT_ACS(ACS_RTEE); PRINT_ACS(ACS_BTEE); PRINT_ACS(ACS_TTEE); PRINT_ACS(ACS_HLINE); PRINT_ACS(ACS_VLINE); PRINT_ACS(ACS_PLUS); PRINT_ACS(ACS_S1); PRINT_ACS(ACS_S9); PRINT_ACS(ACS_DIAMOND); PRINT_ACS(ACS_CKBOARD); PRINT_ACS(ACS_DEGREE); PRINT_ACS(ACS_PLMINUS); PRINT_ACS(ACS_BULLET); PRINT_ACS(ACS_LARROW); PRINT_ACS(ACS_RARROW); PRINT_ACS(ACS_DARROW); PRINT_ACS(ACS_UARROW); PRINT_ACS(ACS_BOARD); PRINT_ACS(ACS_LANTERN); PRINT_ACS(ACS_BLOCK); PRINT_ACS(ACS_S3); PRINT_ACS(ACS_S7); PRINT_ACS(ACS_LEQUAL); PRINT_ACS(ACS_GEQUAL); PRINT_ACS(ACS_PI); PRINT_ACS(ACS_NEQUAL); PRINT_ACS(ACS_STERLING); print_comment("Menu_Options from opts(3MENU)"); PRINT_NAMED_BITMASK(Menu_Options, O_ONEVALUE); PRINT_NAMED_BITMASK(Menu_Options, O_SHOWDESC); PRINT_NAMED_BITMASK(Menu_Options, O_ROWMAJOR); PRINT_NAMED_BITMASK(Menu_Options, O_IGNORECASE); PRINT_NAMED_BITMASK(Menu_Options, O_SHOWMATCH); PRINT_NAMED_BITMASK(Menu_Options, O_NONCYCLIC); print_constant("Menu_Options_Size", 8 * sizeof(Menu_Options)); print_comment("Item_Options from menu_opts(3MENU)"); PRINT_NAMED_BITMASK(Item_Options, O_SELECTABLE); print_constant("Item_Options_Size", 8 * sizeof(Item_Options)); print_comment("Field_Options from field_opts(3FORM)"); PRINT_NAMED_BITMASK(Field_Options, O_VISIBLE); PRINT_NAMED_BITMASK(Field_Options, O_ACTIVE); PRINT_NAMED_BITMASK(Field_Options, O_PUBLIC); PRINT_NAMED_BITMASK(Field_Options, O_EDIT); PRINT_NAMED_BITMASK(Field_Options, O_WRAP); PRINT_NAMED_BITMASK(Field_Options, O_BLANK); PRINT_NAMED_BITMASK(Field_Options, O_AUTOSKIP); PRINT_NAMED_BITMASK(Field_Options, O_NULLOK); PRINT_NAMED_BITMASK(Field_Options, O_PASSOK); PRINT_NAMED_BITMASK(Field_Options, O_STATIC); print_constant("Field_Options_Size", 8 * sizeof(Field_Options)); print_comment("Field_Options from opts(3FORM)"); PRINT_NAMED_BITMASK(Field_Options, O_NL_OVERLOAD); PRINT_NAMED_BITMASK(Field_Options, O_BS_OVERLOAD); /* Field_Options_Size is defined below */ print_comment("MEVENT structure from mouse(3NCURSES)"); STRUCT_OFFSET(MEVENT, id); STRUCT_OFFSET(MEVENT, x); STRUCT_OFFSET(MEVENT, y); STRUCT_OFFSET(MEVENT, z); STRUCT_OFFSET(MEVENT, bstate); print_constant("MEVENT_Size", 8 * sizeof(MEVENT)); print_comment("mouse events from mouse(3NCURSES)"); { mmask_t all_events; #define PRINT_MOUSE_EVENT(event) \ print_constant (#event, event); \ all_events |= event all_events = 0; PRINT_MOUSE_EVENT(BUTTON1_RELEASED); PRINT_MOUSE_EVENT(BUTTON1_PRESSED); PRINT_MOUSE_EVENT(BUTTON1_CLICKED); PRINT_MOUSE_EVENT(BUTTON1_DOUBLE_CLICKED); PRINT_MOUSE_EVENT(BUTTON1_TRIPLE_CLICKED); #ifdef BUTTON1_RESERVED_EVENT PRINT_MOUSE_EVENT(BUTTON1_RESERVED_EVENT); #endif print_constant("all_events_button_1", (long)all_events); all_events = 0; PRINT_MOUSE_EVENT(BUTTON2_RELEASED); PRINT_MOUSE_EVENT(BUTTON2_PRESSED); PRINT_MOUSE_EVENT(BUTTON2_CLICKED); PRINT_MOUSE_EVENT(BUTTON2_DOUBLE_CLICKED); PRINT_MOUSE_EVENT(BUTTON2_TRIPLE_CLICKED); #ifdef BUTTON2_RESERVED_EVENT PRINT_MOUSE_EVENT(BUTTON2_RESERVED_EVENT); #endif print_constant("all_events_button_2", (long)all_events); all_events = 0; PRINT_MOUSE_EVENT(BUTTON3_RELEASED); PRINT_MOUSE_EVENT(BUTTON3_PRESSED); PRINT_MOUSE_EVENT(BUTTON3_CLICKED); PRINT_MOUSE_EVENT(BUTTON3_DOUBLE_CLICKED); PRINT_MOUSE_EVENT(BUTTON3_TRIPLE_CLICKED); #ifdef BUTTON3_RESERVED_EVENT PRINT_MOUSE_EVENT(BUTTON3_RESERVED_EVENT); #endif print_constant("all_events_button_3", (long)all_events); all_events = 0; PRINT_MOUSE_EVENT(BUTTON4_RELEASED); PRINT_MOUSE_EVENT(BUTTON4_PRESSED); PRINT_MOUSE_EVENT(BUTTON4_CLICKED); PRINT_MOUSE_EVENT(BUTTON4_DOUBLE_CLICKED); PRINT_MOUSE_EVENT(BUTTON4_TRIPLE_CLICKED); #ifdef BUTTON4_RESERVED_EVENT PRINT_MOUSE_EVENT(BUTTON4_RESERVED_EVENT); #endif print_constant("all_events_button_4", (long)all_events); } PRINT_NAMED_CONSTANT(BUTTON_CTRL); PRINT_NAMED_CONSTANT(BUTTON_SHIFT); PRINT_NAMED_CONSTANT(BUTTON_ALT); PRINT_NAMED_CONSTANT(REPORT_MOUSE_POSITION); PRINT_NAMED_CONSTANT(ALL_MOUSE_EVENTS); print_comment("trace selection from trace(3NCURSES)"); PRINT_NAMED_BITMASK(UINT, TRACE_TIMES); PRINT_NAMED_BITMASK(UINT, TRACE_TPUTS); PRINT_NAMED_BITMASK(UINT, TRACE_UPDATE); PRINT_NAMED_BITMASK(UINT, TRACE_MOVE); PRINT_NAMED_BITMASK(UINT, TRACE_CHARPUT); PRINT_NAMED_BITMASK(UINT, TRACE_CALLS); PRINT_NAMED_BITMASK(UINT, TRACE_VIRTPUT); PRINT_NAMED_BITMASK(UINT, TRACE_IEVENT); PRINT_NAMED_BITMASK(UINT, TRACE_BITS); PRINT_NAMED_BITMASK(UINT, TRACE_ICALLS); PRINT_NAMED_BITMASK(UINT, TRACE_CCALLS); PRINT_NAMED_BITMASK(UINT, TRACE_DATABASE); PRINT_NAMED_BITMASK(UINT, TRACE_ATTRS); print_constant("Trace_Size", 8 * sizeof(UINT)); printf("end Terminal_Interface.Curses_Constants;\n"); exit(EXIT_SUCCESS); } AdaCurses-20170708/gen/html.m40000644000175100001440000000522710666376377014367 0ustar tomusersdnl*************************************************************************** dnl Copyright (c) 2000-2006,2007 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * dnl "Software"), to deal in the Software without restriction, including * dnl without limitation the rights to use, copy, modify, merge, publish, * dnl distribute, distribute with modifications, sublicense, and/or sell * dnl copies of the Software, and to permit persons to whom the Software is * dnl furnished to do so, subject to the following conditions: * dnl * dnl The above copyright notice and this permission notice shall be included * dnl in all copies or substantial portions of the Software. * dnl * dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * dnl * dnl Except as contained in this notice, the name(s) of the above copyright * dnl holders shall not be used in advertising or otherwise to promote the * dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl dnl $Id: html.m4,v 1.3 2007/09/01 23:59:59 tom Exp $ define(`ANCHORIDX',`0')dnl define(`MANPAGE',`define(`MANPG',$1)dnl |===================================================================== -- | Man page MANPG -- |=====================================================================')dnl define(`ANCHOR',`define(`ANCHORIDX',incr(ANCHORIDX))dnl `#'1A NAME="AFU`_'ANCHORIDX"`#'2dnl define(`CFUNAME',`$1')define(`AFUNAME',`$2')dnl |')dnl define(`AKA',``AKA': CFUNAME')dnl define(`ALIAS',``AKA': $1')dnl AdaCurses-20170708/gen/terminal_interface-curses-forms.ads.m40000644000175100001440000007175712340207715022441 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses-forms__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Form -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2014 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, 1996 -- Version Control: -- $Revision: 1.33 $ -- $Date: 2014/05/24 21:31:57 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; with Ada.Characters.Latin_1; package Terminal_Interface.Curses.Forms is pragma Preelaborate (Terminal_Interface.Curses.Forms); pragma Linker_Options ("-lform" & Curses_Constants.DFT_ARG_SUFFIX); Space : Character renames Ada.Characters.Latin_1.Space; type Field is private; type Form is private; Null_Field : constant Field; Null_Form : constant Form; type Field_Justification is (None, Left, Center, Right); type Field_Option_Set is record Visible : Boolean; Active : Boolean; Public : Boolean; Edit : Boolean; Wrap : Boolean; Blank : Boolean; Auto_Skip : Boolean; Null_Ok : Boolean; Pass_Ok : Boolean; Static : Boolean; end record; pragma Convention (C_Pass_By_Copy, Field_Option_Set); for Field_Option_Set use record Visible at 0 range Curses_Constants.O_VISIBLE_First .. Curses_Constants.O_VISIBLE_Last; Active at 0 range Curses_Constants.O_ACTIVE_First .. Curses_Constants.O_ACTIVE_Last; Public at 0 range Curses_Constants.O_PUBLIC_First .. Curses_Constants.O_PUBLIC_Last; Edit at 0 range Curses_Constants.O_EDIT_First .. Curses_Constants.O_EDIT_Last; Wrap at 0 range Curses_Constants.O_WRAP_First .. Curses_Constants.O_WRAP_Last; Blank at 0 range Curses_Constants.O_BLANK_First .. Curses_Constants.O_BLANK_Last; Auto_Skip at 0 range Curses_Constants.O_AUTOSKIP_First .. Curses_Constants.O_AUTOSKIP_Last; Null_Ok at 0 range Curses_Constants.O_NULLOK_First .. Curses_Constants.O_NULLOK_Last; Pass_Ok at 0 range Curses_Constants.O_PASSOK_First .. Curses_Constants.O_PASSOK_Last; Static at 0 range Curses_Constants.O_STATIC_First .. Curses_Constants.O_STATIC_Last; end record; pragma Warnings (Off); for Field_Option_Set'Size use Curses_Constants.Field_Options_Size; pragma Warnings (On); function Default_Field_Options return Field_Option_Set; -- The initial defaults for the field options. pragma Inline (Default_Field_Options); type Form_Option_Set is record NL_Overload : Boolean; BS_Overload : Boolean; end record; pragma Convention (C_Pass_By_Copy, Form_Option_Set); for Form_Option_Set use record NL_Overload at 0 range Curses_Constants.O_NL_OVERLOAD_First .. Curses_Constants.O_NL_OVERLOAD_Last; BS_Overload at 0 range Curses_Constants.O_BS_OVERLOAD_First .. Curses_Constants.O_BS_OVERLOAD_Last; end record; pragma Warnings (Off); for Form_Option_Set'Size use Curses_Constants.Field_Options_Size; pragma Warnings (On); function Default_Form_Options return Form_Option_Set; -- The initial defaults for the form options. pragma Inline (Default_Form_Options); type Buffer_Number is new Natural; type Field_Array is array (Positive range <>) of aliased Field; pragma Convention (C, Field_Array); type Field_Array_Access is access Field_Array; procedure Free (FA : in out Field_Array_Access; Free_Fields : Boolean := False); -- Release the memory for an allocated field array -- If Free_Fields is True, call Delete() for all the fields in -- the array. subtype Form_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 57); -- The prefix F_ stands for "Form Request" F_Next_Page : constant Form_Request_Code := Key_Max + 1; F_Previous_Page : constant Form_Request_Code := Key_Max + 2; F_First_Page : constant Form_Request_Code := Key_Max + 3; F_Last_Page : constant Form_Request_Code := Key_Max + 4; F_Next_Field : constant Form_Request_Code := Key_Max + 5; F_Previous_Field : constant Form_Request_Code := Key_Max + 6; F_First_Field : constant Form_Request_Code := Key_Max + 7; F_Last_Field : constant Form_Request_Code := Key_Max + 8; F_Sorted_Next_Field : constant Form_Request_Code := Key_Max + 9; F_Sorted_Previous_Field : constant Form_Request_Code := Key_Max + 10; F_Sorted_First_Field : constant Form_Request_Code := Key_Max + 11; F_Sorted_Last_Field : constant Form_Request_Code := Key_Max + 12; F_Left_Field : constant Form_Request_Code := Key_Max + 13; F_Right_Field : constant Form_Request_Code := Key_Max + 14; F_Up_Field : constant Form_Request_Code := Key_Max + 15; F_Down_Field : constant Form_Request_Code := Key_Max + 16; F_Next_Char : constant Form_Request_Code := Key_Max + 17; F_Previous_Char : constant Form_Request_Code := Key_Max + 18; F_Next_Line : constant Form_Request_Code := Key_Max + 19; F_Previous_Line : constant Form_Request_Code := Key_Max + 20; F_Next_Word : constant Form_Request_Code := Key_Max + 21; F_Previous_Word : constant Form_Request_Code := Key_Max + 22; F_Begin_Field : constant Form_Request_Code := Key_Max + 23; F_End_Field : constant Form_Request_Code := Key_Max + 24; F_Begin_Line : constant Form_Request_Code := Key_Max + 25; F_End_Line : constant Form_Request_Code := Key_Max + 26; F_Left_Char : constant Form_Request_Code := Key_Max + 27; F_Right_Char : constant Form_Request_Code := Key_Max + 28; F_Up_Char : constant Form_Request_Code := Key_Max + 29; F_Down_Char : constant Form_Request_Code := Key_Max + 30; F_New_Line : constant Form_Request_Code := Key_Max + 31; F_Insert_Char : constant Form_Request_Code := Key_Max + 32; F_Insert_Line : constant Form_Request_Code := Key_Max + 33; F_Delete_Char : constant Form_Request_Code := Key_Max + 34; F_Delete_Previous : constant Form_Request_Code := Key_Max + 35; F_Delete_Line : constant Form_Request_Code := Key_Max + 36; F_Delete_Word : constant Form_Request_Code := Key_Max + 37; F_Clear_EOL : constant Form_Request_Code := Key_Max + 38; F_Clear_EOF : constant Form_Request_Code := Key_Max + 39; F_Clear_Field : constant Form_Request_Code := Key_Max + 40; F_Overlay_Mode : constant Form_Request_Code := Key_Max + 41; F_Insert_Mode : constant Form_Request_Code := Key_Max + 42; -- Vertical Scrolling F_ScrollForward_Line : constant Form_Request_Code := Key_Max + 43; F_ScrollBackward_Line : constant Form_Request_Code := Key_Max + 44; F_ScrollForward_Page : constant Form_Request_Code := Key_Max + 45; F_ScrollBackward_Page : constant Form_Request_Code := Key_Max + 46; F_ScrollForward_HalfPage : constant Form_Request_Code := Key_Max + 47; F_ScrollBackward_HalfPage : constant Form_Request_Code := Key_Max + 48; -- Horizontal Scrolling F_HScrollForward_Char : constant Form_Request_Code := Key_Max + 49; F_HScrollBackward_Char : constant Form_Request_Code := Key_Max + 50; F_HScrollForward_Line : constant Form_Request_Code := Key_Max + 51; F_HScrollBackward_Line : constant Form_Request_Code := Key_Max + 52; F_HScrollForward_HalfLine : constant Form_Request_Code := Key_Max + 53; F_HScrollBackward_HalfLine : constant Form_Request_Code := Key_Max + 54; F_Validate_Field : constant Form_Request_Code := Key_Max + 55; F_Next_Choice : constant Form_Request_Code := Key_Max + 56; F_Previous_Choice : constant Form_Request_Code := Key_Max + 57; -- For those who like the old 'C' style request names REQ_NEXT_PAGE : Form_Request_Code renames F_Next_Page; REQ_PREV_PAGE : Form_Request_Code renames F_Previous_Page; REQ_FIRST_PAGE : Form_Request_Code renames F_First_Page; REQ_LAST_PAGE : Form_Request_Code renames F_Last_Page; REQ_NEXT_FIELD : Form_Request_Code renames F_Next_Field; REQ_PREV_FIELD : Form_Request_Code renames F_Previous_Field; REQ_FIRST_FIELD : Form_Request_Code renames F_First_Field; REQ_LAST_FIELD : Form_Request_Code renames F_Last_Field; REQ_SNEXT_FIELD : Form_Request_Code renames F_Sorted_Next_Field; REQ_SPREV_FIELD : Form_Request_Code renames F_Sorted_Previous_Field; REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field; REQ_SLAST_FIELD : Form_Request_Code renames F_Sorted_Last_Field; REQ_LEFT_FIELD : Form_Request_Code renames F_Left_Field; REQ_RIGHT_FIELD : Form_Request_Code renames F_Right_Field; REQ_UP_FIELD : Form_Request_Code renames F_Up_Field; REQ_DOWN_FIELD : Form_Request_Code renames F_Down_Field; REQ_NEXT_CHAR : Form_Request_Code renames F_Next_Char; REQ_PREV_CHAR : Form_Request_Code renames F_Previous_Char; REQ_NEXT_LINE : Form_Request_Code renames F_Next_Line; REQ_PREV_LINE : Form_Request_Code renames F_Previous_Line; REQ_NEXT_WORD : Form_Request_Code renames F_Next_Word; REQ_PREV_WORD : Form_Request_Code renames F_Previous_Word; REQ_BEG_FIELD : Form_Request_Code renames F_Begin_Field; REQ_END_FIELD : Form_Request_Code renames F_End_Field; REQ_BEG_LINE : Form_Request_Code renames F_Begin_Line; REQ_END_LINE : Form_Request_Code renames F_End_Line; REQ_LEFT_CHAR : Form_Request_Code renames F_Left_Char; REQ_RIGHT_CHAR : Form_Request_Code renames F_Right_Char; REQ_UP_CHAR : Form_Request_Code renames F_Up_Char; REQ_DOWN_CHAR : Form_Request_Code renames F_Down_Char; REQ_NEW_LINE : Form_Request_Code renames F_New_Line; REQ_INS_CHAR : Form_Request_Code renames F_Insert_Char; REQ_INS_LINE : Form_Request_Code renames F_Insert_Line; REQ_DEL_CHAR : Form_Request_Code renames F_Delete_Char; REQ_DEL_PREV : Form_Request_Code renames F_Delete_Previous; REQ_DEL_LINE : Form_Request_Code renames F_Delete_Line; REQ_DEL_WORD : Form_Request_Code renames F_Delete_Word; REQ_CLR_EOL : Form_Request_Code renames F_Clear_EOL; REQ_CLR_EOF : Form_Request_Code renames F_Clear_EOF; REQ_CLR_FIELD : Form_Request_Code renames F_Clear_Field; REQ_OVL_MODE : Form_Request_Code renames F_Overlay_Mode; REQ_INS_MODE : Form_Request_Code renames F_Insert_Mode; REQ_SCR_FLINE : Form_Request_Code renames F_ScrollForward_Line; REQ_SCR_BLINE : Form_Request_Code renames F_ScrollBackward_Line; REQ_SCR_FPAGE : Form_Request_Code renames F_ScrollForward_Page; REQ_SCR_BPAGE : Form_Request_Code renames F_ScrollBackward_Page; REQ_SCR_FHPAGE : Form_Request_Code renames F_ScrollForward_HalfPage; REQ_SCR_BHPAGE : Form_Request_Code renames F_ScrollBackward_HalfPage; REQ_SCR_FCHAR : Form_Request_Code renames F_HScrollForward_Char; REQ_SCR_BCHAR : Form_Request_Code renames F_HScrollBackward_Char; REQ_SCR_HFLINE : Form_Request_Code renames F_HScrollForward_Line; REQ_SCR_HBLINE : Form_Request_Code renames F_HScrollBackward_Line; REQ_SCR_HFHALF : Form_Request_Code renames F_HScrollForward_HalfLine; REQ_SCR_HBHALF : Form_Request_Code renames F_HScrollBackward_HalfLine; REQ_VALIDATION : Form_Request_Code renames F_Validate_Field; REQ_NEXT_CHOICE : Form_Request_Code renames F_Next_Choice; REQ_PREV_CHOICE : Form_Request_Code renames F_Previous_Choice; procedure Request_Name (Key : Form_Request_Code; Name : out String); function Request_Name (Key : Form_Request_Code) return String; -- Same as function pragma Inline (Request_Name); ------------------ -- Exceptions -- ------------------ Form_Exception : exception; -- MANPAGE(`form_field_new.3x') -- ANCHOR(`new_field()',`Create') function Create (Height : Line_Count; Width : Column_Count; Top : Line_Position; Left : Column_Position; Off_Screen : Natural := 0; More_Buffers : Buffer_Number := Buffer_Number'First) return Field; -- AKA -- An overloaded Create is defined later. Pragma Inline appears there. -- ANCHOR(`new_field()',`New_Field') function New_Field (Height : Line_Count; Width : Column_Count; Top : Line_Position; Left : Column_Position; Off_Screen : Natural := 0; More_Buffers : Buffer_Number := Buffer_Number'First) return Field renames Create; -- AKA pragma Inline (New_Field); -- ANCHOR(`free_field()',`Delete') procedure Delete (Fld : in out Field); -- AKA -- Reset Fld to Null_Field -- An overloaded Delete is defined later. Pragma Inline appears there. -- ANCHOR(`dup_field()',`Duplicate') function Duplicate (Fld : Field; Top : Line_Position; Left : Column_Position) return Field; -- AKA pragma Inline (Duplicate); -- ANCHOR(`link_field()',`Link') function Link (Fld : Field; Top : Line_Position; Left : Column_Position) return Field; -- AKA pragma Inline (Link); -- MANPAGE(`form_field_just.3x') -- ANCHOR(`set_field_just()',`Set_Justification') procedure Set_Justification (Fld : Field; Just : Field_Justification := None); -- AKA pragma Inline (Set_Justification); -- ANCHOR(`field_just()',`Get_Justification') function Get_Justification (Fld : Field) return Field_Justification; -- AKA pragma Inline (Get_Justification); -- MANPAGE(`form_field_buffer.3x') -- ANCHOR(`set_field_buffer()',`Set_Buffer') procedure Set_Buffer (Fld : Field; Buffer : Buffer_Number := Buffer_Number'First; Str : String); -- AKA -- Not inlined -- ANCHOR(`field_buffer()',`Get_Buffer') procedure Get_Buffer (Fld : Field; Buffer : Buffer_Number := Buffer_Number'First; Str : out String); -- AKA function Get_Buffer (Fld : Field; Buffer : Buffer_Number := Buffer_Number'First) return String; -- AKA -- Same but as function pragma Inline (Get_Buffer); -- ANCHOR(`set_field_status()',`Set_Status') procedure Set_Status (Fld : Field; Status : Boolean := True); -- AKA pragma Inline (Set_Status); -- ANCHOR(`field_status()',`Changed') function Changed (Fld : Field) return Boolean; -- AKA pragma Inline (Changed); -- ANCHOR(`set_field_max()',`Set_Maximum_Size') procedure Set_Maximum_Size (Fld : Field; Max : Natural := 0); -- AKA pragma Inline (Set_Maximum_Size); -- MANPAGE(`form_field_opts.3x') -- ANCHOR(`set_field_opts()',`Set_Options') procedure Set_Options (Fld : Field; Options : Field_Option_Set); -- AKA -- An overloaded version is defined later. Pragma Inline appears there -- ANCHOR(`field_opts_on()',`Switch_Options') procedure Switch_Options (Fld : Field; Options : Field_Option_Set; On : Boolean := True); -- AKA -- ALIAS(`field_opts_off()') -- An overloaded version is defined later. Pragma Inline appears there -- ANCHOR(`field_opts()',`Get_Options') procedure Get_Options (Fld : Field; Options : out Field_Option_Set); -- AKA -- ANCHOR(`field_opts()',`Get_Options') function Get_Options (Fld : Field := Null_Field) return Field_Option_Set; -- AKA -- An overloaded version is defined later. Pragma Inline appears there -- MANPAGE(`form_field_attributes.3x') -- ANCHOR(`set_field_fore()',`Set_Foreground') procedure Set_Foreground (Fld : Field; Fore : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First); -- AKA pragma Inline (Set_Foreground); -- ANCHOR(`field_fore()',`Foreground') procedure Foreground (Fld : Field; Fore : out Character_Attribute_Set); -- AKA -- ANCHOR(`field_fore()',`Foreground') procedure Foreground (Fld : Field; Fore : out Character_Attribute_Set; Color : out Color_Pair); -- AKA pragma Inline (Foreground); -- ANCHOR(`set_field_back()',`Set_Background') procedure Set_Background (Fld : Field; Back : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First); -- AKA pragma Inline (Set_Background); -- ANCHOR(`field_back()',`Background') procedure Background (Fld : Field; Back : out Character_Attribute_Set); -- AKA -- ANCHOR(`field_back()',`Background') procedure Background (Fld : Field; Back : out Character_Attribute_Set; Color : out Color_Pair); -- AKA pragma Inline (Background); -- ANCHOR(`set_field_pad()',`Set_Pad_Character') procedure Set_Pad_Character (Fld : Field; Pad : Character := Space); -- AKA pragma Inline (Set_Pad_Character); -- ANCHOR(`field_pad()',`Pad_Character') procedure Pad_Character (Fld : Field; Pad : out Character); -- AKA pragma Inline (Pad_Character); -- MANPAGE(`form_field_info.3x') -- ANCHOR(`field_info()',`Info') procedure Info (Fld : Field; Lines : out Line_Count; Columns : out Column_Count; First_Row : out Line_Position; First_Column : out Column_Position; Off_Screen : out Natural; Additional_Buffers : out Buffer_Number); -- AKA pragma Inline (Info); -- ANCHOR(`dynamic_field_info()',`Dynamic_Info') procedure Dynamic_Info (Fld : Field; Lines : out Line_Count; Columns : out Column_Count; Max : out Natural); -- AKA pragma Inline (Dynamic_Info); -- MANPAGE(`form_win.3x') -- ANCHOR(`set_form_win()',`Set_Window') procedure Set_Window (Frm : Form; Win : Window); -- AKA pragma Inline (Set_Window); -- ANCHOR(`form_win()',`Get_Window') function Get_Window (Frm : Form) return Window; -- AKA pragma Inline (Get_Window); -- ANCHOR(`set_form_sub()',`Set_Sub_Window') procedure Set_Sub_Window (Frm : Form; Win : Window); -- AKA pragma Inline (Set_Sub_Window); -- ANCHOR(`form_sub()',`Get_Sub_Window') function Get_Sub_Window (Frm : Form) return Window; -- AKA pragma Inline (Get_Sub_Window); -- ANCHOR(`scale_form()',`Scale') procedure Scale (Frm : Form; Lines : out Line_Count; Columns : out Column_Count); -- AKA pragma Inline (Scale); -- MANPAGE(`form_hook.3x') type Form_Hook_Function is access procedure (Frm : Form); pragma Convention (C, Form_Hook_Function); -- ANCHOR(`set_field_init()',`Set_Field_Init_Hook') procedure Set_Field_Init_Hook (Frm : Form; Proc : Form_Hook_Function); -- AKA pragma Inline (Set_Field_Init_Hook); -- ANCHOR(`set_field_term()',`Set_Field_Term_Hook') procedure Set_Field_Term_Hook (Frm : Form; Proc : Form_Hook_Function); -- AKA pragma Inline (Set_Field_Term_Hook); -- ANCHOR(`set_form_init()',`Set_Form_Init_Hook') procedure Set_Form_Init_Hook (Frm : Form; Proc : Form_Hook_Function); -- AKA pragma Inline (Set_Form_Init_Hook); -- ANCHOR(`set_form_term()',`Set_Form_Term_Hook') procedure Set_Form_Term_Hook (Frm : Form; Proc : Form_Hook_Function); -- AKA pragma Inline (Set_Form_Term_Hook); -- ANCHOR(`field_init()',`Get_Field_Init_Hook') function Get_Field_Init_Hook (Frm : Form) return Form_Hook_Function; -- AKA pragma Import (C, Get_Field_Init_Hook, "field_init"); -- ANCHOR(`field_term()',`Get_Field_Term_Hook') function Get_Field_Term_Hook (Frm : Form) return Form_Hook_Function; -- AKA pragma Import (C, Get_Field_Term_Hook, "field_term"); -- ANCHOR(`form_init()',`Get_Form_Init_Hook') function Get_Form_Init_Hook (Frm : Form) return Form_Hook_Function; -- AKA pragma Import (C, Get_Form_Init_Hook, "form_init"); -- ANCHOR(`form_term()',`Get_Form_Term_Hook') function Get_Form_Term_Hook (Frm : Form) return Form_Hook_Function; -- AKA pragma Import (C, Get_Form_Term_Hook, "form_term"); -- MANPAGE(`form_field.3x') -- ANCHOR(`set_form_fields()',`Redefine') procedure Redefine (Frm : Form; Flds : Field_Array_Access); -- AKA pragma Inline (Redefine); -- ANCHOR(`set_form_fields()',`Set_Fields') procedure Set_Fields (Frm : Form; Flds : Field_Array_Access) renames Redefine; -- AKA -- pragma Inline (Set_Fields); -- ANCHOR(`form_fields()',`Fields') function Fields (Frm : Form; Index : Positive) return Field; -- AKA pragma Inline (Fields); -- ANCHOR(`field_count()',`Field_Count') function Field_Count (Frm : Form) return Natural; -- AKA pragma Inline (Field_Count); -- ANCHOR(`move_field()',`Move') procedure Move (Fld : Field; Line : Line_Position; Column : Column_Position); -- AKA pragma Inline (Move); -- MANPAGE(`form_new.3x') -- ANCHOR(`new_form()',`Create') function Create (Fields : Field_Array_Access) return Form; -- AKA pragma Inline (Create); -- ANCHOR(`new_form()',`New_Form') function New_Form (Fields : Field_Array_Access) return Form renames Create; -- AKA -- pragma Inline (New_Form); -- ANCHOR(`free_form()',`Delete') procedure Delete (Frm : in out Form); -- AKA -- Reset Frm to Null_Form pragma Inline (Delete); -- MANPAGE(`form_opts.3x') -- ANCHOR(`set_form_opts()',`Set_Options') procedure Set_Options (Frm : Form; Options : Form_Option_Set); -- AKA pragma Inline (Set_Options); -- ANCHOR(`form_opts_on()',`Switch_Options') procedure Switch_Options (Frm : Form; Options : Form_Option_Set; On : Boolean := True); -- AKA -- ALIAS(`form_opts_off()') pragma Inline (Switch_Options); -- ANCHOR(`form_opts()',`Get_Options') procedure Get_Options (Frm : Form; Options : out Form_Option_Set); -- AKA -- ANCHOR(`form_opts()',`Get_Options') function Get_Options (Frm : Form := Null_Form) return Form_Option_Set; -- AKA pragma Inline (Get_Options); -- MANPAGE(`form_post.3x') -- ANCHOR(`post_form()',`Post') procedure Post (Frm : Form; Post : Boolean := True); -- AKA -- ALIAS(`unpost_form()') pragma Inline (Post); -- MANPAGE(`form_cursor.3x') -- ANCHOR(`pos_form_cursor()',`Position_Cursor') procedure Position_Cursor (Frm : Form); -- AKA pragma Inline (Position_Cursor); -- MANPAGE(`form_data.3x') -- ANCHOR(`data_ahead()',`Data_Ahead') function Data_Ahead (Frm : Form) return Boolean; -- AKA pragma Inline (Data_Ahead); -- ANCHOR(`data_behind()',`Data_Behind') function Data_Behind (Frm : Form) return Boolean; -- AKA pragma Inline (Data_Behind); -- MANPAGE(`form_driver.3x') type Driver_Result is (Form_Ok, Request_Denied, Unknown_Request, Invalid_Field); -- ANCHOR(`form_driver()',`Driver') function Driver (Frm : Form; Key : Key_Code) return Driver_Result; -- AKA -- Driver not inlined -- MANPAGE(`form_page.3x') type Page_Number is new Natural; -- ANCHOR(`set_current_field()',`Set_Current') procedure Set_Current (Frm : Form; Fld : Field); -- AKA pragma Inline (Set_Current); -- ANCHOR(`current_field()',`Current') function Current (Frm : Form) return Field; -- AKA pragma Inline (Current); -- ANCHOR(`set_form_page()',`Set_Page') procedure Set_Page (Frm : Form; Page : Page_Number := Page_Number'First); -- AKA pragma Inline (Set_Page); -- ANCHOR(`form_page()',`Page') function Page (Frm : Form) return Page_Number; -- AKA pragma Inline (Page); -- ANCHOR(`field_index()',`Get_Index') function Get_Index (Fld : Field) return Positive; -- AKA -- Please note that in this binding we start the numbering of fields -- with 1. So this is number is one more than you get from the low -- level call. pragma Inline (Get_Index); -- MANPAGE(`form_new_page.3x') -- ANCHOR(`set_new_page()',`Set_New_Page') procedure Set_New_Page (Fld : Field; New_Page : Boolean := True); -- AKA pragma Inline (Set_New_Page); -- ANCHOR(`new_page()',`Is_New_Page') function Is_New_Page (Fld : Field) return Boolean; -- AKA pragma Inline (Is_New_Page); -- MANPAGE(`form_requestname.3x') -- Not Implemented: form_request_name, form_request_by_name ------------------------------------------------------------------------------ private type Field is new System.Storage_Elements.Integer_Address; type Form is new System.Storage_Elements.Integer_Address; Null_Field : constant Field := 0; Null_Form : constant Form := 0; end Terminal_Interface.Curses.Forms; AdaCurses-20170708/gen/adacurses-config.in0000644000175100001440000000640213007442643016700 0ustar tomusers#! /bin/sh # $Id: adacurses-config.in,v 1.11 2016/11/05 20:48:35 tom Exp $ ############################################################################## # Copyright (c) 2007-2012,2016 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. # ############################################################################## # # This script returns the options to add to `gnatmake' for using AdaCurses. DESTDIR=@DESTDIR@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ ADA_INCLUDE=@ADA_INCLUDE@ ADA_OBJECTS=@ADA_OBJECTS@ VERSION=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@ CFLAGS="-aI$ADA_INCLUDE -aO$ADA_OBJECTS" LIBS="-L$ADA_OBJECTS -lAdaCurses" THIS="adacurses" THIS_CFG="$THIS@DFT_ARG_SUFFIX@-config" case "x$1" in x--version) echo AdaCurses $VERSION ;; x--cflags) echo $CFLAGS ;; x--libs) echo $LIBS ;; x) # if no parameter is given, give what gnatmake needs echo "$CFLAGS -largs $LIBS" ;; x--help) cat <&2 exit 1 ;; esac AdaCurses-20170708/gen/terminal_interface-curses-forms-form_user_data.ads.m40000644000175100001440000000744311315446021025414 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses-forms-form_user_data__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Form_User_Data -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.15 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type User is limited private; type User_Access is access User; package Terminal_Interface.Curses.Forms.Form_User_Data is pragma Preelaborate (Terminal_Interface.Curses.Forms.Form_User_Data); -- MANPAGE(`form_userptr.3x') -- ANCHOR(`set_form_userptr',`Set_User_Data') procedure Set_User_Data (Frm : Form; Data : User_Access); -- AKA pragma Inline (Set_User_Data); -- ANCHOR(`form_userptr',`Get_User_Data') procedure Get_User_Data (Frm : Form; Data : out User_Access); -- AKA -- ANCHOR(`form_userptr',`Get_User_Data') function Get_User_Data (Frm : Form) return User_Access; -- AKA -- Same as function pragma Inline (Get_User_Data); end Terminal_Interface.Curses.Forms.Form_User_Data; AdaCurses-20170708/gen/terminal_interface-curses.adb.m40000644000175100001440000024264612340207631021266 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses__adb.htm')dnl include(M4MACRO)------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.14 $ -- $Date: 2014/05/24 21:31:05 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; with Terminal_Interface.Curses.Aux; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Strings.Fixed; package body Terminal_Interface.Curses is use Aux; use type System.Bit_Order; package ASF renames Ada.Strings.Fixed; type chtype_array is array (size_t range <>) of aliased Attributed_Character; pragma Convention (C, chtype_array); ------------------------------------------------------------------------------ function Key_Name (Key : Real_Key_Code) return String is function Keyname (K : C_Int) return chars_ptr; pragma Import (C, Keyname, "keyname"); Ch : Character; begin if Key <= Character'Pos (Character'Last) then Ch := Character'Val (Key); if Is_Control (Ch) then return Un_Control (Attributed_Character'(Ch => Ch, Color => Color_Pair'First, Attr => Normal_Video)); elsif Is_Graphic (Ch) then declare S : String (1 .. 1); begin S (1) := Ch; return S; end; else return ""; end if; else return Fill_String (Keyname (C_Int (Key))); end if; end Key_Name; procedure Key_Name (Key : Real_Key_Code; Name : out String) is begin ASF.Move (Key_Name (Key), Name); end Key_Name; ------------------------------------------------------------------------------ procedure Init_Screen is function Initscr return Window; pragma Import (C, Initscr, "initscr"); W : Window; begin W := Initscr; if W = Null_Window then raise Curses_Exception; end if; end Init_Screen; procedure End_Windows is function Endwin return C_Int; pragma Import (C, Endwin, "endwin"); begin if Endwin = Curses_Err then raise Curses_Exception; end if; end End_Windows; function Is_End_Window return Boolean is function Isendwin return Curses_Bool; pragma Import (C, Isendwin, "isendwin"); begin if Isendwin = Curses_Bool_False then return False; else return True; end if; end Is_End_Window; ------------------------------------------------------------------------------ procedure Move_Cursor (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position) is function Wmove (Win : Window; Line : C_Int; Column : C_Int ) return C_Int; pragma Import (C, Wmove, "wmove"); begin if Wmove (Win, C_Int (Line), C_Int (Column)) = Curses_Err then raise Curses_Exception; end if; end Move_Cursor; ------------------------------------------------------------------------------ procedure Add (Win : Window := Standard_Window; Ch : Attributed_Character) is function Waddch (W : Window; Ch : Attributed_Character) return C_Int; pragma Import (C, Waddch, "waddch"); begin if Waddch (Win, Ch) = Curses_Err then raise Curses_Exception; end if; end Add; procedure Add (Win : Window := Standard_Window; Ch : Character) is begin Add (Win, Attributed_Character'(Ch => Ch, Color => Color_Pair'First, Attr => Normal_Video)); end Add; procedure Add (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Ch : Attributed_Character) is function mvwaddch (W : Window; Y : C_Int; X : C_Int; Ch : Attributed_Character) return C_Int; pragma Import (C, mvwaddch, "mvwaddch"); begin if mvwaddch (Win, C_Int (Line), C_Int (Column), Ch) = Curses_Err then raise Curses_Exception; end if; end Add; procedure Add (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Ch : Character) is begin Add (Win, Line, Column, Attributed_Character'(Ch => Ch, Color => Color_Pair'First, Attr => Normal_Video)); end Add; procedure Add_With_Immediate_Echo (Win : Window := Standard_Window; Ch : Attributed_Character) is function Wechochar (W : Window; Ch : Attributed_Character) return C_Int; pragma Import (C, Wechochar, "wechochar"); begin if Wechochar (Win, Ch) = Curses_Err then raise Curses_Exception; end if; end Add_With_Immediate_Echo; procedure Add_With_Immediate_Echo (Win : Window := Standard_Window; Ch : Character) is begin Add_With_Immediate_Echo (Win, Attributed_Character'(Ch => Ch, Color => Color_Pair'First, Attr => Normal_Video)); end Add_With_Immediate_Echo; ------------------------------------------------------------------------------ function Create (Number_Of_Lines : Line_Count; Number_Of_Columns : Column_Count; First_Line_Position : Line_Position; First_Column_Position : Column_Position) return Window is function Newwin (Number_Of_Lines : C_Int; Number_Of_Columns : C_Int; First_Line_Position : C_Int; First_Column_Position : C_Int) return Window; pragma Import (C, Newwin, "newwin"); W : Window; begin W := Newwin (C_Int (Number_Of_Lines), C_Int (Number_Of_Columns), C_Int (First_Line_Position), C_Int (First_Column_Position)); if W = Null_Window then raise Curses_Exception; end if; return W; end Create; procedure Delete (Win : in out Window) is function Wdelwin (W : Window) return C_Int; pragma Import (C, Wdelwin, "delwin"); begin if Wdelwin (Win) = Curses_Err then raise Curses_Exception; end if; Win := Null_Window; end Delete; function Sub_Window (Win : Window := Standard_Window; Number_Of_Lines : Line_Count; Number_Of_Columns : Column_Count; First_Line_Position : Line_Position; First_Column_Position : Column_Position) return Window is function Subwin (Win : Window; Number_Of_Lines : C_Int; Number_Of_Columns : C_Int; First_Line_Position : C_Int; First_Column_Position : C_Int) return Window; pragma Import (C, Subwin, "subwin"); W : Window; begin W := Subwin (Win, C_Int (Number_Of_Lines), C_Int (Number_Of_Columns), C_Int (First_Line_Position), C_Int (First_Column_Position)); if W = Null_Window then raise Curses_Exception; end if; return W; end Sub_Window; function Derived_Window (Win : Window := Standard_Window; Number_Of_Lines : Line_Count; Number_Of_Columns : Column_Count; First_Line_Position : Line_Position; First_Column_Position : Column_Position) return Window is function Derwin (Win : Window; Number_Of_Lines : C_Int; Number_Of_Columns : C_Int; First_Line_Position : C_Int; First_Column_Position : C_Int) return Window; pragma Import (C, Derwin, "derwin"); W : Window; begin W := Derwin (Win, C_Int (Number_Of_Lines), C_Int (Number_Of_Columns), C_Int (First_Line_Position), C_Int (First_Column_Position)); if W = Null_Window then raise Curses_Exception; end if; return W; end Derived_Window; function Duplicate (Win : Window) return Window is function Dupwin (Win : Window) return Window; pragma Import (C, Dupwin, "dupwin"); W : constant Window := Dupwin (Win); begin if W = Null_Window then raise Curses_Exception; end if; return W; end Duplicate; procedure Move_Window (Win : Window; Line : Line_Position; Column : Column_Position) is function Mvwin (Win : Window; Line : C_Int; Column : C_Int) return C_Int; pragma Import (C, Mvwin, "mvwin"); begin if Mvwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then raise Curses_Exception; end if; end Move_Window; procedure Move_Derived_Window (Win : Window; Line : Line_Position; Column : Column_Position) is function Mvderwin (Win : Window; Line : C_Int; Column : C_Int) return C_Int; pragma Import (C, Mvderwin, "mvderwin"); begin if Mvderwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then raise Curses_Exception; end if; end Move_Derived_Window; procedure Set_Synch_Mode (Win : Window := Standard_Window; Mode : Boolean := False) is function Syncok (Win : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Syncok, "syncok"); begin if Syncok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then raise Curses_Exception; end if; end Set_Synch_Mode; ------------------------------------------------------------------------------ procedure Add (Win : Window := Standard_Window; Str : String; Len : Integer := -1) is function Waddnstr (Win : Window; Str : char_array; Len : C_Int := -1) return C_Int; pragma Import (C, Waddnstr, "waddnstr"); Txt : char_array (0 .. Str'Length); Length : size_t; begin To_C (Str, Txt, Length); if Waddnstr (Win, Txt, C_Int (Len)) = Curses_Err then raise Curses_Exception; end if; end Add; procedure Add (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Str : String; Len : Integer := -1) is begin Move_Cursor (Win, Line, Column); Add (Win, Str, Len); end Add; ------------------------------------------------------------------------------ procedure Add (Win : Window := Standard_Window; Str : Attributed_String; Len : Integer := -1) is function Waddchnstr (Win : Window; Str : chtype_array; Len : C_Int := -1) return C_Int; pragma Import (C, Waddchnstr, "waddchnstr"); Txt : chtype_array (0 .. Str'Length); begin for Length in 1 .. size_t (Str'Length) loop Txt (Length - 1) := Str (Natural (Length)); end loop; Txt (Str'Length) := Default_Character; if Waddchnstr (Win, Txt, C_Int (Len)) = Curses_Err then raise Curses_Exception; end if; end Add; procedure Add (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Str : Attributed_String; Len : Integer := -1) is begin Move_Cursor (Win, Line, Column); Add (Win, Str, Len); end Add; ------------------------------------------------------------------------------ procedure Border (Win : Window := Standard_Window; Left_Side_Symbol : Attributed_Character := Default_Character; Right_Side_Symbol : Attributed_Character := Default_Character; Top_Side_Symbol : Attributed_Character := Default_Character; Bottom_Side_Symbol : Attributed_Character := Default_Character; Upper_Left_Corner_Symbol : Attributed_Character := Default_Character; Upper_Right_Corner_Symbol : Attributed_Character := Default_Character; Lower_Left_Corner_Symbol : Attributed_Character := Default_Character; Lower_Right_Corner_Symbol : Attributed_Character := Default_Character) is function Wborder (W : Window; LS : Attributed_Character; RS : Attributed_Character; TS : Attributed_Character; BS : Attributed_Character; ULC : Attributed_Character; URC : Attributed_Character; LLC : Attributed_Character; LRC : Attributed_Character) return C_Int; pragma Import (C, Wborder, "wborder"); begin if Wborder (Win, Left_Side_Symbol, Right_Side_Symbol, Top_Side_Symbol, Bottom_Side_Symbol, Upper_Left_Corner_Symbol, Upper_Right_Corner_Symbol, Lower_Left_Corner_Symbol, Lower_Right_Corner_Symbol) = Curses_Err then raise Curses_Exception; end if; end Border; procedure Box (Win : Window := Standard_Window; Vertical_Symbol : Attributed_Character := Default_Character; Horizontal_Symbol : Attributed_Character := Default_Character) is begin Border (Win, Vertical_Symbol, Vertical_Symbol, Horizontal_Symbol, Horizontal_Symbol); end Box; procedure Horizontal_Line (Win : Window := Standard_Window; Line_Size : Natural; Line_Symbol : Attributed_Character := Default_Character) is function Whline (W : Window; Ch : Attributed_Character; Len : C_Int) return C_Int; pragma Import (C, Whline, "whline"); begin if Whline (Win, Line_Symbol, C_Int (Line_Size)) = Curses_Err then raise Curses_Exception; end if; end Horizontal_Line; procedure Vertical_Line (Win : Window := Standard_Window; Line_Size : Natural; Line_Symbol : Attributed_Character := Default_Character) is function Wvline (W : Window; Ch : Attributed_Character; Len : C_Int) return C_Int; pragma Import (C, Wvline, "wvline"); begin if Wvline (Win, Line_Symbol, C_Int (Line_Size)) = Curses_Err then raise Curses_Exception; end if; end Vertical_Line; ------------------------------------------------------------------------------ function Get_Keystroke (Win : Window := Standard_Window) return Real_Key_Code is function Wgetch (W : Window) return C_Int; pragma Import (C, Wgetch, "wgetch"); C : constant C_Int := Wgetch (Win); begin if C = Curses_Err then return Key_None; else return Real_Key_Code (C); end if; end Get_Keystroke; procedure Undo_Keystroke (Key : Real_Key_Code) is function Ungetch (Ch : C_Int) return C_Int; pragma Import (C, Ungetch, "ungetch"); begin if Ungetch (C_Int (Key)) = Curses_Err then raise Curses_Exception; end if; end Undo_Keystroke; function Has_Key (Key : Special_Key_Code) return Boolean is function Haskey (Key : C_Int) return C_Int; pragma Import (C, Haskey, "has_key"); begin if Haskey (C_Int (Key)) = Curses_False then return False; else return True; end if; end Has_Key; function Is_Function_Key (Key : Special_Key_Code) return Boolean is L : constant Special_Key_Code := Special_Key_Code (Natural (Key_F0) + Natural (Function_Key_Number'Last)); begin if (Key >= Key_F0) and then (Key <= L) then return True; else return False; end if; end Is_Function_Key; function Function_Key (Key : Real_Key_Code) return Function_Key_Number is begin if Is_Function_Key (Key) then return Function_Key_Number (Key - Key_F0); else raise Constraint_Error; end if; end Function_Key; function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code is begin return Real_Key_Code (Natural (Key_F0) + Natural (Key)); end Function_Key_Code; ------------------------------------------------------------------------------ procedure Standout (Win : Window := Standard_Window; On : Boolean := True) is function wstandout (Win : Window) return C_Int; pragma Import (C, wstandout, "wstandout"); function wstandend (Win : Window) return C_Int; pragma Import (C, wstandend, "wstandend"); Err : C_Int; begin if On then Err := wstandout (Win); else Err := wstandend (Win); end if; if Err = Curses_Err then raise Curses_Exception; end if; end Standout; procedure Switch_Character_Attribute (Win : Window := Standard_Window; Attr : Character_Attribute_Set := Normal_Video; On : Boolean := True) is function Wattron (Win : Window; C_Attr : Attributed_Character) return C_Int; pragma Import (C, Wattron, "wattr_on"); function Wattroff (Win : Window; C_Attr : Attributed_Character) return C_Int; pragma Import (C, Wattroff, "wattr_off"); -- In Ada we use the On Boolean to control whether or not we want to -- switch on or off the attributes in the set. Err : C_Int; AC : constant Attributed_Character := (Ch => Character'First, Color => Color_Pair'First, Attr => Attr); begin if On then Err := Wattron (Win, AC); else Err := Wattroff (Win, AC); end if; if Err = Curses_Err then raise Curses_Exception; end if; end Switch_Character_Attribute; procedure Set_Character_Attributes (Win : Window := Standard_Window; Attr : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First) is function Wattrset (Win : Window; C_Attr : Attributed_Character) return C_Int; pragma Import (C, Wattrset, "wattrset"); -- ??? wattr_set begin if Wattrset (Win, (Ch => Character'First, Color => Color, Attr => Attr)) = Curses_Err then raise Curses_Exception; end if; end Set_Character_Attributes; function Get_Character_Attribute (Win : Window := Standard_Window) return Character_Attribute_Set is function Wattrget (Win : Window; Atr : access Attributed_Character; Col : access C_Short; Opt : System.Address) return C_Int; pragma Import (C, Wattrget, "wattr_get"); Attr : aliased Attributed_Character; Col : aliased C_Short; Res : constant C_Int := Wattrget (Win, Attr'Access, Col'Access, System.Null_Address); begin if Res = Curses_Ok then return Attr.Attr; else raise Curses_Exception; end if; end Get_Character_Attribute; function Get_Character_Attribute (Win : Window := Standard_Window) return Color_Pair is function Wattrget (Win : Window; Atr : access Attributed_Character; Col : access C_Short; Opt : System.Address) return C_Int; pragma Import (C, Wattrget, "wattr_get"); Attr : aliased Attributed_Character; Col : aliased C_Short; Res : constant C_Int := Wattrget (Win, Attr'Access, Col'Access, System.Null_Address); begin if Res = Curses_Ok then return Attr.Color; else raise Curses_Exception; end if; end Get_Character_Attribute; procedure Set_Color (Win : Window := Standard_Window; Pair : Color_Pair) is function Wset_Color (Win : Window; Color : C_Short; Opts : C_Void_Ptr) return C_Int; pragma Import (C, Wset_Color, "wcolor_set"); begin if Wset_Color (Win, C_Short (Pair), C_Void_Ptr (System.Null_Address)) = Curses_Err then raise Curses_Exception; end if; end Set_Color; procedure Change_Attributes (Win : Window := Standard_Window; Count : Integer := -1; Attr : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First) is function Wchgat (Win : Window; Cnt : C_Int; Attr : Attributed_Character; Color : C_Short; Opts : System.Address := System.Null_Address) return C_Int; pragma Import (C, Wchgat, "wchgat"); begin if Wchgat (Win, C_Int (Count), (Ch => Character'First, Color => Color_Pair'First, Attr => Attr), C_Short (Color)) = Curses_Err then raise Curses_Exception; end if; end Change_Attributes; procedure Change_Attributes (Win : Window := Standard_Window; Line : Line_Position := Line_Position'First; Column : Column_Position := Column_Position'First; Count : Integer := -1; Attr : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First) is begin Move_Cursor (Win, Line, Column); Change_Attributes (Win, Count, Attr, Color); end Change_Attributes; ------------------------------------------------------------------------------ procedure Beep is function Beeper return C_Int; pragma Import (C, Beeper, "beep"); begin if Beeper = Curses_Err then raise Curses_Exception; end if; end Beep; procedure Flash_Screen is function Flash return C_Int; pragma Import (C, Flash, "flash"); begin if Flash = Curses_Err then raise Curses_Exception; end if; end Flash_Screen; ------------------------------------------------------------------------------ procedure Set_Cbreak_Mode (SwitchOn : Boolean := True) is function Cbreak return C_Int; pragma Import (C, Cbreak, "cbreak"); function NoCbreak return C_Int; pragma Import (C, NoCbreak, "nocbreak"); Err : C_Int; begin if SwitchOn then Err := Cbreak; else Err := NoCbreak; end if; if Err = Curses_Err then raise Curses_Exception; end if; end Set_Cbreak_Mode; procedure Set_Raw_Mode (SwitchOn : Boolean := True) is function Raw return C_Int; pragma Import (C, Raw, "raw"); function NoRaw return C_Int; pragma Import (C, NoRaw, "noraw"); Err : C_Int; begin if SwitchOn then Err := Raw; else Err := NoRaw; end if; if Err = Curses_Err then raise Curses_Exception; end if; end Set_Raw_Mode; procedure Set_Echo_Mode (SwitchOn : Boolean := True) is function Echo return C_Int; pragma Import (C, Echo, "echo"); function NoEcho return C_Int; pragma Import (C, NoEcho, "noecho"); Err : C_Int; begin if SwitchOn then Err := Echo; else Err := NoEcho; end if; if Err = Curses_Err then raise Curses_Exception; end if; end Set_Echo_Mode; procedure Set_Meta_Mode (Win : Window := Standard_Window; SwitchOn : Boolean := True) is function Meta (W : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Meta, "meta"); begin if Meta (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then raise Curses_Exception; end if; end Set_Meta_Mode; procedure Set_KeyPad_Mode (Win : Window := Standard_Window; SwitchOn : Boolean := True) is function Keypad (W : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Keypad, "keypad"); begin if Keypad (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then raise Curses_Exception; end if; end Set_KeyPad_Mode; function Get_KeyPad_Mode (Win : Window := Standard_Window) return Boolean is function Is_Keypad (W : Window) return Curses_Bool; pragma Import (C, Is_Keypad, "is_keypad"); begin return (Is_Keypad (Win) /= Curses_Bool_False); end Get_KeyPad_Mode; procedure Half_Delay (Amount : Half_Delay_Amount) is function Halfdelay (Amount : C_Int) return C_Int; pragma Import (C, Halfdelay, "halfdelay"); begin if Halfdelay (C_Int (Amount)) = Curses_Err then raise Curses_Exception; end if; end Half_Delay; procedure Set_Flush_On_Interrupt_Mode (Win : Window := Standard_Window; Mode : Boolean := True) is function Intrflush (Win : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Intrflush, "intrflush"); begin if Intrflush (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then raise Curses_Exception; end if; end Set_Flush_On_Interrupt_Mode; procedure Set_Queue_Interrupt_Mode (Win : Window := Standard_Window; Flush : Boolean := True) is procedure Qiflush; pragma Import (C, Qiflush, "qiflush"); procedure No_Qiflush; pragma Import (C, No_Qiflush, "noqiflush"); begin if Win = Null_Window then raise Curses_Exception; end if; if Flush then Qiflush; else No_Qiflush; end if; end Set_Queue_Interrupt_Mode; procedure Set_NoDelay_Mode (Win : Window := Standard_Window; Mode : Boolean := False) is function Nodelay (Win : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Nodelay, "nodelay"); begin if Nodelay (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then raise Curses_Exception; end if; end Set_NoDelay_Mode; procedure Set_Timeout_Mode (Win : Window := Standard_Window; Mode : Timeout_Mode; Amount : Natural) is procedure Wtimeout (Win : Window; Amount : C_Int); pragma Import (C, Wtimeout, "wtimeout"); Time : C_Int; begin case Mode is when Blocking => Time := -1; when Non_Blocking => Time := 0; when Delayed => if Amount = 0 then raise Constraint_Error; end if; Time := C_Int (Amount); end case; Wtimeout (Win, Time); end Set_Timeout_Mode; procedure Set_Escape_Timer_Mode (Win : Window := Standard_Window; Timer_Off : Boolean := False) is function Notimeout (Win : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Notimeout, "notimeout"); begin if Notimeout (Win, Curses_Bool (Boolean'Pos (Timer_Off))) = Curses_Err then raise Curses_Exception; end if; end Set_Escape_Timer_Mode; ------------------------------------------------------------------------------ procedure Set_NL_Mode (SwitchOn : Boolean := True) is function NL return C_Int; pragma Import (C, NL, "nl"); function NoNL return C_Int; pragma Import (C, NoNL, "nonl"); Err : C_Int; begin if SwitchOn then Err := NL; else Err := NoNL; end if; if Err = Curses_Err then raise Curses_Exception; end if; end Set_NL_Mode; procedure Clear_On_Next_Update (Win : Window := Standard_Window; Do_Clear : Boolean := True) is function Clear_Ok (W : Window; Flag : Curses_Bool) return C_Int; pragma Import (C, Clear_Ok, "clearok"); begin if Clear_Ok (Win, Curses_Bool (Boolean'Pos (Do_Clear))) = Curses_Err then raise Curses_Exception; end if; end Clear_On_Next_Update; procedure Use_Insert_Delete_Line (Win : Window := Standard_Window; Do_Idl : Boolean := True) is function IDL_Ok (W : Window; Flag : Curses_Bool) return C_Int; pragma Import (C, IDL_Ok, "idlok"); begin if IDL_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idl))) = Curses_Err then raise Curses_Exception; end if; end Use_Insert_Delete_Line; procedure Use_Insert_Delete_Character (Win : Window := Standard_Window; Do_Idc : Boolean := True) is procedure IDC_Ok (W : Window; Flag : Curses_Bool); pragma Import (C, IDC_Ok, "idcok"); begin IDC_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idc))); end Use_Insert_Delete_Character; procedure Leave_Cursor_After_Update (Win : Window := Standard_Window; Do_Leave : Boolean := True) is function Leave_Ok (W : Window; Flag : Curses_Bool) return C_Int; pragma Import (C, Leave_Ok, "leaveok"); begin if Leave_Ok (Win, Curses_Bool (Boolean'Pos (Do_Leave))) = Curses_Err then raise Curses_Exception; end if; end Leave_Cursor_After_Update; procedure Immediate_Update_Mode (Win : Window := Standard_Window; Mode : Boolean := False) is procedure Immedok (Win : Window; Mode : Curses_Bool); pragma Import (C, Immedok, "immedok"); begin Immedok (Win, Curses_Bool (Boolean'Pos (Mode))); end Immediate_Update_Mode; procedure Allow_Scrolling (Win : Window := Standard_Window; Mode : Boolean := False) is function Scrollok (Win : Window; Mode : Curses_Bool) return C_Int; pragma Import (C, Scrollok, "scrollok"); begin if Scrollok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then raise Curses_Exception; end if; end Allow_Scrolling; function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean is function Is_Scroll_Ok (W : Window) return Curses_Bool; pragma Import (C, Is_Scroll_Ok, "is_scrollok"); begin return (Is_Scroll_Ok (Win) /= Curses_Bool_False); end Scrolling_Allowed; procedure Set_Scroll_Region (Win : Window := Standard_Window; Top_Line : Line_Position; Bottom_Line : Line_Position) is function Wsetscrreg (Win : Window; Lin : C_Int; Col : C_Int) return C_Int; pragma Import (C, Wsetscrreg, "wsetscrreg"); begin if Wsetscrreg (Win, C_Int (Top_Line), C_Int (Bottom_Line)) = Curses_Err then raise Curses_Exception; end if; end Set_Scroll_Region; ------------------------------------------------------------------------------ procedure Update_Screen is function Do_Update return C_Int; pragma Import (C, Do_Update, "doupdate"); begin if Do_Update = Curses_Err then raise Curses_Exception; end if; end Update_Screen; procedure Refresh (Win : Window := Standard_Window) is function Wrefresh (W : Window) return C_Int; pragma Import (C, Wrefresh, "wrefresh"); begin if Wrefresh (Win) = Curses_Err then raise Curses_Exception; end if; end Refresh; procedure Refresh_Without_Update (Win : Window := Standard_Window) is function Wnoutrefresh (W : Window) return C_Int; pragma Import (C, Wnoutrefresh, "wnoutrefresh"); begin if Wnoutrefresh (Win) = Curses_Err then raise Curses_Exception; end if; end Refresh_Without_Update; procedure Redraw (Win : Window := Standard_Window) is function Redrawwin (Win : Window) return C_Int; pragma Import (C, Redrawwin, "redrawwin"); begin if Redrawwin (Win) = Curses_Err then raise Curses_Exception; end if; end Redraw; procedure Redraw (Win : Window := Standard_Window; Begin_Line : Line_Position; Line_Count : Positive) is function Wredrawln (Win : Window; First : C_Int; Cnt : C_Int) return C_Int; pragma Import (C, Wredrawln, "wredrawln"); begin if Wredrawln (Win, C_Int (Begin_Line), C_Int (Line_Count)) = Curses_Err then raise Curses_Exception; end if; end Redraw; ------------------------------------------------------------------------------ procedure Erase (Win : Window := Standard_Window) is function Werase (W : Window) return C_Int; pragma Import (C, Werase, "werase"); begin if Werase (Win) = Curses_Err then raise Curses_Exception; end if; end Erase; procedure Clear (Win : Window := Standard_Window) is function Wclear (W : Window) return C_Int; pragma Import (C, Wclear, "wclear"); begin if Wclear (Win) = Curses_Err then raise Curses_Exception; end if; end Clear; procedure Clear_To_End_Of_Screen (Win : Window := Standard_Window) is function Wclearbot (W : Window) return C_Int; pragma Import (C, Wclearbot, "wclrtobot"); begin if Wclearbot (Win) = Curses_Err then raise Curses_Exception; end if; end Clear_To_End_Of_Screen; procedure Clear_To_End_Of_Line (Win : Window := Standard_Window) is function Wcleareol (W : Window) return C_Int; pragma Import (C, Wcleareol, "wclrtoeol"); begin if Wcleareol (Win) = Curses_Err then raise Curses_Exception; end if; end Clear_To_End_Of_Line; ------------------------------------------------------------------------------ procedure Set_Background (Win : Window := Standard_Window; Ch : Attributed_Character) is procedure WBackground (W : Window; Ch : Attributed_Character); pragma Import (C, WBackground, "wbkgdset"); begin WBackground (Win, Ch); end Set_Background; procedure Change_Background (Win : Window := Standard_Window; Ch : Attributed_Character) is function WChangeBkgd (W : Window; Ch : Attributed_Character) return C_Int; pragma Import (C, WChangeBkgd, "wbkgd"); begin if WChangeBkgd (Win, Ch) = Curses_Err then raise Curses_Exception; end if; end Change_Background; function Get_Background (Win : Window := Standard_Window) return Attributed_Character is function Wgetbkgd (Win : Window) return Attributed_Character; pragma Import (C, Wgetbkgd, "getbkgd"); begin return Wgetbkgd (Win); end Get_Background; ------------------------------------------------------------------------------ procedure Change_Lines_Status (Win : Window := Standard_Window; Start : Line_Position; Count : Positive; State : Boolean) is function Wtouchln (Win : Window; Sta : C_Int; Cnt : C_Int; Chg : C_Int) return C_Int; pragma Import (C, Wtouchln, "wtouchln"); begin if Wtouchln (Win, C_Int (Start), C_Int (Count), C_Int (Boolean'Pos (State))) = Curses_Err then raise Curses_Exception; end if; end Change_Lines_Status; procedure Touch (Win : Window := Standard_Window) is Y : Line_Position; X : Column_Position; begin Get_Size (Win, Y, X); pragma Warnings (Off, X); -- unreferenced Change_Lines_Status (Win, 0, Positive (Y), True); end Touch; procedure Untouch (Win : Window := Standard_Window) is Y : Line_Position; X : Column_Position; begin Get_Size (Win, Y, X); pragma Warnings (Off, X); -- unreferenced Change_Lines_Status (Win, 0, Positive (Y), False); end Untouch; procedure Touch (Win : Window := Standard_Window; Start : Line_Position; Count : Positive) is begin Change_Lines_Status (Win, Start, Count, True); end Touch; function Is_Touched (Win : Window := Standard_Window; Line : Line_Position) return Boolean is function WLineTouched (W : Window; L : C_Int) return Curses_Bool; pragma Import (C, WLineTouched, "is_linetouched"); begin if WLineTouched (Win, C_Int (Line)) = Curses_Bool_False then return False; else return True; end if; end Is_Touched; function Is_Touched (Win : Window := Standard_Window) return Boolean is function WWinTouched (W : Window) return Curses_Bool; pragma Import (C, WWinTouched, "is_wintouched"); begin if WWinTouched (Win) = Curses_Bool_False then return False; else return True; end if; end Is_Touched; ------------------------------------------------------------------------------ procedure Copy (Source_Window : Window; Destination_Window : Window; Source_Top_Row : Line_Position; Source_Left_Column : Column_Position; Destination_Top_Row : Line_Position; Destination_Left_Column : Column_Position; Destination_Bottom_Row : Line_Position; Destination_Right_Column : Column_Position; Non_Destructive_Mode : Boolean := True) is function Copywin (Src : Window; Dst : Window; Str : C_Int; Slc : C_Int; Dtr : C_Int; Dlc : C_Int; Dbr : C_Int; Drc : C_Int; Ndm : C_Int) return C_Int; pragma Import (C, Copywin, "copywin"); begin if Copywin (Source_Window, Destination_Window, C_Int (Source_Top_Row), C_Int (Source_Left_Column), C_Int (Destination_Top_Row), C_Int (Destination_Left_Column), C_Int (Destination_Bottom_Row), C_Int (Destination_Right_Column), Boolean'Pos (Non_Destructive_Mode) ) = Curses_Err then raise Curses_Exception; end if; end Copy; procedure Overwrite (Source_Window : Window; Destination_Window : Window) is function Overwrite (Src : Window; Dst : Window) return C_Int; pragma Import (C, Overwrite, "overwrite"); begin if Overwrite (Source_Window, Destination_Window) = Curses_Err then raise Curses_Exception; end if; end Overwrite; procedure Overlay (Source_Window : Window; Destination_Window : Window) is function Overlay (Src : Window; Dst : Window) return C_Int; pragma Import (C, Overlay, "overlay"); begin if Overlay (Source_Window, Destination_Window) = Curses_Err then raise Curses_Exception; end if; end Overlay; ------------------------------------------------------------------------------ procedure Insert_Delete_Lines (Win : Window := Standard_Window; Lines : Integer := 1) -- default is to insert one line above is function Winsdelln (W : Window; N : C_Int) return C_Int; pragma Import (C, Winsdelln, "winsdelln"); begin if Winsdelln (Win, C_Int (Lines)) = Curses_Err then raise Curses_Exception; end if; end Insert_Delete_Lines; procedure Delete_Line (Win : Window := Standard_Window) is begin Insert_Delete_Lines (Win, -1); end Delete_Line; procedure Insert_Line (Win : Window := Standard_Window) is begin Insert_Delete_Lines (Win, 1); end Insert_Line; ------------------------------------------------------------------------------ procedure Get_Size (Win : Window := Standard_Window; Number_Of_Lines : out Line_Count; Number_Of_Columns : out Column_Count) is function GetMaxY (W : Window) return C_Int; pragma Import (C, GetMaxY, "getmaxy"); function GetMaxX (W : Window) return C_Int; pragma Import (C, GetMaxX, "getmaxx"); Y : constant C_Int := GetMaxY (Win); X : constant C_Int := GetMaxX (Win); begin Number_Of_Lines := Line_Count (Y); Number_Of_Columns := Column_Count (X); end Get_Size; procedure Get_Window_Position (Win : Window := Standard_Window; Top_Left_Line : out Line_Position; Top_Left_Column : out Column_Position) is function GetBegY (W : Window) return C_Int; pragma Import (C, GetBegY, "getbegy"); function GetBegX (W : Window) return C_Int; pragma Import (C, GetBegX, "getbegx"); Y : constant C_Short := C_Short (GetBegY (Win)); X : constant C_Short := C_Short (GetBegX (Win)); begin Top_Left_Line := Line_Position (Y); Top_Left_Column := Column_Position (X); end Get_Window_Position; procedure Get_Cursor_Position (Win : Window := Standard_Window; Line : out Line_Position; Column : out Column_Position) is function GetCurY (W : Window) return C_Int; pragma Import (C, GetCurY, "getcury"); function GetCurX (W : Window) return C_Int; pragma Import (C, GetCurX, "getcurx"); Y : constant C_Short := C_Short (GetCurY (Win)); X : constant C_Short := C_Short (GetCurX (Win)); begin Line := Line_Position (Y); Column := Column_Position (X); end Get_Cursor_Position; procedure Get_Origin_Relative_To_Parent (Win : Window; Top_Left_Line : out Line_Position; Top_Left_Column : out Column_Position; Is_Not_A_Subwindow : out Boolean) is function GetParY (W : Window) return C_Int; pragma Import (C, GetParY, "getpary"); function GetParX (W : Window) return C_Int; pragma Import (C, GetParX, "getparx"); Y : constant C_Int := GetParY (Win); X : constant C_Int := GetParX (Win); begin if Y = -1 then Top_Left_Line := Line_Position'Last; Top_Left_Column := Column_Position'Last; Is_Not_A_Subwindow := True; else Top_Left_Line := Line_Position (Y); Top_Left_Column := Column_Position (X); Is_Not_A_Subwindow := False; end if; end Get_Origin_Relative_To_Parent; ------------------------------------------------------------------------------ function New_Pad (Lines : Line_Count; Columns : Column_Count) return Window is function Newpad (Lines : C_Int; Columns : C_Int) return Window; pragma Import (C, Newpad, "newpad"); W : Window; begin W := Newpad (C_Int (Lines), C_Int (Columns)); if W = Null_Window then raise Curses_Exception; end if; return W; end New_Pad; function Sub_Pad (Pad : Window; Number_Of_Lines : Line_Count; Number_Of_Columns : Column_Count; First_Line_Position : Line_Position; First_Column_Position : Column_Position) return Window is function Subpad (Pad : Window; Number_Of_Lines : C_Int; Number_Of_Columns : C_Int; First_Line_Position : C_Int; First_Column_Position : C_Int) return Window; pragma Import (C, Subpad, "subpad"); W : Window; begin W := Subpad (Pad, C_Int (Number_Of_Lines), C_Int (Number_Of_Columns), C_Int (First_Line_Position), C_Int (First_Column_Position)); if W = Null_Window then raise Curses_Exception; end if; return W; end Sub_Pad; procedure Refresh (Pad : Window; Source_Top_Row : Line_Position; Source_Left_Column : Column_Position; Destination_Top_Row : Line_Position; Destination_Left_Column : Column_Position; Destination_Bottom_Row : Line_Position; Destination_Right_Column : Column_Position) is function Prefresh (Pad : Window; Source_Top_Row : C_Int; Source_Left_Column : C_Int; Destination_Top_Row : C_Int; Destination_Left_Column : C_Int; Destination_Bottom_Row : C_Int; Destination_Right_Column : C_Int) return C_Int; pragma Import (C, Prefresh, "prefresh"); begin if Prefresh (Pad, C_Int (Source_Top_Row), C_Int (Source_Left_Column), C_Int (Destination_Top_Row), C_Int (Destination_Left_Column), C_Int (Destination_Bottom_Row), C_Int (Destination_Right_Column)) = Curses_Err then raise Curses_Exception; end if; end Refresh; procedure Refresh_Without_Update (Pad : Window; Source_Top_Row : Line_Position; Source_Left_Column : Column_Position; Destination_Top_Row : Line_Position; Destination_Left_Column : Column_Position; Destination_Bottom_Row : Line_Position; Destination_Right_Column : Column_Position) is function Pnoutrefresh (Pad : Window; Source_Top_Row : C_Int; Source_Left_Column : C_Int; Destination_Top_Row : C_Int; Destination_Left_Column : C_Int; Destination_Bottom_Row : C_Int; Destination_Right_Column : C_Int) return C_Int; pragma Import (C, Pnoutrefresh, "pnoutrefresh"); begin if Pnoutrefresh (Pad, C_Int (Source_Top_Row), C_Int (Source_Left_Column), C_Int (Destination_Top_Row), C_Int (Destination_Left_Column), C_Int (Destination_Bottom_Row), C_Int (Destination_Right_Column)) = Curses_Err then raise Curses_Exception; end if; end Refresh_Without_Update; procedure Add_Character_To_Pad_And_Echo_It (Pad : Window; Ch : Attributed_Character) is function Pechochar (Pad : Window; Ch : Attributed_Character) return C_Int; pragma Import (C, Pechochar, "pechochar"); begin if Pechochar (Pad, Ch) = Curses_Err then raise Curses_Exception; end if; end Add_Character_To_Pad_And_Echo_It; procedure Add_Character_To_Pad_And_Echo_It (Pad : Window; Ch : Character) is begin Add_Character_To_Pad_And_Echo_It (Pad, Attributed_Character'(Ch => Ch, Color => Color_Pair'First, Attr => Normal_Video)); end Add_Character_To_Pad_And_Echo_It; ------------------------------------------------------------------------------ procedure Scroll (Win : Window := Standard_Window; Amount : Integer := 1) is function Wscrl (Win : Window; N : C_Int) return C_Int; pragma Import (C, Wscrl, "wscrl"); begin if Wscrl (Win, C_Int (Amount)) = Curses_Err then raise Curses_Exception; end if; end Scroll; ------------------------------------------------------------------------------ procedure Delete_Character (Win : Window := Standard_Window) is function Wdelch (Win : Window) return C_Int; pragma Import (C, Wdelch, "wdelch"); begin if Wdelch (Win) = Curses_Err then raise Curses_Exception; end if; end Delete_Character; procedure Delete_Character (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position) is function Mvwdelch (Win : Window; Lin : C_Int; Col : C_Int) return C_Int; pragma Import (C, Mvwdelch, "mvwdelch"); begin if Mvwdelch (Win, C_Int (Line), C_Int (Column)) = Curses_Err then raise Curses_Exception; end if; end Delete_Character; ------------------------------------------------------------------------------ function Peek (Win : Window := Standard_Window) return Attributed_Character is function Winch (Win : Window) return Attributed_Character; pragma Import (C, Winch, "winch"); begin return Winch (Win); end Peek; function Peek (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position) return Attributed_Character is function Mvwinch (Win : Window; Lin : C_Int; Col : C_Int) return Attributed_Character; pragma Import (C, Mvwinch, "mvwinch"); begin return Mvwinch (Win, C_Int (Line), C_Int (Column)); end Peek; ------------------------------------------------------------------------------ procedure Insert (Win : Window := Standard_Window; Ch : Attributed_Character) is function Winsch (Win : Window; Ch : Attributed_Character) return C_Int; pragma Import (C, Winsch, "winsch"); begin if Winsch (Win, Ch) = Curses_Err then raise Curses_Exception; end if; end Insert; procedure Insert (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Ch : Attributed_Character) is function Mvwinsch (Win : Window; Lin : C_Int; Col : C_Int; Ch : Attributed_Character) return C_Int; pragma Import (C, Mvwinsch, "mvwinsch"); begin if Mvwinsch (Win, C_Int (Line), C_Int (Column), Ch) = Curses_Err then raise Curses_Exception; end if; end Insert; ------------------------------------------------------------------------------ procedure Insert (Win : Window := Standard_Window; Str : String; Len : Integer := -1) is function Winsnstr (Win : Window; Str : char_array; Len : Integer := -1) return C_Int; pragma Import (C, Winsnstr, "winsnstr"); Txt : char_array (0 .. Str'Length); Length : size_t; begin To_C (Str, Txt, Length); if Winsnstr (Win, Txt, Len) = Curses_Err then raise Curses_Exception; end if; end Insert; procedure Insert (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Str : String; Len : Integer := -1) is function Mvwinsnstr (Win : Window; Line : C_Int; Column : C_Int; Str : char_array; Len : C_Int) return C_Int; pragma Import (C, Mvwinsnstr, "mvwinsnstr"); Txt : char_array (0 .. Str'Length); Length : size_t; begin To_C (Str, Txt, Length); if Mvwinsnstr (Win, C_Int (Line), C_Int (Column), Txt, C_Int (Len)) = Curses_Err then raise Curses_Exception; end if; end Insert; ------------------------------------------------------------------------------ procedure Peek (Win : Window := Standard_Window; Str : out String; Len : Integer := -1) is function Winnstr (Win : Window; Str : char_array; Len : C_Int) return C_Int; pragma Import (C, Winnstr, "winnstr"); N : Integer := Len; Txt : char_array (0 .. Str'Length); Cnt : Natural; begin if N < 0 then N := Str'Length; end if; if N > Str'Length then raise Constraint_Error; end if; Txt (0) := Interfaces.C.char'First; if Winnstr (Win, Txt, C_Int (N)) = Curses_Err then raise Curses_Exception; end if; To_Ada (Txt, Str, Cnt, True); if Cnt < Str'Length then Str ((Str'First + Cnt) .. Str'Last) := (others => ' '); end if; end Peek; procedure Peek (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Str : out String; Len : Integer := -1) is begin Move_Cursor (Win, Line, Column); Peek (Win, Str, Len); end Peek; ------------------------------------------------------------------------------ procedure Peek (Win : Window := Standard_Window; Str : out Attributed_String; Len : Integer := -1) is function Winchnstr (Win : Window; Str : chtype_array; -- out Len : C_Int) return C_Int; pragma Import (C, Winchnstr, "winchnstr"); N : Integer := Len; Txt : constant chtype_array (0 .. Str'Length) := (0 => Default_Character); Cnt : Natural := 0; begin if N < 0 then N := Str'Length; end if; if N > Str'Length then raise Constraint_Error; end if; if Winchnstr (Win, Txt, C_Int (N)) = Curses_Err then raise Curses_Exception; end if; for To in Str'Range loop exit when Txt (size_t (Cnt)) = Default_Character; Str (To) := Txt (size_t (Cnt)); Cnt := Cnt + 1; end loop; if Cnt < Str'Length then Str ((Str'First + Cnt) .. Str'Last) := (others => (Ch => ' ', Color => Color_Pair'First, Attr => Normal_Video)); end if; end Peek; procedure Peek (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Str : out Attributed_String; Len : Integer := -1) is begin Move_Cursor (Win, Line, Column); Peek (Win, Str, Len); end Peek; ------------------------------------------------------------------------------ procedure Get (Win : Window := Standard_Window; Str : out String; Len : Integer := -1) is function Wgetnstr (Win : Window; Str : char_array; Len : C_Int) return C_Int; pragma Import (C, Wgetnstr, "wgetnstr"); N : Integer := Len; Txt : char_array (0 .. Str'Length); Cnt : Natural; begin if N < 0 then N := Str'Length; end if; if N > Str'Length then raise Constraint_Error; end if; Txt (0) := Interfaces.C.char'First; if Wgetnstr (Win, Txt, C_Int (N)) = Curses_Err then raise Curses_Exception; end if; To_Ada (Txt, Str, Cnt, True); if Cnt < Str'Length then Str ((Str'First + Cnt) .. Str'Last) := (others => ' '); end if; end Get; procedure Get (Win : Window := Standard_Window; Line : Line_Position; Column : Column_Position; Str : out String; Len : Integer := -1) is begin Move_Cursor (Win, Line, Column); Get (Win, Str, Len); end Get; ------------------------------------------------------------------------------ procedure Init_Soft_Label_Keys (Format : Soft_Label_Key_Format := Three_Two_Three) is function Slk_Init (Fmt : C_Int) return C_Int; pragma Import (C, Slk_Init, "slk_init"); begin if Slk_Init (Soft_Label_Key_Format'Pos (Format)) = Curses_Err then raise Curses_Exception; end if; end Init_Soft_Label_Keys; procedure Set_Soft_Label_Key (Label : Label_Number; Text : String; Fmt : Label_Justification := Left) is function Slk_Set (Label : C_Int; Txt : char_array; Fmt : C_Int) return C_Int; pragma Import (C, Slk_Set, "slk_set"); Txt : char_array (0 .. Text'Length); Len : size_t; begin To_C (Text, Txt, Len); if Slk_Set (C_Int (Label), Txt, C_Int (Label_Justification'Pos (Fmt))) = Curses_Err then raise Curses_Exception; end if; end Set_Soft_Label_Key; procedure Refresh_Soft_Label_Keys is function Slk_Refresh return C_Int; pragma Import (C, Slk_Refresh, "slk_refresh"); begin if Slk_Refresh = Curses_Err then raise Curses_Exception; end if; end Refresh_Soft_Label_Keys; procedure Refresh_Soft_Label_Keys_Without_Update is function Slk_Noutrefresh return C_Int; pragma Import (C, Slk_Noutrefresh, "slk_noutrefresh"); begin if Slk_Noutrefresh = Curses_Err then raise Curses_Exception; end if; end Refresh_Soft_Label_Keys_Without_Update; procedure Get_Soft_Label_Key (Label : Label_Number; Text : out String) is function Slk_Label (Label : C_Int) return chars_ptr; pragma Import (C, Slk_Label, "slk_label"); begin Fill_String (Slk_Label (C_Int (Label)), Text); end Get_Soft_Label_Key; function Get_Soft_Label_Key (Label : Label_Number) return String is function Slk_Label (Label : C_Int) return chars_ptr; pragma Import (C, Slk_Label, "slk_label"); begin return Fill_String (Slk_Label (C_Int (Label))); end Get_Soft_Label_Key; procedure Clear_Soft_Label_Keys is function Slk_Clear return C_Int; pragma Import (C, Slk_Clear, "slk_clear"); begin if Slk_Clear = Curses_Err then raise Curses_Exception; end if; end Clear_Soft_Label_Keys; procedure Restore_Soft_Label_Keys is function Slk_Restore return C_Int; pragma Import (C, Slk_Restore, "slk_restore"); begin if Slk_Restore = Curses_Err then raise Curses_Exception; end if; end Restore_Soft_Label_Keys; procedure Touch_Soft_Label_Keys is function Slk_Touch return C_Int; pragma Import (C, Slk_Touch, "slk_touch"); begin if Slk_Touch = Curses_Err then raise Curses_Exception; end if; end Touch_Soft_Label_Keys; procedure Switch_Soft_Label_Key_Attributes (Attr : Character_Attribute_Set; On : Boolean := True) is function Slk_Attron (Ch : Attributed_Character) return C_Int; pragma Import (C, Slk_Attron, "slk_attron"); function Slk_Attroff (Ch : Attributed_Character) return C_Int; pragma Import (C, Slk_Attroff, "slk_attroff"); Err : C_Int; Ch : constant Attributed_Character := (Ch => Character'First, Attr => Attr, Color => Color_Pair'First); begin if On then Err := Slk_Attron (Ch); else Err := Slk_Attroff (Ch); end if; if Err = Curses_Err then raise Curses_Exception; end if; end Switch_Soft_Label_Key_Attributes; procedure Set_Soft_Label_Key_Attributes (Attr : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First) is function Slk_Attrset (Ch : Attributed_Character) return C_Int; pragma Import (C, Slk_Attrset, "slk_attrset"); Ch : constant Attributed_Character := (Ch => Character'First, Attr => Attr, Color => Color); begin if Slk_Attrset (Ch) = Curses_Err then raise Curses_Exception; end if; end Set_Soft_Label_Key_Attributes; function Get_Soft_Label_Key_Attributes return Character_Attribute_Set is function Slk_Attr return Attributed_Character; pragma Import (C, Slk_Attr, "slk_attr"); Attr : constant Attributed_Character := Slk_Attr; begin return Attr.Attr; end Get_Soft_Label_Key_Attributes; function Get_Soft_Label_Key_Attributes return Color_Pair is function Slk_Attr return Attributed_Character; pragma Import (C, Slk_Attr, "slk_attr"); Attr : constant Attributed_Character := Slk_Attr; begin return Attr.Color; end Get_Soft_Label_Key_Attributes; procedure Set_Soft_Label_Key_Color (Pair : Color_Pair) is function Slk_Color (Color : C_Short) return C_Int; pragma Import (C, Slk_Color, "slk_color"); begin if Slk_Color (C_Short (Pair)) = Curses_Err then raise Curses_Exception; end if; end Set_Soft_Label_Key_Color; ------------------------------------------------------------------------------ procedure Enable_Key (Key : Special_Key_Code; Enable : Boolean := True) is function Keyok (Keycode : C_Int; On_Off : Curses_Bool) return C_Int; pragma Import (C, Keyok, "keyok"); begin if Keyok (C_Int (Key), Curses_Bool (Boolean'Pos (Enable))) = Curses_Err then raise Curses_Exception; end if; end Enable_Key; ------------------------------------------------------------------------------ procedure Define_Key (Definition : String; Key : Special_Key_Code) is function Defkey (Def : char_array; Key : C_Int) return C_Int; pragma Import (C, Defkey, "define_key"); Txt : char_array (0 .. Definition'Length); Length : size_t; begin To_C (Definition, Txt, Length); if Defkey (Txt, C_Int (Key)) = Curses_Err then raise Curses_Exception; end if; end Define_Key; ------------------------------------------------------------------------------ procedure Un_Control (Ch : Attributed_Character; Str : out String) is function Unctrl (Ch : Attributed_Character) return chars_ptr; pragma Import (C, Unctrl, "unctrl"); begin Fill_String (Unctrl (Ch), Str); end Un_Control; function Un_Control (Ch : Attributed_Character) return String is function Unctrl (Ch : Attributed_Character) return chars_ptr; pragma Import (C, Unctrl, "unctrl"); begin return Fill_String (Unctrl (Ch)); end Un_Control; procedure Delay_Output (Msecs : Natural) is function Delayoutput (Msecs : C_Int) return C_Int; pragma Import (C, Delayoutput, "delay_output"); begin if Delayoutput (C_Int (Msecs)) = Curses_Err then raise Curses_Exception; end if; end Delay_Output; procedure Flush_Input is function Flushinp return C_Int; pragma Import (C, Flushinp, "flushinp"); begin if Flushinp = Curses_Err then -- docu says that never happens, but... raise Curses_Exception; end if; end Flush_Input; ------------------------------------------------------------------------------ function Baudrate return Natural is function Baud return C_Int; pragma Import (C, Baud, "baudrate"); begin return Natural (Baud); end Baudrate; function Erase_Character return Character is function Erasechar return C_Int; pragma Import (C, Erasechar, "erasechar"); begin return Character'Val (Erasechar); end Erase_Character; function Kill_Character return Character is function Killchar return C_Int; pragma Import (C, Killchar, "killchar"); begin return Character'Val (Killchar); end Kill_Character; function Has_Insert_Character return Boolean is function Has_Ic return Curses_Bool; pragma Import (C, Has_Ic, "has_ic"); begin if Has_Ic = Curses_Bool_False then return False; else return True; end if; end Has_Insert_Character; function Has_Insert_Line return Boolean is function Has_Il return Curses_Bool; pragma Import (C, Has_Il, "has_il"); begin if Has_Il = Curses_Bool_False then return False; else return True; end if; end Has_Insert_Line; function Supported_Attributes return Character_Attribute_Set is function Termattrs return Attributed_Character; pragma Import (C, Termattrs, "termattrs"); Ch : constant Attributed_Character := Termattrs; begin return Ch.Attr; end Supported_Attributes; procedure Long_Name (Name : out String) is function Longname return chars_ptr; pragma Import (C, Longname, "longname"); begin Fill_String (Longname, Name); end Long_Name; function Long_Name return String is function Longname return chars_ptr; pragma Import (C, Longname, "longname"); begin return Fill_String (Longname); end Long_Name; procedure Terminal_Name (Name : out String) is function Termname return chars_ptr; pragma Import (C, Termname, "termname"); begin Fill_String (Termname, Name); end Terminal_Name; function Terminal_Name return String is function Termname return chars_ptr; pragma Import (C, Termname, "termname"); begin return Fill_String (Termname); end Terminal_Name; ------------------------------------------------------------------------------ procedure Init_Pair (Pair : Redefinable_Color_Pair; Fore : Color_Number; Back : Color_Number) is function Initpair (Pair : C_Short; Fore : C_Short; Back : C_Short) return C_Int; pragma Import (C, Initpair, "init_pair"); begin if Integer (Pair) >= Number_Of_Color_Pairs then raise Constraint_Error; end if; if Integer (Fore) >= Number_Of_Colors or else Integer (Back) >= Number_Of_Colors then raise Constraint_Error; end if; if Initpair (C_Short (Pair), C_Short (Fore), C_Short (Back)) = Curses_Err then raise Curses_Exception; end if; end Init_Pair; procedure Pair_Content (Pair : Color_Pair; Fore : out Color_Number; Back : out Color_Number) is type C_Short_Access is access all C_Short; function Paircontent (Pair : C_Short; Fp : C_Short_Access; Bp : C_Short_Access) return C_Int; pragma Import (C, Paircontent, "pair_content"); F, B : aliased C_Short; begin if Paircontent (C_Short (Pair), F'Access, B'Access) = Curses_Err then raise Curses_Exception; else Fore := Color_Number (F); Back := Color_Number (B); end if; end Pair_Content; function Has_Colors return Boolean is function Hascolors return Curses_Bool; pragma Import (C, Hascolors, "has_colors"); begin if Hascolors = Curses_Bool_False then return False; else return True; end if; end Has_Colors; procedure Init_Color (Color : Color_Number; Red : RGB_Value; Green : RGB_Value; Blue : RGB_Value) is function Initcolor (Col : C_Short; Red : C_Short; Green : C_Short; Blue : C_Short) return C_Int; pragma Import (C, Initcolor, "init_color"); begin if Initcolor (C_Short (Color), C_Short (Red), C_Short (Green), C_Short (Blue)) = Curses_Err then raise Curses_Exception; end if; end Init_Color; function Can_Change_Color return Boolean is function Canchangecolor return Curses_Bool; pragma Import (C, Canchangecolor, "can_change_color"); begin if Canchangecolor = Curses_Bool_False then return False; else return True; end if; end Can_Change_Color; procedure Color_Content (Color : Color_Number; Red : out RGB_Value; Green : out RGB_Value; Blue : out RGB_Value) is type C_Short_Access is access all C_Short; function Colorcontent (Color : C_Short; R, G, B : C_Short_Access) return C_Int; pragma Import (C, Colorcontent, "color_content"); R, G, B : aliased C_Short; begin if Colorcontent (C_Short (Color), R'Access, G'Access, B'Access) = Curses_Err then raise Curses_Exception; else Red := RGB_Value (R); Green := RGB_Value (G); Blue := RGB_Value (B); end if; end Color_Content; ------------------------------------------------------------------------------ procedure Save_Curses_Mode (Mode : Curses_Mode) is function Def_Prog_Mode return C_Int; pragma Import (C, Def_Prog_Mode, "def_prog_mode"); function Def_Shell_Mode return C_Int; pragma Import (C, Def_Shell_Mode, "def_shell_mode"); Err : C_Int; begin case Mode is when Curses => Err := Def_Prog_Mode; when Shell => Err := Def_Shell_Mode; end case; if Err = Curses_Err then raise Curses_Exception; end if; end Save_Curses_Mode; procedure Reset_Curses_Mode (Mode : Curses_Mode) is function Reset_Prog_Mode return C_Int; pragma Import (C, Reset_Prog_Mode, "reset_prog_mode"); function Reset_Shell_Mode return C_Int; pragma Import (C, Reset_Shell_Mode, "reset_shell_mode"); Err : C_Int; begin case Mode is when Curses => Err := Reset_Prog_Mode; when Shell => Err := Reset_Shell_Mode; end case; if Err = Curses_Err then raise Curses_Exception; end if; end Reset_Curses_Mode; procedure Save_Terminal_State is function Savetty return C_Int; pragma Import (C, Savetty, "savetty"); begin if Savetty = Curses_Err then raise Curses_Exception; end if; end Save_Terminal_State; procedure Reset_Terminal_State is function Resetty return C_Int; pragma Import (C, Resetty, "resetty"); begin if Resetty = Curses_Err then raise Curses_Exception; end if; end Reset_Terminal_State; procedure Rip_Off_Lines (Lines : Integer; Proc : Stdscr_Init_Proc) is function Ripoffline (Lines : C_Int; Proc : Stdscr_Init_Proc) return C_Int; pragma Import (C, Ripoffline, "_nc_ripoffline"); begin if Ripoffline (C_Int (Lines), Proc) = Curses_Err then raise Curses_Exception; end if; end Rip_Off_Lines; procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility) is function Curs_Set (Curs : C_Int) return C_Int; pragma Import (C, Curs_Set, "curs_set"); Res : C_Int; begin Res := Curs_Set (Cursor_Visibility'Pos (Visibility)); if Res /= Curses_Err then Visibility := Cursor_Visibility'Val (Res); end if; end Set_Cursor_Visibility; procedure Nap_Milli_Seconds (Ms : Natural) is function Napms (Ms : C_Int) return C_Int; pragma Import (C, Napms, "napms"); begin if Napms (C_Int (Ms)) = Curses_Err then raise Curses_Exception; end if; end Nap_Milli_Seconds; ------------------------------------------------------------------------------ function Lines return Line_Count is function LINES_As_Function return Interfaces.C.int; pragma Import (C, LINES_As_Function, "LINES_as_function"); begin return Line_Count (LINES_As_Function); end Lines; function Columns return Column_Count is function COLS_As_Function return Interfaces.C.int; pragma Import (C, COLS_As_Function, "COLS_as_function"); begin return Column_Count (COLS_As_Function); end Columns; function Tab_Size return Natural is function TABSIZE_As_Function return Interfaces.C.int; pragma Import (C, TABSIZE_As_Function, "TABSIZE_as_function"); begin return Natural (TABSIZE_As_Function); end Tab_Size; function Number_Of_Colors return Natural is function COLORS_As_Function return Interfaces.C.int; pragma Import (C, COLORS_As_Function, "COLORS_as_function"); begin return Natural (COLORS_As_Function); end Number_Of_Colors; function Number_Of_Color_Pairs return Natural is function COLOR_PAIRS_As_Function return Interfaces.C.int; pragma Import (C, COLOR_PAIRS_As_Function, "COLOR_PAIRS_as_function"); begin return Natural (COLOR_PAIRS_As_Function); end Number_Of_Color_Pairs; ------------------------------------------------------------------------------ procedure Transform_Coordinates (W : Window := Standard_Window; Line : in out Line_Position; Column : in out Column_Position; Dir : Transform_Direction := From_Screen) is type Int_Access is access all C_Int; function Transform (W : Window; Y, X : Int_Access; Dir : Curses_Bool) return C_Int; pragma Import (C, Transform, "wmouse_trafo"); X : aliased C_Int := C_Int (Column); Y : aliased C_Int := C_Int (Line); D : Curses_Bool := Curses_Bool_False; R : C_Int; begin if Dir = To_Screen then D := 1; end if; R := Transform (W, Y'Access, X'Access, D); if R = Curses_False then raise Curses_Exception; else Line := Line_Position (Y); Column := Column_Position (X); end if; end Transform_Coordinates; ------------------------------------------------------------------------------ procedure Use_Default_Colors is function C_Use_Default_Colors return C_Int; pragma Import (C, C_Use_Default_Colors, "use_default_colors"); Err : constant C_Int := C_Use_Default_Colors; begin if Err = Curses_Err then raise Curses_Exception; end if; end Use_Default_Colors; procedure Assume_Default_Colors (Fore : Color_Number := Default_Color; Back : Color_Number := Default_Color) is function C_Assume_Default_Colors (Fore : C_Int; Back : C_Int) return C_Int; pragma Import (C, C_Assume_Default_Colors, "assume_default_colors"); Err : constant C_Int := C_Assume_Default_Colors (C_Int (Fore), C_Int (Back)); begin if Err = Curses_Err then raise Curses_Exception; end if; end Assume_Default_Colors; ------------------------------------------------------------------------------ function Curses_Version return String is function curses_versionC return chars_ptr; pragma Import (C, curses_versionC, "curses_version"); Result : constant chars_ptr := curses_versionC; begin return Fill_String (Result); end Curses_Version; ------------------------------------------------------------------------------ procedure Curses_Free_All is procedure curses_freeall; pragma Import (C, curses_freeall, "_nc_freeall"); begin -- Use this only for testing: you cannot use curses after calling it, -- so it has to be the "last" thing done before exiting the program. -- This will not really free ALL of memory used by curses. That is -- because it cannot free the memory used for stdout's setbuf. The -- _nc_free_and_exit() procedure can do that, but it can be invoked -- safely only from C - and again, that only as the "last" thing done -- before exiting the program. curses_freeall; end Curses_Free_All; ------------------------------------------------------------------------------ function Use_Extended_Names (Enable : Boolean) return Boolean is function use_extended_namesC (e : Curses_Bool) return C_Int; pragma Import (C, use_extended_namesC, "use_extended_names"); Res : constant C_Int := use_extended_namesC (Curses_Bool (Boolean'Pos (Enable))); begin if Res = C_Int (Curses_Bool_False) then return False; else return True; end if; end Use_Extended_Names; ------------------------------------------------------------------------------ procedure Screen_Dump_To_File (Filename : String) is function scr_dump (f : char_array) return C_Int; pragma Import (C, scr_dump, "scr_dump"); Txt : char_array (0 .. Filename'Length); Length : size_t; begin To_C (Filename, Txt, Length); if Curses_Err = scr_dump (Txt) then raise Curses_Exception; end if; end Screen_Dump_To_File; procedure Screen_Restore_From_File (Filename : String) is function scr_restore (f : char_array) return C_Int; pragma Import (C, scr_restore, "scr_restore"); Txt : char_array (0 .. Filename'Length); Length : size_t; begin To_C (Filename, Txt, Length); if Curses_Err = scr_restore (Txt) then raise Curses_Exception; end if; end Screen_Restore_From_File; procedure Screen_Init_From_File (Filename : String) is function scr_init (f : char_array) return C_Int; pragma Import (C, scr_init, "scr_init"); Txt : char_array (0 .. Filename'Length); Length : size_t; begin To_C (Filename, Txt, Length); if Curses_Err = scr_init (Txt) then raise Curses_Exception; end if; end Screen_Init_From_File; procedure Screen_Set_File (Filename : String) is function scr_set (f : char_array) return C_Int; pragma Import (C, scr_set, "scr_set"); Txt : char_array (0 .. Filename'Length); Length : size_t; begin To_C (Filename, Txt, Length); if Curses_Err = scr_set (Txt) then raise Curses_Exception; end if; end Screen_Set_File; ------------------------------------------------------------------------------ procedure Resize (Win : Window := Standard_Window; Number_Of_Lines : Line_Count; Number_Of_Columns : Column_Count) is function wresize (win : Window; lines : C_Int; columns : C_Int) return C_Int; pragma Import (C, wresize); begin if wresize (Win, C_Int (Number_Of_Lines), C_Int (Number_Of_Columns)) = Curses_Err then raise Curses_Exception; end if; end Resize; ------------------------------------------------------------------------------ end Terminal_Interface.Curses; AdaCurses-20170708/gen/terminal_interface-curses-trace.ads.m40000644000175100001440000001441212340207631022367 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses-trace__ads.htm')dnl include(M4MACRO)------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Trace -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000,2014 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: Eugene V. Melaragno 2000 -- Version Control: -- $Revision: 1.4 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Trace is pragma Preelaborate (Terminal_Interface.Curses.Trace); type Trace_Attribute_Set is record Times : Boolean; Tputs : Boolean; Update : Boolean; Cursor_Move : Boolean; Character_Output : Boolean; Calls : Boolean; Virtual_Puts : Boolean; Input_Events : Boolean; TTY_State : Boolean; Internal_Calls : Boolean; Character_Calls : Boolean; Termcap_TermInfo : Boolean; Attribute_Color : Boolean; end record; pragma Convention (C_Pass_By_Copy, Trace_Attribute_Set); for Trace_Attribute_Set use record Times at 0 range Curses_Constants.TRACE_TIMES_First .. Curses_Constants.TRACE_TIMES_Last; Tputs at 0 range Curses_Constants.TRACE_TPUTS_First .. Curses_Constants.TRACE_TPUTS_Last; Update at 0 range Curses_Constants.TRACE_UPDATE_First .. Curses_Constants.TRACE_UPDATE_Last; Cursor_Move at 0 range Curses_Constants.TRACE_MOVE_First .. Curses_Constants.TRACE_MOVE_Last; Character_Output at 0 range Curses_Constants.TRACE_CHARPUT_First .. Curses_Constants.TRACE_CHARPUT_Last; Calls at 0 range Curses_Constants.TRACE_CALLS_First .. Curses_Constants.TRACE_CALLS_Last; Virtual_Puts at 0 range Curses_Constants.TRACE_VIRTPUT_First .. Curses_Constants.TRACE_VIRTPUT_Last; Input_Events at 0 range Curses_Constants.TRACE_IEVENT_First .. Curses_Constants.TRACE_IEVENT_Last; TTY_State at 0 range Curses_Constants.TRACE_BITS_First .. Curses_Constants.TRACE_BITS_Last; Internal_Calls at 0 range Curses_Constants.TRACE_ICALLS_First .. Curses_Constants.TRACE_ICALLS_Last; Character_Calls at 0 range Curses_Constants.TRACE_CCALLS_First .. Curses_Constants.TRACE_CCALLS_Last; Termcap_TermInfo at 0 range Curses_Constants.TRACE_DATABASE_First .. Curses_Constants.TRACE_DATABASE_Last; Attribute_Color at 0 range Curses_Constants.TRACE_ATTRS_First .. Curses_Constants.TRACE_ATTRS_Last; end record; pragma Warnings (Off); for Trace_Attribute_Set'Size use Curses_Constants.Trace_Size; pragma Warnings (On); Trace_Disable : constant Trace_Attribute_Set := (others => False); Trace_Ordinary : constant Trace_Attribute_Set := (Times => True, Tputs => True, Update => True, Cursor_Move => True, Character_Output => True, others => False); Trace_Maximum : constant Trace_Attribute_Set := (others => True); ------------------------------------------------------------------------------ -- MANPAGE(`curs_trace.3x') -- ANCHOR(`trace()',`Trace_on') procedure Trace_On (x : Trace_Attribute_Set); -- The debugging library has trace. -- ANCHOR(`_tracef()',`Trace_Put') procedure Trace_Put (str : String); -- AKA Current_Trace_Setting : Trace_Attribute_Set; pragma Import (C, Current_Trace_Setting, "_nc_tracing"); end Terminal_Interface.Curses.Trace; AdaCurses-20170708/gen/terminal_interface-curses-menus-item_user_data.ads.m40000644000175100001440000001000311315444167025403 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses-menus-item_user_data__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Menus.Item_User_Data -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2006,2009 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, 1996 -- Version Control: -- $Revision: 1.17 $ -- $Date: 2009/12/26 17:31:35 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type User is limited private; type User_Access is access User; package Terminal_Interface.Curses.Menus.Item_User_Data is pragma Preelaborate (Terminal_Interface.Curses.Menus.Item_User_Data); -- The binding uses the same user pointer for menu items -- as the low level C implementation. So you can safely -- read or write the user pointer also with the C routines -- -- MANPAGE(`mitem_userptr.3x') -- ANCHOR(`set_item_userptr',`Set_User_Data') procedure Set_User_Data (Itm : Item; Data : User_Access); -- AKA pragma Inline (Set_User_Data); -- ANCHOR(`item_userptr',`Get_User_Data') procedure Get_User_Data (Itm : Item; Data : out User_Access); -- AKA -- ANCHOR(`item_userptr',`Get_User_Data') function Get_User_Data (Itm : Item) return User_Access; -- AKA -- Same as function pragma Inline (Get_User_Data); end Terminal_Interface.Curses.Menus.Item_User_Data; AdaCurses-20170708/gen/terminal_interface-curses-mouse.ads.m40000644000175100001440000002226412532442567022441 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses-mouse__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Mouse -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2014,2015 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, 1996 -- Version Control: -- $Revision: 1.32 $ -- $Date: 2015/05/30 23:19:19 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; package Terminal_Interface.Curses.Mouse is pragma Preelaborate (Terminal_Interface.Curses.Mouse); -- MANPAGE(`curs_mouse.3x') -- mouse_trafo, wmouse_trafo are implemented as Transform_Coordinates -- in the parent package. -- -- Not implemented: -- REPORT_MOUSE_POSITION (i.e. as a parameter to Register_Reportable_Event -- or Start_Mouse) type Event_Mask is private; No_Events : constant Event_Mask; All_Events : constant Event_Mask; type Mouse_Button is (Left, -- aka: Button 1 Middle, -- aka: Button 2 Right, -- aka: Button 3 Button4, -- aka: Button 4 Control, -- Control Key Shift, -- Shift Key Alt); -- ALT Key subtype Real_Buttons is Mouse_Button range Left .. Button4; subtype Modifier_Keys is Mouse_Button range Control .. Alt; type Button_State is (Released, Pressed, Clicked, Double_Clicked, Triple_Clicked); type Button_States is array (Button_State) of Boolean; pragma Pack (Button_States); All_Clicks : constant Button_States := (Clicked .. Triple_Clicked => True, others => False); All_States : constant Button_States := (others => True); type Mouse_Event is private; -- MANPAGE(`curs_mouse.3x') function Has_Mouse return Boolean; -- Return true if a mouse device is supported, false otherwise. procedure Register_Reportable_Event (Button : Mouse_Button; State : Button_State; Mask : in out Event_Mask); -- Stores the event described by the button and the state in the mask. -- Before you call this the first time, you should initialize the mask -- with the Empty_Mask constant pragma Inline (Register_Reportable_Event); procedure Register_Reportable_Events (Button : Mouse_Button; State : Button_States; Mask : in out Event_Mask); -- Register all events described by the Button and the State bitmap. -- Before you call this the first time, you should initialize the mask -- with the Empty_Mask constant -- ANCHOR(`mousemask()',`Start_Mouse') -- There is one difference to mousmask(): we return the value of the -- old mask, that means the event mask value before this call. -- Not Implemented: The library version -- returns a Mouse_Mask that tells which events are reported. function Start_Mouse (Mask : Event_Mask := All_Events) return Event_Mask; -- AKA pragma Inline (Start_Mouse); procedure End_Mouse (Mask : Event_Mask := No_Events); -- Terminates the mouse, restores the specified event mask pragma Inline (End_Mouse); -- ANCHOR(`getmouse()',`Get_Mouse') function Get_Mouse return Mouse_Event; -- AKA pragma Inline (Get_Mouse); procedure Get_Event (Event : Mouse_Event; Y : out Line_Position; X : out Column_Position; Button : out Mouse_Button; State : out Button_State); -- !!! Warning: X and Y are screen coordinates. Due to ripped of lines they -- may not be identical to window coordinates. -- Not Implemented: Get_Event only reports one event, the C library -- version supports multiple events, e.g. {click-1, click-3} pragma Inline (Get_Event); -- ANCHOR(`ungetmouse()',`Unget_Mouse') procedure Unget_Mouse (Event : Mouse_Event); -- AKA pragma Inline (Unget_Mouse); -- ANCHOR(`wenclose()',`Enclosed_In_Window') function Enclosed_In_Window (Win : Window := Standard_Window; Event : Mouse_Event) return Boolean; -- AKA -- But : use event instead of screen coordinates. pragma Inline (Enclosed_In_Window); -- ANCHOR(`mouseinterval()',`Mouse_Interval') function Mouse_Interval (Msec : Natural := 200) return Natural; -- AKA pragma Inline (Mouse_Interval); private -- This can be as little as 32 bits (unsigned), or as long as the system's -- unsigned long. Declare it as the minimum size to handle all valid -- sizes. type Event_Mask is mod 4294967296; type Mouse_Event is record Id : Integer range Integer (Interfaces.C.short'First) .. Integer (Interfaces.C.short'Last); X, Y, Z : Integer range Integer (Interfaces.C.int'First) .. Integer (Interfaces.C.int'Last); Bstate : Event_Mask; end record; pragma Convention (C, Mouse_Event); for Mouse_Event use record Id at 0 range Curses_Constants.MEVENT_id_First .. Curses_Constants.MEVENT_id_Last; X at 0 range Curses_Constants.MEVENT_x_First .. Curses_Constants.MEVENT_x_Last; Y at 0 range Curses_Constants.MEVENT_y_First .. Curses_Constants.MEVENT_y_Last; Z at 0 range Curses_Constants.MEVENT_z_First .. Curses_Constants.MEVENT_z_Last; Bstate at 0 range Curses_Constants.MEVENT_bstate_First .. Curses_Constants.MEVENT_bstate_Last; end record; for Mouse_Event'Size use Curses_Constants.MEVENT_Size; Generation_Bit_Order : System.Bit_Order renames Curses_Constants.Bit_Order; BUTTON_CTRL : constant Event_Mask := Curses_Constants.BUTTON_CTRL; BUTTON_SHIFT : constant Event_Mask := Curses_Constants.BUTTON_SHIFT; BUTTON_ALT : constant Event_Mask := Curses_Constants.BUTTON_ALT; BUTTON1_EVENTS : constant Event_Mask := Curses_Constants.all_events_button_1; BUTTON2_EVENTS : constant Event_Mask := Curses_Constants.all_events_button_2; BUTTON3_EVENTS : constant Event_Mask := Curses_Constants.all_events_button_3; BUTTON4_EVENTS : constant Event_Mask := Curses_Constants.all_events_button_4; ALL_MOUSE_EVENTS : constant Event_Mask := Curses_Constants.ALL_MOUSE_EVENTS; No_Events : constant Event_Mask := 0; All_Events : constant Event_Mask := ALL_MOUSE_EVENTS; end Terminal_Interface.Curses.Mouse; AdaCurses-20170708/gen/normal.m40000644000175100001440000000476310422534476014701 0ustar tomusersdnl*************************************************************************** dnl Copyright (c) 1998,2006 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * dnl "Software"), to deal in the Software without restriction, including * dnl without limitation the rights to use, copy, modify, merge, publish, * dnl distribute, distribute with modifications, sublicense, and/or sell * dnl copies of the Software, and to permit persons to whom the Software is * dnl furnished to do so, subject to the following conditions: * dnl * dnl The above copyright notice and this permission notice shall be included * dnl in all copies or substantial portions of the Software. * dnl * dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * dnl * dnl Except as contained in this notice, the name(s) of the above copyright * dnl holders shall not be used in advertising or otherwise to promote the * dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl dnl $Id: normal.m4,v 1.2 2006/04/22 23:16:14 tom Exp $ define(`MANPAGE',`define(`MANPG',$1)dnl |===================================================================== -- | Man page MANPG -- |=====================================================================')dnl define(`ANCHOR',`define(`CFUNAME',`$1')define(`AFUNAME',`$2')'dnl |)dnl define(`AKA',``AKA': CFUNAME')dnl define(`ALIAS',``AKA': $1')dnl AdaCurses-20170708/gen/terminal_interface-curses-menus-menu_user_data.ads.m40000644000175100001440000000744311315446021025416 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses-menus-menu_user_data__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Menus.Menu_User_Data -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.15 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type User is limited private; type User_Access is access User; package Terminal_Interface.Curses.Menus.Menu_User_Data is pragma Preelaborate (Terminal_Interface.Curses.Menus.Menu_User_Data); -- MANPAGE(`menu_userptr.3x') -- ANCHOR(`set_menu_userptr',`Set_User_Data') procedure Set_User_Data (Men : Menu; Data : User_Access); -- AKA pragma Inline (Set_User_Data); -- ANCHOR(`menu_userptr',`Get_User_Data') procedure Get_User_Data (Men : Menu; Data : out User_Access); -- AKA -- ANCHOR(`menu_userptr',`Get_User_Data') function Get_User_Data (Men : Menu) return User_Access; -- AKA -- Same as function pragma Inline (Get_User_Data); end Terminal_Interface.Curses.Menus.Menu_User_Data; AdaCurses-20170708/gen/Makefile.in0000644000175100001440000002753212560513367015214 0ustar tomusers############################################################################## # Copyright (c) 1998-2014,2015 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, 1996 # # $Id: Makefile.in,v 1.85 2015/08/05 23:06:31 tom Exp $ # .SUFFIXES: SHELL = @SHELL@ VPATH = @srcdir@ THIS = Makefile x = @EXEEXT@ top_srcdir = @top_srcdir@ DESTDIR = @DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ includedir = @includedir@ INSTALL = @INSTALL@ INSTALL_PROG = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ AWK = @AWK@ LN_S = @LN_S@ CC = @CC@ HOST_CC = @BUILD_CC@ CFLAGS = @CFLAGS@ HOST_CFLAGS = @BUILD_CFLAGS@ CPPFLAGS = @CPPFLAGS@ HOST_CPPFLAGS = @ACPPFLAGS@ @BUILD_CPPFLAGS@ \ -DHAVE_CONFIG_H -I$(srcdir) CCFLAGS = $(HOST_CPPFLAGS) $(HOST_CFLAGS) CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) REL_VERSION = @cf_cv_rel_version@ ABI_VERSION = @cf_cv_abi_version@ LOCAL_LIBDIR = @top_builddir@/lib LINK = $(HOST_CC) LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ # For the wide-character configuration combined with broken_linker, we need # addresses of ACS_xxx constants, which requires linking with the newly built # ncurses library. If cross-compiling, the developer has to fill in a workable # native library for this purpose. NATIVE_LDFLAGS = @LD_MODEL@ $(LOCAL_LIBS) @TINFO_LDFLAGS2@ $(LDFLAGS) @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_LIBS@ CROSS_LDFLAGS = @BUILD_LDFLAGS@ @BUILD_LIBS@ ACTUAL_LDFLAGS = @ADAGEN_LDFLAGS@ RANLIB = @RANLIB@ M4 = m4 M4FLAGS = -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@ ADACURSES_CONFIG = adacurses@USE_CFG_SUFFIX@-config WRAPPER = @NCURSES_SHLIB2@ PROG_GENERATE = ./generate$x GENERATE = $(PROG_GENERATE) '@DFT_ARG_SUFFIX@' DEL_ADAMODE = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d' GNATHTML = `type -p gnathtml || type -p gnathtml.pl 2>/dev/null` GNATHP = www.gnat.com ################################################################################ ALIB = @cf_ada_package@ ABASE = $(ALIB)-curses ADA_SRCDIR = ../src GEN_TARGETS = $(ADA_SRCDIR)/$(ABASE).ads \ $(ADA_SRCDIR)/$(ABASE).adb \ $(ADA_SRCDIR)/$(ABASE)-aux.ads \ $(ADA_SRCDIR)/$(ABASE)-trace.ads \ $(ADA_SRCDIR)/$(ABASE)-menus.ads \ $(ADA_SRCDIR)/$(ABASE)-forms.ads \ $(ADA_SRCDIR)/$(ABASE)-mouse.ads \ $(ADA_SRCDIR)/$(ABASE)-panels.ads \ $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads \ $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads \ $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads \ $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads \ $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads \ $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads \ $(ADA_SRCDIR)/$(ABASE)_constants.ads GEN_SRC = $(srcdir)/$(ABASE).ads.m4 \ $(srcdir)/$(ABASE).adb.m4 \ $(srcdir)/$(ABASE)-aux.ads.m4 \ $(srcdir)/$(ABASE)-trace.ads.m4 \ $(srcdir)/$(ABASE)-menus.ads.m4 \ $(srcdir)/$(ABASE)-forms.ads.m4 \ $(srcdir)/$(ABASE)-mouse.ads.m4 \ $(srcdir)/$(ABASE)-panels.ads.m4 \ $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \ $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \ $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \ $(srcdir)/$(ABASE)-forms-field_types.ads.m4 \ $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \ $(srcdir)/$(ABASE)-panels-user_data.ads.m4 all \ libs : $(GEN_TARGETS) @echo made $@ sources: $(DESTDIR)$(bindir) : mkdir -p $@ install \ install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG) $(INSTALL_PROG) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG) uninstall \ uninstall.libs :: -rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG) $(PROG_GENERATE): gen.o @ECHO_LD@ $(LINK) $(CFLAGS_NORMAL) gen.o $(ACTUAL_LDFLAGS) -o $@ gen.o: $(srcdir)/gen.c $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c $(ADA_SRCDIR)/$(ABASE)_constants.ads: $(PROG_GENERATE) $(WRAPPER) "$(GENERATE)" >$@ ################################################################################ $(ADA_SRCDIR)/$(ABASE).ads: $(srcdir)/$(ABASE).ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE).ads.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE).adb: $(srcdir)/$(ABASE).adb.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE).adb.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-aux.ads.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-trace.ads.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-menus.ads.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-forms.ads.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-mouse.ads.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-panels.ads.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads: \ $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads: \ $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads: \ $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads: \ $(srcdir)/$(ABASE)-forms-field_types.ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-forms-field_types.ads.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads: \ $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 |\ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads: \ $(srcdir)/$(ABASE)-panels-user_data.ads.m4 \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\ $(DEL_ADAMODE) >$@ install.progs :: tags: ctags *.[ch] @MAKE_UPPER_TAGS@TAGS: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: -rm -f a.out core $(PROG_GENERATE) *.o clean :: mostlyclean -rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp distclean :: clean -rm -f $(ADACURSES_CONFIG) -rm -f Makefile realclean :: distclean HTML_DIR = @ADAHTML_DIR@ instab.tmp : table.m4 $(GEN_SRC) @rm -f $@ @for f in $(GEN_SRC) ; do \ $(M4) $(M4FLAGS) -DM4MACRO=table.m4 $$f | $(DEL_ADAMODE) >> $@ ;\ done; $(HTML_DIR)/table.html : instab.tmp @-touch $@ @-chmod +w $@ @echo ' $@ @echo 'PUBLIC "-//IETF//DTD HTML 3.0//EN">' >> $@ @echo '' >> $@ @echo '' >> $@ @echo 'Correspondence between ncurses C and Ada functions' >>$@ @echo '' >> $@ @echo '' >> $@ @echo '

Correspondence between ncurses C and Ada functions

' >>$@ @echo '

Sorted by C function name

' >>$@ @echo '' >>$@ @echo '' >>$@ @echo '' >>$@ @sort < instab.tmp >> $@ @echo '
C nameAda nameman page
' >>$@ @rm -f instab.tmp adahtml: test -n "$(GNATHTML)" || exit 1 @find $(HTML_DIR) -type f -exec rm -f {} \; @mkdir -p $(HTML_DIR) cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb] @USE_OLD_MAKERULES@ ln -sf ../src/*.ali . @USE_GNAT_PROJECTS@ ln -sf ../static-ali/*.ali . @echo "Filtering generated files" @for f in $(GEN_SRC); do \ h=`basename $$f` ;\ g=`basename $$f .ads.m4` ;\ if test "$$g" != "$$h" ; then \ $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\ echo "... $$g.ads" ;\ fi \ done @-rm -f $(HTML_DIR)/$(ALIB)*.htm* $(GNATHTML) -d -f $(ALIB)*.ads for f in html/$(ALIB)*.htm*; do \ a=`basename $$f` ; \ sed -e 's/You may also.*body.*//' <$$f |\ sed -e 's%GNAT%GNAT%g' |\ sed -e 's%<A HREF%%g' |\ sed -e 's/3X/3x/g' |\ sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\ sed -e 's%</A>%%g' > $$a.tmp ;\ mv $$a.tmp $$f ;\ done @rm -f *.ad[sb] *.ali *.tmp @for f in funcs.htm main.htm ; do \ sed -e "\%\[ \]%d" < html/$$f > $$f ;\ mv $$f html/$$f ;\ done @rm -f "html/funcs/ .htm" @cp -pdrf html/* $(HTML_DIR)/ @rm -rf html html : adahtml $(HTML_DIR)/table.html @echo made $@ ############################################################################### # The remainder of this file is automatically generated during configuration ############################################################################### AdaCurses-20170708/gen/terminal_interface-curses-forms-field_user_data.ads.m40000644000175100001440000000746311315446021025536 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses-forms-field_user_data__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_User_Data -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.16 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type User is limited private; type User_Access is access User; package Terminal_Interface.Curses.Forms.Field_User_Data is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_User_Data); -- MANPAGE(`form_field_userptr.3x') -- ANCHOR(`set_field_userptr',`Set_User_Data') procedure Set_User_Data (Fld : Field; Data : User_Access); -- AKA pragma Inline (Set_User_Data); -- ANCHOR(`field_userptr',`Get_User_Data') procedure Get_User_Data (Fld : Field; Data : out User_Access); -- AKA -- ANCHOR(`field_userptr',`Get_User_Data') function Get_User_Data (Fld : Field) return User_Access; -- AKA -- Sama as function pragma Inline (Get_User_Data); end Terminal_Interface.Curses.Forms.Field_User_Data; AdaCurses-20170708/gen/table.m40000644000175100001440000000464710422534534014474 0ustar tomusersdnl*************************************************************************** dnl Copyright (c) 2000,2006 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * dnl "Software"), to deal in the Software without restriction, including * dnl without limitation the rights to use, copy, modify, merge, publish, * dnl distribute, distribute with modifications, sublicense, and/or sell * dnl copies of the Software, and to permit persons to whom the Software is * dnl furnished to do so, subject to the following conditions: * dnl * dnl The above copyright notice and this permission notice shall be included * dnl in all copies or substantial portions of the Software. * dnl * dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * dnl * dnl Except as contained in this notice, the name(s) of the above copyright * dnl holders shall not be used in advertising or otherwise to promote the * dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl dnl $Id: table.m4,v 1.2 2006/04/22 23:16:44 tom Exp $ define(`ANCHORIDX',`0')dnl define(`MANPAGE',`define(`MANPG',$1)')dnl divert(-1)dnl define(`ANCHOR',`divert(0)define(`ANCHORIDX',incr(ANCHORIDX))dnl $1$2MANPG divert(-1)') AdaCurses-20170708/gen/terminal_interface-curses-panels-user_data.ads.m40000644000175100001440000000742611315445551024535 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses-panels-user_data__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Panels.User_Data -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.15 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type User is limited private; type User_Access is access all User; package Terminal_Interface.Curses.Panels.User_Data is pragma Preelaborate (Terminal_Interface.Curses.Panels.User_Data); -- MANPAGE(`panel.3x') -- ANCHOR(`set_panel_userptr',`Set_User_Data') procedure Set_User_Data (Pan : Panel; Data : User_Access); -- AKA pragma Inline (Set_User_Data); -- ANCHOR(`panel_userptr',`Get_User_Data') procedure Get_User_Data (Pan : Panel; Data : out User_Access); -- AKA -- ANCHOR(`panel_userptr',`Get_User_Data') function Get_User_Data (Pan : Panel) return User_Access; -- AKA -- Same as function pragma Inline (Get_User_Data); end Terminal_Interface.Curses.Panels.User_Data; AdaCurses-20170708/gen/terminal_interface-curses-menus.ads.m40000644000175100001440000005356112340207715022433 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses-menus__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Menu -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2014 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, 1996 -- Version Control: -- $Revision: 1.31 $ -- $Date: 2014/05/24 21:31:57 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; with Ada.Characters.Latin_1; package Terminal_Interface.Curses.Menus is pragma Preelaborate (Terminal_Interface.Curses.Menus); pragma Linker_Options ("-lmenu" & Curses_Constants.DFT_ARG_SUFFIX); Space : Character renames Ada.Characters.Latin_1.Space; type Item is private; type Menu is private; --------------------------- -- Interface constants -- --------------------------- Null_Item : constant Item; Null_Menu : constant Menu; subtype Menu_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 17); -- The prefix M_ stands for "Menu Request" M_Left_Item : constant Menu_Request_Code := Key_Max + 1; M_Right_Item : constant Menu_Request_Code := Key_Max + 2; M_Up_Item : constant Menu_Request_Code := Key_Max + 3; M_Down_Item : constant Menu_Request_Code := Key_Max + 4; M_ScrollUp_Line : constant Menu_Request_Code := Key_Max + 5; M_ScrollDown_Line : constant Menu_Request_Code := Key_Max + 6; M_ScrollDown_Page : constant Menu_Request_Code := Key_Max + 7; M_ScrollUp_Page : constant Menu_Request_Code := Key_Max + 8; M_First_Item : constant Menu_Request_Code := Key_Max + 9; M_Last_Item : constant Menu_Request_Code := Key_Max + 10; M_Next_Item : constant Menu_Request_Code := Key_Max + 11; M_Previous_Item : constant Menu_Request_Code := Key_Max + 12; M_Toggle_Item : constant Menu_Request_Code := Key_Max + 13; M_Clear_Pattern : constant Menu_Request_Code := Key_Max + 14; M_Back_Pattern : constant Menu_Request_Code := Key_Max + 15; M_Next_Match : constant Menu_Request_Code := Key_Max + 16; M_Previous_Match : constant Menu_Request_Code := Key_Max + 17; -- For those who like the old 'C' names for the request codes REQ_LEFT_ITEM : Menu_Request_Code renames M_Left_Item; REQ_RIGHT_ITEM : Menu_Request_Code renames M_Right_Item; REQ_UP_ITEM : Menu_Request_Code renames M_Up_Item; REQ_DOWN_ITEM : Menu_Request_Code renames M_Down_Item; REQ_SCR_ULINE : Menu_Request_Code renames M_ScrollUp_Line; REQ_SCR_DLINE : Menu_Request_Code renames M_ScrollDown_Line; REQ_SCR_DPAGE : Menu_Request_Code renames M_ScrollDown_Page; REQ_SCR_UPAGE : Menu_Request_Code renames M_ScrollUp_Page; REQ_FIRST_ITEM : Menu_Request_Code renames M_First_Item; REQ_LAST_ITEM : Menu_Request_Code renames M_Last_Item; REQ_NEXT_ITEM : Menu_Request_Code renames M_Next_Item; REQ_PREV_ITEM : Menu_Request_Code renames M_Previous_Item; REQ_TOGGLE_ITEM : Menu_Request_Code renames M_Toggle_Item; REQ_CLEAR_PATTERN : Menu_Request_Code renames M_Clear_Pattern; REQ_BACK_PATTERN : Menu_Request_Code renames M_Back_Pattern; REQ_NEXT_MATCH : Menu_Request_Code renames M_Next_Match; REQ_PREV_MATCH : Menu_Request_Code renames M_Previous_Match; procedure Request_Name (Key : Menu_Request_Code; Name : out String); function Request_Name (Key : Menu_Request_Code) return String; -- Same as function ------------------ -- Exceptions -- ------------------ Menu_Exception : exception; -- -- Menu options -- type Menu_Option_Set is record One_Valued : Boolean; Show_Descriptions : Boolean; Row_Major_Order : Boolean; Ignore_Case : Boolean; Show_Matches : Boolean; Non_Cyclic : Boolean; end record; pragma Convention (C_Pass_By_Copy, Menu_Option_Set); for Menu_Option_Set use record One_Valued at 0 range Curses_Constants.O_ONEVALUE_First .. Curses_Constants.O_ONEVALUE_Last; Show_Descriptions at 0 range Curses_Constants.O_SHOWDESC_First .. Curses_Constants.O_SHOWDESC_Last; Row_Major_Order at 0 range Curses_Constants.O_ROWMAJOR_First .. Curses_Constants.O_ROWMAJOR_Last; Ignore_Case at 0 range Curses_Constants.O_IGNORECASE_First .. Curses_Constants.O_IGNORECASE_Last; Show_Matches at 0 range Curses_Constants.O_SHOWMATCH_First .. Curses_Constants.O_SHOWMATCH_Last; Non_Cyclic at 0 range Curses_Constants.O_NONCYCLIC_First .. Curses_Constants.O_NONCYCLIC_Last; end record; pragma Warnings (Off); for Menu_Option_Set'Size use Curses_Constants.Menu_Options_Size; pragma Warnings (On); function Default_Menu_Options return Menu_Option_Set; -- Initial default options for a menu. pragma Inline (Default_Menu_Options); -- -- Item options -- type Item_Option_Set is record Selectable : Boolean; end record; pragma Convention (C_Pass_By_Copy, Item_Option_Set); for Item_Option_Set use record Selectable at 0 range Curses_Constants.O_SELECTABLE_First .. Curses_Constants.O_SELECTABLE_Last; end record; pragma Warnings (Off); for Item_Option_Set'Size use Curses_Constants.Item_Options_Size; pragma Warnings (On); function Default_Item_Options return Item_Option_Set; -- Initial default options for an item. pragma Inline (Default_Item_Options); -- -- Item Array -- type Item_Array is array (Positive range <>) of aliased Item; pragma Convention (C, Item_Array); type Item_Array_Access is access Item_Array; procedure Free (IA : in out Item_Array_Access; Free_Items : Boolean := False); -- Release the memory for an allocated item array -- If Free_Items is True, call Delete() for all the items in -- the array. -- MANPAGE(`mitem_new.3x') -- ANCHOR(`new_item()',`Create') function Create (Name : String; Description : String := "") return Item; -- AKA -- Not inlined. -- ANCHOR(`new_item()',`New_Item') function New_Item (Name : String; Description : String := "") return Item renames Create; -- AKA -- ANCHOR(`free_item()',`Delete') procedure Delete (Itm : in out Item); -- AKA -- Resets Itm to Null_Item -- MANPAGE(`mitem_value.3x') -- ANCHOR(`set_item_value()',`Set_Value') procedure Set_Value (Itm : Item; Value : Boolean := True); -- AKA pragma Inline (Set_Value); -- ANCHOR(`item_value()',`Value') function Value (Itm : Item) return Boolean; -- AKA pragma Inline (Value); -- MANPAGE(`mitem_visible.3x') -- ANCHOR(`item_visible()',`Visible') function Visible (Itm : Item) return Boolean; -- AKA pragma Inline (Visible); -- MANPAGE(`mitem_opts.3x') -- ANCHOR(`set_item_opts()',`Set_Options') procedure Set_Options (Itm : Item; Options : Item_Option_Set); -- AKA -- An overloaded Set_Options is defined later. Pragma Inline appears there -- ANCHOR(`item_opts_on()',`Switch_Options') procedure Switch_Options (Itm : Item; Options : Item_Option_Set; On : Boolean := True); -- AKA -- ALIAS(`item_opts_off()') -- An overloaded Switch_Options is defined later. -- Pragma Inline appears there -- ANCHOR(`item_opts()',`Get_Options') procedure Get_Options (Itm : Item; Options : out Item_Option_Set); -- AKA -- ANCHOR(`item_opts()',`Get_Options') function Get_Options (Itm : Item := Null_Item) return Item_Option_Set; -- AKA -- An overloaded Get_Options is defined later. Pragma Inline appears there -- MANPAGE(`mitem_name.3x') -- ANCHOR(`item_name()',`Name') procedure Name (Itm : Item; Name : out String); -- AKA function Name (Itm : Item) return String; -- AKA -- Implemented as function pragma Inline (Name); -- ANCHOR(`item_description();',`Description') procedure Description (Itm : Item; Description : out String); -- AKA function Description (Itm : Item) return String; -- AKA -- Implemented as function pragma Inline (Description); -- MANPAGE(`mitem_current.3x') -- ANCHOR(`set_current_item()',`Set_Current') procedure Set_Current (Men : Menu; Itm : Item); -- AKA pragma Inline (Set_Current); -- ANCHOR(`current_item()',`Current') function Current (Men : Menu) return Item; -- AKA pragma Inline (Current); -- ANCHOR(`set_top_row()',`Set_Top_Row') procedure Set_Top_Row (Men : Menu; Line : Line_Position); -- AKA pragma Inline (Set_Top_Row); -- ANCHOR(`top_row()',`Top_Row') function Top_Row (Men : Menu) return Line_Position; -- AKA pragma Inline (Top_Row); -- ANCHOR(`item_index()',`Get_Index') function Get_Index (Itm : Item) return Positive; -- AKA -- Please note that in this binding we start the numbering of items -- with 1. So this is number is one more than you get from the low -- level call. pragma Inline (Get_Index); -- MANPAGE(`menu_post.3x') -- ANCHOR(`post_menu()',`Post') procedure Post (Men : Menu; Post : Boolean := True); -- AKA -- ALIAS(`unpost_menu()') pragma Inline (Post); -- MANPAGE(`menu_opts.3x') -- ANCHOR(`set_menu_opts()',`Set_Options') procedure Set_Options (Men : Menu; Options : Menu_Option_Set); -- AKA pragma Inline (Set_Options); -- ANCHOR(`menu_opts_on()',`Switch_Options') procedure Switch_Options (Men : Menu; Options : Menu_Option_Set; On : Boolean := True); -- AKA -- ALIAS(`menu_opts_off()') pragma Inline (Switch_Options); -- ANCHOR(`menu_opts()',`Get_Options') procedure Get_Options (Men : Menu; Options : out Menu_Option_Set); -- AKA -- ANCHOR(`menu_opts()',`Get_Options') function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set; -- AKA pragma Inline (Get_Options); -- MANPAGE(`menu_win.3x') -- ANCHOR(`set_menu_win()',`Set_Window') procedure Set_Window (Men : Menu; Win : Window); -- AKA pragma Inline (Set_Window); -- ANCHOR(`menu_win()',`Get_Window') function Get_Window (Men : Menu) return Window; -- AKA pragma Inline (Get_Window); -- ANCHOR(`set_menu_sub()',`Set_Sub_Window') procedure Set_Sub_Window (Men : Menu; Win : Window); -- AKA pragma Inline (Set_Sub_Window); -- ANCHOR(`menu_sub()',`Get_Sub_Window') function Get_Sub_Window (Men : Menu) return Window; -- AKA pragma Inline (Get_Sub_Window); -- ANCHOR(`scale_menu()',`Scale') procedure Scale (Men : Menu; Lines : out Line_Count; Columns : out Column_Count); -- AKA pragma Inline (Scale); -- MANPAGE(`menu_cursor.3x') -- ANCHOR(`pos_menu_cursor()',`Position_Cursor') procedure Position_Cursor (Men : Menu); -- AKA pragma Inline (Position_Cursor); -- MANPAGE(`menu_mark.3x') -- ANCHOR(`set_menu_mark()',`Set_Mark') procedure Set_Mark (Men : Menu; Mark : String); -- AKA pragma Inline (Set_Mark); -- ANCHOR(`menu_mark()',`Mark') procedure Mark (Men : Menu; Mark : out String); -- AKA function Mark (Men : Menu) return String; -- AKA -- Implemented as function pragma Inline (Mark); -- MANPAGE(`menu_attributes.3x') -- ANCHOR(`set_menu_fore()',`Set_Foreground') procedure Set_Foreground (Men : Menu; Fore : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First); -- AKA pragma Inline (Set_Foreground); -- ANCHOR(`menu_fore()',`Foreground') procedure Foreground (Men : Menu; Fore : out Character_Attribute_Set); -- AKA -- ANCHOR(`menu_fore()',`Foreground') procedure Foreground (Men : Menu; Fore : out Character_Attribute_Set; Color : out Color_Pair); -- AKA pragma Inline (Foreground); -- ANCHOR(`set_menu_back()',`Set_Background') procedure Set_Background (Men : Menu; Back : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First); -- AKA pragma Inline (Set_Background); -- ANCHOR(`menu_back()',`Background') procedure Background (Men : Menu; Back : out Character_Attribute_Set); -- AKA -- ANCHOR(`menu_back()',`Background') procedure Background (Men : Menu; Back : out Character_Attribute_Set; Color : out Color_Pair); -- AKA pragma Inline (Background); -- ANCHOR(`set_menu_grey()',`Set_Grey') procedure Set_Grey (Men : Menu; Grey : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First); -- AKA pragma Inline (Set_Grey); -- ANCHOR(`menu_grey()',`Grey') procedure Grey (Men : Menu; Grey : out Character_Attribute_Set); -- AKA -- ANCHOR(`menu_grey()',`Grey') procedure Grey (Men : Menu; Grey : out Character_Attribute_Set; Color : out Color_Pair); -- AKA pragma Inline (Grey); -- ANCHOR(`set_menu_pad()',`Set_Pad_Character') procedure Set_Pad_Character (Men : Menu; Pad : Character := Space); -- AKA pragma Inline (Set_Pad_Character); -- ANCHOR(`menu_pad()',`Pad_Character') procedure Pad_Character (Men : Menu; Pad : out Character); -- AKA pragma Inline (Pad_Character); -- MANPAGE(`menu_spacing.3x') -- ANCHOR(`set_menu_spacing()',`Set_Spacing') procedure Set_Spacing (Men : Menu; Descr : Column_Position := 0; Row : Line_Position := 0; Col : Column_Position := 0); -- AKA pragma Inline (Set_Spacing); -- ANCHOR(`menu_spacing()',`Spacing') procedure Spacing (Men : Menu; Descr : out Column_Position; Row : out Line_Position; Col : out Column_Position); -- AKA pragma Inline (Spacing); -- MANPAGE(`menu_pattern.3x') -- ANCHOR(`set_menu_pattern()',`Set_Pattern') function Set_Pattern (Men : Menu; Text : String) return Boolean; -- AKA -- Return TRUE if the pattern matches, FALSE otherwise pragma Inline (Set_Pattern); -- ANCHOR(`menu_pattern()',`Pattern') procedure Pattern (Men : Menu; Text : out String); -- AKA pragma Inline (Pattern); -- MANPAGE(`menu_format.3x') -- ANCHOR(`set_menu_format()',`Set_Format') procedure Set_Format (Men : Menu; Lines : Line_Count; Columns : Column_Count); -- Not implemented: 0 argument for Lines or Columns; -- instead use Format to get the current sizes -- The default format is 16 rows, 1 column. Calling -- set_menu_format with a null menu pointer will change this -- default. A zero row or column argument to set_menu_format -- is interpreted as a request not to change the current -- value. -- AKA pragma Inline (Set_Format); -- ANCHOR(`menu_format()',`Format') procedure Format (Men : Menu; Lines : out Line_Count; Columns : out Column_Count); -- AKA pragma Inline (Format); -- MANPAGE(`menu_hook.3x') type Menu_Hook_Function is access procedure (Men : Menu); pragma Convention (C, Menu_Hook_Function); -- ANCHOR(`set_item_init()',`Set_Item_Init_Hook') procedure Set_Item_Init_Hook (Men : Menu; Proc : Menu_Hook_Function); -- AKA pragma Inline (Set_Item_Init_Hook); -- ANCHOR(`set_item_term()',`Set_Item_Term_Hook') procedure Set_Item_Term_Hook (Men : Menu; Proc : Menu_Hook_Function); -- AKA pragma Inline (Set_Item_Term_Hook); -- ANCHOR(`set_menu_init()',`Set_Menu_Init_Hook') procedure Set_Menu_Init_Hook (Men : Menu; Proc : Menu_Hook_Function); -- AKA pragma Inline (Set_Menu_Init_Hook); -- ANCHOR(`set_menu_term()',`Set_Menu_Term_Hook') procedure Set_Menu_Term_Hook (Men : Menu; Proc : Menu_Hook_Function); -- AKA pragma Inline (Set_Menu_Term_Hook); -- ANCHOR(`item_init()',`Get_Item_Init_Hook') function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function; -- AKA pragma Inline (Get_Item_Init_Hook); -- ANCHOR(`item_term()',`Get_Item_Term_Hook') function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function; -- AKA pragma Inline (Get_Item_Term_Hook); -- ANCHOR(`menu_init()',`Get_Menu_Init_Hook') function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function; -- AKA pragma Inline (Get_Menu_Init_Hook); -- ANCHOR(`menu_term()',`Get_Menu_Term_Hook') function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function; -- AKA pragma Inline (Get_Menu_Term_Hook); -- MANPAGE(`menu_items.3x') -- ANCHOR(`set_menu_items()',`Redefine') procedure Redefine (Men : Menu; Items : Item_Array_Access); -- AKA pragma Inline (Redefine); procedure Set_Items (Men : Menu; Items : Item_Array_Access) renames Redefine; -- pragma Inline (Set_Items); -- ANCHOR(`menu_items()',`Items') function Items (Men : Menu; Index : Positive) return Item; -- AKA pragma Inline (Items); -- ANCHOR(`item_count()',`Item_Count') function Item_Count (Men : Menu) return Natural; -- AKA pragma Inline (Item_Count); -- MANPAGE(`menu_new.3x') -- ANCHOR(`new_menu()',`Create') function Create (Items : Item_Array_Access) return Menu; -- AKA -- Not inlined function New_Menu (Items : Item_Array_Access) return Menu renames Create; -- ANCHOR(`free_menu()',`Delete') procedure Delete (Men : in out Menu); -- AKA -- Reset Men to Null_Menu -- Not inlined -- MANPAGE(`menu_driver.3x') type Driver_Result is (Menu_Ok, Request_Denied, Unknown_Request, No_Match); -- ANCHOR(`menu_driver()',`Driver') function Driver (Men : Menu; Key : Key_Code) return Driver_Result; -- AKA -- Driver is not inlined -- ANCHOR(`menu_requestname.3x') -- Not Implemented: menu_request_name, menu_request_by_name ------------------------------------------------------------------------------- private type Item is new System.Storage_Elements.Integer_Address; type Menu is new System.Storage_Elements.Integer_Address; Null_Item : constant Item := 0; Null_Menu : constant Menu := 0; end Terminal_Interface.Curses.Menus; AdaCurses-20170708/gen/terminal_interface-curses-panels.ads.m40000644000175100001440000001317012340207715022556 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses-panels__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Panels -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2014 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, 1996 -- Version Control: -- $Revision: 1.22 $ -- $Date: 2014/05/24 21:31:57 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; package Terminal_Interface.Curses.Panels is pragma Preelaborate (Terminal_Interface.Curses.Panels); pragma Linker_Options ("-lpanel" & Curses_Constants.DFT_ARG_SUFFIX); type Panel is private; --------------------------- -- Interface constants -- --------------------------- Null_Panel : constant Panel; ------------------- -- Exceptions -- ------------------- Panel_Exception : exception; -- MANPAGE(`panel.3x') -- ANCHOR(`new_panel()',`Create') function Create (Win : Window) return Panel; -- AKA pragma Inline (Create); -- ANCHOR(`new_panel()',`New_Panel') function New_Panel (Win : Window) return Panel renames Create; -- AKA -- pragma Inline (New_Panel); -- ANCHOR(`bottom_panel()',`Bottom') procedure Bottom (Pan : Panel); -- AKA pragma Inline (Bottom); -- ANCHOR(`top_panel()',`Top') procedure Top (Pan : Panel); -- AKA pragma Inline (Top); -- ANCHOR(`show_panel()',`Show') procedure Show (Pan : Panel); -- AKA pragma Inline (Show); -- ANCHOR(`update_panels()',`Update_Panels') procedure Update_Panels; -- AKA pragma Import (C, Update_Panels, "update_panels"); -- ANCHOR(`hide_panel()',`Hide') procedure Hide (Pan : Panel); -- AKA pragma Inline (Hide); -- ANCHOR(`panel_window()',`Get_Window') function Get_Window (Pan : Panel) return Window; -- AKA pragma Inline (Get_Window); -- ANCHOR(`panel_window()',`Panel_Window') function Panel_Window (Pan : Panel) return Window renames Get_Window; -- pragma Inline (Panel_Window); -- ANCHOR(`replace_panel()',`Replace') procedure Replace (Pan : Panel; Win : Window); -- AKA pragma Inline (Replace); -- ANCHOR(`move_panel()',`Move') procedure Move (Pan : Panel; Line : Line_Position; Column : Column_Position); -- AKA pragma Inline (Move); -- ANCHOR(`panel_hidden()',`Is_Hidden') function Is_Hidden (Pan : Panel) return Boolean; -- AKA pragma Inline (Is_Hidden); -- ANCHOR(`panel_above()',`Above') function Above (Pan : Panel) return Panel; -- AKA pragma Import (C, Above, "panel_above"); -- ANCHOR(`panel_below()',`Below') function Below (Pan : Panel) return Panel; -- AKA pragma Import (C, Below, "panel_below"); -- ANCHOR(`del_panel()',`Delete') procedure Delete (Pan : in out Panel); -- AKA pragma Inline (Delete); private type Panel is new System.Storage_Elements.Integer_Address; Null_Panel : constant Panel := 0; end Terminal_Interface.Curses.Panels; AdaCurses-20170708/gen/terminal_interface-curses-forms-field_types.ads.m40000644000175100001440000002650012340207631024725 0ustar tomusers-- -*- ada -*- define(`HTMLNAME',`terminal_interface-curses-forms-field_user_data__ads.htm')dnl include(M4MACRO)dnl ------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.19 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; with Terminal_Interface.Curses.Aux; package Terminal_Interface.Curses.Forms.Field_Types is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types); use type Interfaces.C.int; subtype C_Int is Interfaces.C.int; -- MANPAGE(`form_fieldtype.3x') type Field_Type is abstract tagged null record; -- Abstract base type for all field types. A concrete field type -- is an extension that adds some data elements describing formats or -- boundary values for the type and validation routines. -- For the builtin low-level fieldtypes, the validation routines are -- already defined by the low-level C library. -- The builtin types like Alpha or AlphaNumeric etc. are defined in -- child packages of this package. You may use one of them as example -- how to create you own child packages for low-level field types that -- you may have already written in C. type Field_Type_Access is access all Field_Type'Class; -- ANCHOR(`set_field_type()',`Set_Type') procedure Set_Field_Type (Fld : Field; Fld_Type : Field_Type) is abstract; -- AKA -- But: we hide the vararg mechanism of the C interface. You always -- have to pass a single Field_Type parameter. -- --------------------------------------------------------------------- -- MANPAGE(`form_field_validation.3x') -- ANCHOR(`field_type()',`Get_Type') function Get_Type (Fld : Field) return Field_Type_Access; -- AKA -- ALIAS(`field_arg()') -- In Ada95 we can combine these. If you try to retrieve the field type -- that is not defined as extension of the abstract tagged type above, -- you will raise a Form_Exception. -- This is not inlined -- +---------------------------------------------------------------------- -- | Private Part. -- | Most of this is used by the implementations of the child packages. -- | private type Makearg_Function is access function (Args : System.Address) return System.Address; pragma Convention (C, Makearg_Function); type Copyarg_Function is access function (Usr : System.Address) return System.Address; pragma Convention (C, Copyarg_Function); type Freearg_Function is access procedure (Usr : System.Address); pragma Convention (C, Freearg_Function); type Field_Check_Function is access function (Fld : Field; Usr : System.Address) return Curses_Bool; pragma Convention (C, Field_Check_Function); type Char_Check_Function is access function (Ch : C_Int; Usr : System.Address) return Curses_Bool; pragma Convention (C, Char_Check_Function); type Choice_Function is access function (Fld : Field; Usr : System.Address) return Curses_Bool; pragma Convention (C, Choice_Function); -- +---------------------------------------------------------------------- -- | This must be in sync with the FIELDTYPE structure in form.h -- | type Low_Level_Field_Type is record Status : Interfaces.C.unsigned_short; Ref_Count : Interfaces.C.long; Left, Right : System.Address; Makearg : Makearg_Function; Copyarg : Copyarg_Function; Freearg : Freearg_Function; Fcheck : Field_Check_Function; Ccheck : Char_Check_Function; Next, Prev : Choice_Function; end record; pragma Convention (C, Low_Level_Field_Type); type C_Field_Type is access all Low_Level_Field_Type; Null_Field_Type : constant C_Field_Type := null; -- +---------------------------------------------------------------------- -- | This four low-level fieldtypes are the ones associated with -- | fieldtypes handled by this binding. Any other low-level fieldtype -- | will result in a Form_Exception is function Get_Type. -- | M_Generic_Type : C_Field_Type := null; M_Generic_Choice : C_Field_Type := null; M_Builtin_Router : C_Field_Type := null; M_Choice_Router : C_Field_Type := null; -- Two wrapper functions to access those low-level fieldtypes defined -- in this package. function C_Builtin_Router return C_Field_Type; function C_Choice_Router return C_Field_Type; procedure Wrap_Builtin (Fld : Field; Typ : Field_Type'Class; Cft : C_Field_Type := C_Builtin_Router); -- This procedure has to be called by the Set_Field_Type implementation -- for builtin low-level fieldtypes to replace it by an Ada95 -- conformant Field_Type object. -- The parameter Cft must be C_Builtin_Router for regular low-level -- fieldtypes (like TYP_ALPHA or TYP_ALNUM) and C_Choice_Router for -- low-level fieldtypes witch choice functions (like TYP_ENUM). -- Any other value will raise a Form_Exception. function Make_Arg (Args : System.Address) return System.Address; pragma Import (C, Make_Arg, "void_star_make_arg"); -- This is the Makearg_Function for the internal low-level types -- introduced by this binding. function Copy_Arg (Usr : System.Address) return System.Address; pragma Convention (C, Copy_Arg); -- This is the Copyarg_Function for the internal low-level types -- introduced by this binding. procedure Free_Arg (Usr : System.Address); pragma Convention (C, Free_Arg); -- This is the Freearg_Function for the internal low-level types -- introduced by this binding. function Field_Check_Router (Fld : Field; Usr : System.Address) return Curses_Bool; pragma Convention (C, Field_Check_Router); -- This is the Field_Check_Function for the internal low-level types -- introduced to wrap the low-level types by a Field_Type derived -- type. It routes the call to the corresponding low-level validation -- function. function Char_Check_Router (Ch : C_Int; Usr : System.Address) return Curses_Bool; pragma Convention (C, Char_Check_Router); -- This is the Char_Check_Function for the internal low-level types -- introduced to wrap the low-level types by a Field_Type derived -- type. It routes the call to the corresponding low-level validation -- function. function Next_Router (Fld : Field; Usr : System.Address) return Curses_Bool; pragma Convention (C, Next_Router); -- This is the Choice_Function for the internal low-level types -- introduced to wrap the low-level types by a Field_Type derived -- type. It routes the call to the corresponding low-level next_choice -- function. function Prev_Router (Fld : Field; Usr : System.Address) return Curses_Bool; pragma Convention (C, Prev_Router); -- This is the Choice_Function for the internal low-level types -- introduced to wrap the low-level types by a Field_Type derived -- type. It routes the call to the corresponding low-level prev_choice -- function. -- This is the Argument structure maintained by all low-level field types -- introduced by this binding. type Argument is record Typ : Field_Type_Access; -- the Field_Type creating this record Usr : System.Address; -- original arg for builtin low-level types Cft : C_Field_Type; -- the original low-level type end record; type Argument_Access is access all Argument; -- +---------------------------------------------------------------------- -- | -- | Some Imports of libform routines to deal with low-level fieldtypes. -- | function New_Fieldtype (Fcheck : Field_Check_Function; Ccheck : Char_Check_Function) return C_Field_Type; pragma Import (C, New_Fieldtype, "new_fieldtype"); function Set_Fieldtype_Arg (Cft : C_Field_Type; Mak : Makearg_Function := Make_Arg'Access; Cop : Copyarg_Function := Copy_Arg'Access; Fre : Freearg_Function := Free_Arg'Access) return Aux.Eti_Error; pragma Import (C, Set_Fieldtype_Arg, "set_fieldtype_arg"); function Set_Fieldtype_Choice (Cft : C_Field_Type; Next, Prev : Choice_Function) return Aux.Eti_Error; pragma Import (C, Set_Fieldtype_Choice, "set_fieldtype_choice"); end Terminal_Interface.Curses.Forms.Field_Types; AdaCurses-20170708/install-sh0000755000175100001440000001572307762207755014412 0ustar tomusers#! /bin/sh # # install - install a program, script, or datafile # # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # 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, 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 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd=$cpprog shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "$0: no input file specified" >&2 exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d "$dst" ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f "$src" ] || [ -d "$src" ] then : else echo "$0: $src does not exist" >&2 exit 1 fi if [ x"$dst" = x ] then echo "$0: no destination specified" >&2 exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d "$dst" ] then dst=$dst/`basename "$src"` else : fi fi ## this sed command emulates the dirname command dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp='' while [ $# -ne 0 ] ; do pathcomp=$pathcomp$1 shift if [ ! -d "$pathcomp" ] ; then $mkdirprog "$pathcomp" else : fi pathcomp=$pathcomp/ done fi if [ x"$dir_arg" != x ] then $doit $instcmd "$dst" && if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename "$dst"` else dstfile=`basename "$dst" $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename "$dst"` else : fi # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/#inst.$$# rmtmp=$dstdir/#rm.$$# # Trap to clean up temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && # Now remove or move aside any old file at destination location. We try this # two ways since rm can't unlink itself on some systems and the destination # file might be busy for other reasons. In this case, the final cleanup # might fail but the new file should still install successfully. { if [ -f "$dstdir/$dstfile" ] then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi && # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } AdaCurses-20170708/doc/0000755000175100001440000000000013130303161013111 5ustar tomusersAdaCurses-20170708/doc/MKada_config.in0000644000175100001440000001020613007445105015752 0ustar tomusers.\"*************************************************************************** .\" Copyright (c) 2010-2014,2016 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. * .\"*************************************************************************** .\" .\" $Id: MKada_config.in,v 1.10 2016/11/05 21:08:21 tom Exp $ .ds C adacurses@USE_CFG_SUFFIX@\-config .TH ADACURSES "1" "" "" "User Commands" .SH NAME adacurses@USE_CFG_SUFFIX@\-config \- helper script for AdaCurses libraries .SH SYNOPSIS .B \*C [\fIoptions\fR] .SH DESCRIPTION This is a shell script which simplifies configuring an application to use the AdaCurses library binding to ncurses. .SH OPTIONS .TP \fB\-\-cflags\fR echos the gnat (Ada compiler) flags needed to compile with AdaCurses. .TP \fB\-\-libs\fR echos the gnat libraries needed to link with AdaCurses. .TP \fB\-\-version\fR echos the release+patchdate version of the ncurses libraries used to configure and build AdaCurses. .TP \fB\-\-help\fR prints a list of the \fB\*C\fP script's options. .PP If no options are given, \fB\*C\fP prints the combination of \fB\-\-cflags\fR and \fB\-\-libs\fR that \fBgnatmake\fP expects (see example). .SH EXAMPLE .PP For example, supposing that you want to compile the "Hello World!" program for AdaCurses. Make a file named "hello.adb": .RS .nf .ft CW with Terminal_Interface.Curses; use Terminal_Interface.Curses; procedure Hello is Visibility : Cursor_Visibility := Invisible; done : Boolean := False; c : Key_Code; begin Init_Screen; Set_Echo_Mode (False); Set_Cursor_Visibility (Visibility); Set_Timeout_Mode (Standard_Window, Non_Blocking, 0); Move_Cursor (Line => Lines / 2, Column => (Columns - 12) / 2); Add (Str => "Hello World!"); while not done loop c := Get_Keystroke (Standard_Window); case c is when Character'Pos ('q') => done := True; when others => null; end case; Nap_Milli_Seconds (50); end loop; End_Windows; end Hello; .fi .RE .PP Then, using .RS .ft CW gnatmake `adacurses-config --cflags` hello -largs `adacurses-config --libs` .ft .RE .PP or (simpler): .RS .ft CW gnatmake hello `adacurses-config` .ft .RE .PP you will compile and link the program. .SH "SEE ALSO" \fBcurses\fR(3X) .PP This describes \fBncurses\fR version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@). AdaCurses-20170708/doc/ada/0000755000175100001440000000000013130303161013636 5ustar tomusersAdaCurses-20170708/doc/ada/funcs.htm0000644000175100001440000000171712145772563015521 0ustar tomusers

Functions/Procedures

[A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-user__ads.htm0000644000175100001440000003022712340214310027103 0ustar tomusers terminal_interface-curses-forms-field_types-user.ads

File : terminal_interface-curses-forms-field_types-user.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Forms.Field_Types.User           --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 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, 1996
--  Version Control:
--  @Revision: 1.15 @
--  @Date: 2011/03/19 12:27:21 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;

package Terminal_Interface.Curses.Forms.Field_Types.User is
   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.User);
   subtype C_Int is Interfaces.C.int;

   type User_Defined_Field_Type is abstract new Field_Type with null record;
   --  This is the root of the mechanism we use to create field types in
   --  Ada95. You should your own type derive from this one and implement
   --  the Field_Check and Character_Check functions for your own type.

   type User_Defined_Field_Type_Access is access all
     User_Defined_Field_Type'Class;

   function Field_Check
     (Fld : Field;
      Typ : User_Defined_Field_Type) return Boolean
      is abstract;
   --  If True is returned, the field is considered valid, otherwise it is
   --  invalid.

   function Character_Check
     (Ch  : Character;
      Typ : User_Defined_Field_Type) return Boolean
      is abstract;
   --  If True is returned, the character is considered as valid for the
   --  field, otherwise as invalid.

   procedure Set_Field_Type (Fld : Field;
                             Typ : User_Defined_Field_Type);
   --  This should work for all types derived from User_Defined_Field_Type.
   --  No need to reimplement it for your derived type.

   --  +----------------------------------------------------------------------
   --  | Private Part.
   --  | Used by the Choice child package.
private
   function C_Generic_Type   return C_Field_Type;

   function Generic_Field_Check (Fld : Field;
                                 Usr : System.Address) return Curses_Bool;
   pragma Convention (C, Generic_Field_Check);
   --  This is the generic Field_Check_Function for the low-level fieldtype
   --  representing all the User_Defined_Field_Type derivatives. It routes
   --  the call to the Field_Check implementation for the type.

   function Generic_Char_Check (Ch  : C_Int;
                                Usr : System.Address) return Curses_Bool;
   pragma Convention (C, Generic_Char_Check);
   --  This is the generic Char_Check_Function for the low-level fieldtype
   --  representing all the User_Defined_Field_Type derivatives. It routes
   --  the call to the Character_Check implementation for the type.

end Terminal_Interface.Curses.Forms.Field_Types.User;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-user__adb.htm0000644000175100001440000004451212340214310027064 0ustar tomusers terminal_interface-curses-forms-field_types-user.adb

File : terminal_interface-curses-forms-field_types-user.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--              Terminal_Interface.Curses.Forms.Field_Types.User            --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.23 @
--  @Date: 2014/05/24 21:31:05 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with System.Address_To_Access_Conversions;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Forms.Field_Types.User is

   procedure Set_Field_Type (Fld : Field;
                             Typ : User_Defined_Field_Type)
   is
      function Allocate_Arg (T : User_Defined_Field_Type'Class)
                             return Argument_Access;

      function Set_Fld_Type (F    : Field := Fld;
                             Cft  : C_Field_Type := C_Generic_Type;
                             Arg1 : Argument_Access)
                             return Eti_Error;
      pragma Import (C, Set_Fld_Type, "set_field_type_user");

      function Allocate_Arg (T : User_Defined_Field_Type'Class)
                             return Argument_Access
      is
         Ptr : constant Field_Type_Access
             := new User_Defined_Field_Type'Class'(T);
      begin
         return new Argument'(Usr => System.Null_Address,
                              Typ => Ptr,
                              Cft => Null_Field_Type);
      end Allocate_Arg;

   begin
      Eti_Exception (Set_Fld_Type (Arg1 => Allocate_Arg (Typ)));
   end Set_Field_Type;

   package Argument_Conversions is
      new System.Address_To_Access_Conversions (Argument);

   function Generic_Field_Check (Fld : Field;
                                 Usr : System.Address) return Curses_Bool
   is
      Result : Boolean;
      Udf    : constant User_Defined_Field_Type_Access :=
        User_Defined_Field_Type_Access
          (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ);
   begin
      Result := Field_Check (Fld, Udf.all);
      return Curses_Bool (Boolean'Pos (Result));
   end Generic_Field_Check;

   function Generic_Char_Check (Ch  : C_Int;
                                Usr : System.Address) return Curses_Bool
   is
      Result : Boolean;
      Udf    : constant User_Defined_Field_Type_Access :=
        User_Defined_Field_Type_Access
          (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ);
   begin
      Result := Character_Check (Character'Val (Ch), Udf.all);
      return Curses_Bool (Boolean'Pos (Result));
   end Generic_Char_Check;

   --  -----------------------------------------------------------------------
   --
   function C_Generic_Type return C_Field_Type
   is
      Res : Eti_Error;
      T   : C_Field_Type;
   begin
      if M_Generic_Type = Null_Field_Type then
         T := New_Fieldtype (Generic_Field_Check'Access,
                             Generic_Char_Check'Access);
         if T = Null_Field_Type then
            raise Form_Exception;
         else
            Res := Set_Fieldtype_Arg (T,
                                      Make_Arg'Access,
                                      Copy_Arg'Access,
                                      Free_Arg'Access);
            Eti_Exception (Res);
         end if;
         M_Generic_Type := T;
      end if;
      pragma Assert (M_Generic_Type /= Null_Field_Type);
      return M_Generic_Type;
   end C_Generic_Type;

end Terminal_Interface.Curses.Forms.Field_Types.User;
AdaCurses-20170708/doc/ada/files/0000755000175100001440000000000013130303161014740 5ustar tomusersAdaCurses-20170708/doc/ada/files/T.htm0000644000175100001440000002334112340214307015665 0ustar tomusers T

Files - T

[index] AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io__adb.htm0000644000175100001440000011500512340214310024124 0ustar tomusers terminal_interface-curses-text_io.adb

File : terminal_interface-curses-text_io.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                     Terminal_Interface.Curses.Text_IO                    --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.22 @
--  @Date: 2014/05/24 21:32:18 @
--  Binding Version 01.00
------------------------------------------------------------------------------
package body Terminal_Interface.Curses.Text_IO is

   Default_Window : Window := Null_Window;

   procedure Set_Window (Win : Window)
   is
   begin
      Default_Window := Win;
   end Set_Window;

   function Get_Window return Window
   is
   begin
      if Default_Window = Null_Window then
         return Standard_Window;
      else
         return Default_Window;
      end if;
   end Get_Window;
   pragma Inline (Get_Window);

   procedure Flush (Win : Window)
   is
   begin
      Refresh (Win);
   end Flush;

   procedure Flush
   is
   begin
      Flush (Get_Window);
   end Flush;

   --------------------------------------------
   -- Specification of line and page lengths --
   --------------------------------------------

   --  There are no set routines in this package. I assume, that you allocate
   --  the window with an appropriate size.
   --  A scroll-window is interpreted as an page with unbounded page length,
   --  i.e. it returns the conventional 0 as page length.

   function Line_Length (Win : Window) return Count
   is
      N_Lines : Line_Count;
      N_Cols  : Column_Count;
   begin
      Get_Size (Win, N_Lines, N_Cols);
      --  if Natural (N_Cols) > Natural (Count'Last) then
      --     raise Layout_Error;
      --  end if;
      return Count (N_Cols);
   end Line_Length;

   function Line_Length return Count
   is
   begin
      return Line_Length (Get_Window);
   end Line_Length;

   function Page_Length (Win : Window) return Count
   is
      N_Lines : Line_Count;
      N_Cols  : Column_Count;
   begin
      if Scrolling_Allowed (Win) then
         return 0;
      else
         Get_Size (Win, N_Lines, N_Cols);
         --  if Natural (N_Lines) > Natural (Count'Last) then
         --     raise Layout_Error;
         --  end if;
         return Count (N_Lines);
      end if;
   end Page_Length;

   function Page_Length return Count
   is
   begin
      return Page_Length (Get_Window);
   end Page_Length;

   ------------------------------------
   -- Column, Line, and Page Control --
   ------------------------------------
   procedure New_Line (Win : Window; Spacing : Positive_Count := 1)
   is
      P_Size : constant Count := Page_Length (Win);
   begin
      if not Spacing'Valid then
         raise Constraint_Error;
      end if;

      for I in 1 .. Spacing loop
         if P_Size > 0 and then Line (Win) >= P_Size then
            New_Page (Win);
         else
            Add (Win, ASCII.LF);
         end if;
      end loop;
   end New_Line;

   procedure New_Line (Spacing : Positive_Count := 1)
   is
   begin
      New_Line (Get_Window, Spacing);
   end New_Line;

   procedure New_Page (Win : Window)
   is
   begin
      Clear (Win);
   end New_Page;

   procedure New_Page
   is
   begin
      New_Page (Get_Window);
   end New_Page;

   procedure Set_Col (Win : Window;  To : Positive_Count)
   is
      Y  : Line_Position;
      X1 : Column_Position;
      X2 : Column_Position;
      N  : Natural;
   begin
      if not To'Valid then
         raise Constraint_Error;
      end if;

      Get_Cursor_Position (Win, Y, X1);
      N  := Natural (To); N := N - 1;
      X2 := Column_Position (N);
      if X1 > X2 then
         New_Line (Win, 1);
         X1 := 0;
      end if;
      if X1 < X2 then
         declare
            Filler : constant String (Integer (X1) .. (Integer (X2) - 1))
              := (others => ' ');
         begin
            Put (Win, Filler);
         end;
      end if;
   end Set_Col;

   procedure Set_Col (To : Positive_Count)
   is
   begin
      Set_Col (Get_Window, To);
   end Set_Col;

   procedure Set_Line (Win : Window; To : Positive_Count)
   is
      Y1 : Line_Position;
      Y2 : Line_Position;
      X  : Column_Position;
      N  : Natural;
   begin
      if not To'Valid then
         raise Constraint_Error;
      end if;

      Get_Cursor_Position (Win, Y1, X);
      pragma Warnings (Off, X);         --  unreferenced
      N  := Natural (To); N := N - 1;
      Y2 := Line_Position (N);
      if Y2 < Y1 then
         New_Page (Win);
         Y1 := 0;
      end if;
      if Y1 < Y2 then
         New_Line (Win, Positive_Count (Y2 - Y1));
      end if;
   end Set_Line;

   procedure Set_Line (To : Positive_Count)
   is
   begin
      Set_Line (Get_Window, To);
   end Set_Line;

   function Col (Win : Window) return Positive_Count
   is
      Y : Line_Position;
      X : Column_Position;
      N : Natural;
   begin
      Get_Cursor_Position (Win, Y, X);
      N := Natural (X); N := N + 1;
      --  if N > Natural (Count'Last) then
      --     raise Layout_Error;
      --  end if;
      return Positive_Count (N);
   end Col;

   function Col return Positive_Count
   is
   begin
      return Col (Get_Window);
   end Col;

   function Line (Win : Window) return Positive_Count
   is
      Y : Line_Position;
      X : Column_Position;
      N : Natural;
   begin
      Get_Cursor_Position (Win, Y, X);
      N := Natural (Y); N := N + 1;
      --  if N > Natural (Count'Last) then
      --     raise Layout_Error;
      --  end if;
      return Positive_Count (N);
   end Line;

   function Line return Positive_Count
   is
   begin
      return Line (Get_Window);
   end Line;

   -----------------------
   -- Characters Output --
   -----------------------

   procedure Put (Win  : Window; Item : Character)
   is
      P_Size : constant Count := Page_Length (Win);
      Y : Line_Position;
      X : Column_Position;
      L : Line_Count;
      C : Column_Count;
   begin
      if P_Size > 0 then
         Get_Cursor_Position (Win, Y, X);
         Get_Size (Win, L, C);
         if (Y + 1) = L and then (X + 1) = C then
            New_Page (Win);
         end if;
      end if;
      Add (Win, Item);
   end Put;

   procedure Put (Item : Character)
   is
   begin
      Put (Get_Window, Item);
   end Put;

   --------------------
   -- Strings-Output --
   --------------------

   procedure Put (Win  : Window; Item : String)
   is
      P_Size : constant Count := Page_Length (Win);
      Y : Line_Position;
      X : Column_Position;
      L : Line_Count;
      C : Column_Count;
   begin
      if P_Size > 0 then
         Get_Cursor_Position (Win, Y, X);
         Get_Size (Win, L, C);
         if (Y + 1) = L and then (X + 1 + Item'Length) >= C then
            New_Page (Win);
         end if;
      end if;
      Add (Win, Item);
   end Put;

   procedure Put (Item : String)
   is
   begin
      Put (Get_Window, Item);
   end Put;

   procedure Put_Line
     (Win  : Window;
      Item : String)
   is
   begin
      Put (Win, Item);
      New_Line (Win, 1);
   end Put_Line;

   procedure Put_Line
     (Item : String)
   is
   begin
      Put_Line (Get_Window, Item);
   end Put_Line;

end Terminal_Interface.Curses.Text_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm0000644000175100001440000002757112340214310030343 0ustar tomusers terminal_interface-curses-forms-field_types-user-choice.ads

File : terminal_interface-curses-forms-field_types-user-choice.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--           Terminal_Interface.Curses.Forms.Field_Types.User.Choice        --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2008,2011 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, 1996
--  Version Control:
--  @Revision: 1.14 @
--  @Date: 2011/03/19 12:27:47 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;

package Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
   pragma Preelaborate
     (Terminal_Interface.Curses.Forms.Field_Types.User.Choice);

   subtype C_Int is Interfaces.C.int;

   type User_Defined_Field_Type_With_Choice is abstract new
     User_Defined_Field_Type with null record;
   --  This is the root of the mechanism we use to create field types in
   --  Ada95 that allow the prev/next mechanism. You should your own type
   --  derive from this one and implement the Field_Check, Character_Check
   --  Next and Previous functions for your own type.

   type User_Defined_Field_Type_With_Choice_Access is access all
     User_Defined_Field_Type_With_Choice'Class;

   function Next
     (Fld : Field;
      Typ : User_Defined_Field_Type_With_Choice) return Boolean
      is abstract;
   --  If True is returned, the function successfully generated a next
   --  value into the fields buffer.

   function Previous
     (Fld : Field;
      Typ : User_Defined_Field_Type_With_Choice) return Boolean
      is abstract;
   --  If True is returned, the function successfully generated a previous
   --  value into the fields buffer.

   --  +----------------------------------------------------------------------
   --  | Private Part.
   --  |
private
   function C_Generic_Choice return C_Field_Type;

   function Generic_Next (Fld : Field;
                          Usr : System.Address) return Curses_Bool;
   pragma Convention (C, Generic_Next);
   --  This is the generic next Choice_Function for the low-level fieldtype
   --  representing all the User_Defined_Field_Type derivatives. It routes
   --  the call to the Next implementation for the type.

   function Generic_Prev (Fld : Field;
                          Usr : System.Address) return Curses_Bool;
   pragma Convention (C, Generic_Prev);
   --  This is the generic prev Choice_Function for the low-level fieldtype
   --  representing all the User_Defined_Field_Type derivatives. It routes
   --  the call to the Previous implementation for the type.

end Terminal_Interface.Curses.Forms.Field_Types.User.Choice;
AdaCurses-20170708/doc/ada/terminal_interface-curses-terminfo__ads.htm0000644000175100001440000002241113076721162024332 0ustar tomusers terminal_interface-curses-terminfo.ads

File : terminal_interface-curses-terminfo.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                     Terminal_Interface.Curses.Terminfo                   --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 2000,2003 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, 1996
--  Version Control:
--  @Revision: 1.4 @
--  Binding Version 01.00
------------------------------------------------------------------------------

with Interfaces.C;

package Terminal_Interface.Curses.Terminfo is
   pragma Preelaborate (Terminal_Interface.Curses.Terminfo);

   --  |=====================================================================
   --  | Man page curs_terminfo.3x
   --  |=====================================================================
   --  Not implemented:  setupterm, setterm, set_curterm, del_curterm,
   --                    restartterm, tparm, putp, vidputs,  vidattr,
   --                    mvcur

   type Terminfo_String is new String;

   --  |
   procedure Get_String (Name   : String;
                         Value  : out Terminfo_String;
                         Result : out Boolean);
   function Has_String (Name : String) return Boolean;
   --  AKA: tigetstr()

   --  |
   function Get_Flag (Name : String) return Boolean;
   --  AKA: tigetflag()

   --  |
   function Get_Number (Name : String) return Integer;
   --  AKA: tigetnum()

   type putctype is access function (c : Interfaces.C.int)
                                    return Interfaces.C.int;
   pragma Convention (C, putctype);

   --  |
   procedure Put_String (Str    : Terminfo_String;
                         affcnt : Natural := 1;
                         putc   : putctype := null);
   --  AKA: tputs()

end Terminal_Interface.Curses.Terminfo;
AdaCurses-20170708/doc/ada/index.htm0000644000175100001440000000220112145772562015476 0ustar tomusers Source Browser <H2 ALIGN=CENTER>Files</H2> <A HREF="files/T.htm">[T]</A> <HR> <H2 ALIGN=CENTER>Functions/Procedures</H2> <A HREF="funcs/A.htm">[A]</A> <A HREF="funcs/B.htm">[B]</A> <A HREF="funcs/C.htm">[C]</A> <A HREF="funcs/D.htm">[D]</A> <A HREF="funcs/E.htm">[E]</A> <A HREF="funcs/F.htm">[F]</A> <A HREF="funcs/G.htm">[G]</A> <A HREF="funcs/H.htm">[H]</A> <A HREF="funcs/I.htm">[I]</A> <A HREF="funcs/K.htm">[K]</A> <A HREF="funcs/L.htm">[L]</A> <A HREF="funcs/M.htm">[M]</A> <A HREF="funcs/N.htm">[N]</A> <A HREF="funcs/O.htm">[O]</A> <A HREF="funcs/P.htm">[P]</A> <A HREF="funcs/Q.htm">[Q]</A> <A HREF="funcs/R.htm">[R]</A> <A HREF="funcs/S.htm">[S]</A> <A HREF="funcs/T.htm">[T]</A> <A HREF="funcs/U.htm">[U]</A> <A HREF="funcs/V.htm">[V]</A> <A HREF="funcs/W.htm">[W]</A> AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types__ads.htm0000644000175100001440000007426212534703456026161 0ustar tomusers terminal_interface-curses-forms-field_types.ads

File : terminal_interface-curses-forms-field_types.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                 Terminal_Interface.Curses.Forms.Field_Types              --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.19 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
with Terminal_Interface.Curses.Aux;

package Terminal_Interface.Curses.Forms.Field_Types is
   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types);
   use type Interfaces.C.int;
   subtype C_Int is Interfaces.C.int;

   --  |=====================================================================
   --  | Man page form_fieldtype.3x
   --  |=====================================================================

   type Field_Type is abstract tagged null record;
   --  Abstract base type for all field types. A concrete field type
   --  is an extension that adds some data elements describing formats or
   --  boundary values for the type and validation routines.
   --  For the builtin low-level fieldtypes, the validation routines are
   --  already defined by the low-level C library.
   --  The builtin types like Alpha or AlphaNumeric etc. are defined in
   --  child packages of this package. You may use one of them as example
   --  how to create you own child packages for low-level field types that
   --  you may have already written in C.

   type Field_Type_Access is access all Field_Type'Class;

   --  #1A NAME="AFU_1"#2|
   procedure Set_Field_Type (Fld      : Field;
                             Fld_Type : Field_Type) is abstract;
   --  AKA: set_field_type()
   --  But: we hide the vararg mechanism of the C interface. You always
   --       have to pass a single Field_Type parameter.

   --  ---------------------------------------------------------------------

   --  |=====================================================================
   --  | Man page form_field_validation.3x
   --  |=====================================================================

   --  #1A NAME="AFU_2"#2|
   function Get_Type (Fld : Field) return Field_Type_Access;
   --  AKA: field_type()
   --  AKA: field_arg()
   --  In Ada95 we can combine these. If you try to retrieve the field type
   --  that is not defined as extension of the abstract tagged type above,
   --  you will raise a Form_Exception.
   --  This is not inlined

   --  +----------------------------------------------------------------------
   --  | Private Part.
   --  | Most of this is used by the implementations of the child packages.
   --  |
private
   type Makearg_Function is access
     function (Args : System.Address) return System.Address;
   pragma Convention (C, Makearg_Function);

   type Copyarg_Function is access
     function (Usr : System.Address) return System.Address;
   pragma Convention (C, Copyarg_Function);

   type Freearg_Function is access
     procedure (Usr : System.Address);
   pragma Convention (C, Freearg_Function);

   type Field_Check_Function is access
     function (Fld : Field; Usr : System.Address) return Curses_Bool;
   pragma Convention (C, Field_Check_Function);

   type Char_Check_Function is access
     function (Ch : C_Int; Usr : System.Address) return Curses_Bool;
   pragma Convention (C, Char_Check_Function);

   type Choice_Function is access
     function (Fld : Field; Usr : System.Address) return Curses_Bool;
   pragma Convention (C, Choice_Function);

   --  +----------------------------------------------------------------------
   --  | This must be in sync with the FIELDTYPE structure in form.h
   --  |
   type Low_Level_Field_Type is
      record
         Status :              Interfaces.C.unsigned_short;
         Ref_Count :           Interfaces.C.long;
         Left, Right :         System.Address;
         Makearg :             Makearg_Function;
         Copyarg :             Copyarg_Function;
         Freearg :             Freearg_Function;
         Fcheck :              Field_Check_Function;
         Ccheck :              Char_Check_Function;
         Next, Prev :          Choice_Function;
      end record;
   pragma Convention (C, Low_Level_Field_Type);
   type C_Field_Type is access all Low_Level_Field_Type;

   Null_Field_Type   : constant C_Field_Type := null;

   --  +----------------------------------------------------------------------
   --  | This four low-level fieldtypes are the ones associated with
   --  | fieldtypes handled by this binding. Any other low-level fieldtype
   --  | will result in a Form_Exception is function Get_Type.
   --  |
   M_Generic_Type   : C_Field_Type := null;
   M_Generic_Choice : C_Field_Type := null;
   M_Builtin_Router : C_Field_Type := null;
   M_Choice_Router  : C_Field_Type := null;

   --  Two wrapper functions to access those low-level fieldtypes defined
   --  in this package.
   function C_Builtin_Router return C_Field_Type;
   function C_Choice_Router  return C_Field_Type;

   procedure Wrap_Builtin (Fld : Field;
                           Typ : Field_Type'Class;
                           Cft : C_Field_Type := C_Builtin_Router);
   --  This procedure has to be called by the Set_Field_Type implementation
   --  for builtin low-level fieldtypes to replace it by an Ada95
   --  conformant Field_Type object.
   --  The parameter Cft must be C_Builtin_Router for regular low-level
   --  fieldtypes (like TYP_ALPHA or TYP_ALNUM) and C_Choice_Router for
   --  low-level fieldtypes witch choice functions (like TYP_ENUM).
   --  Any other value will raise a Form_Exception.

   function Make_Arg (Args : System.Address) return System.Address;
   pragma Import (C, Make_Arg, "void_star_make_arg");
   --  This is the Makearg_Function for the internal low-level types
   --  introduced by this binding.

   function Copy_Arg (Usr : System.Address) return System.Address;
   pragma Convention (C, Copy_Arg);
   --  This is the Copyarg_Function for the internal low-level types
   --  introduced by this binding.

   procedure Free_Arg (Usr : System.Address);
   pragma Convention (C, Free_Arg);
   --  This is the Freearg_Function for the internal low-level types
   --  introduced by this binding.

   function Field_Check_Router (Fld : Field;
                                Usr : System.Address) return Curses_Bool;
   pragma Convention (C, Field_Check_Router);
   --  This is the Field_Check_Function for the internal low-level types
   --  introduced to wrap the low-level types by a Field_Type derived
   --  type. It routes the call to the corresponding low-level validation
   --  function.

   function Char_Check_Router (Ch : C_Int;
                               Usr : System.Address) return Curses_Bool;
   pragma Convention (C, Char_Check_Router);
   --  This is the Char_Check_Function for the internal low-level types
   --  introduced to wrap the low-level types by a Field_Type derived
   --  type. It routes the call to the corresponding low-level validation
   --  function.

   function Next_Router (Fld : Field;
                         Usr : System.Address) return Curses_Bool;
   pragma Convention (C, Next_Router);
   --  This is the Choice_Function for the internal low-level types
   --  introduced to wrap the low-level types by a Field_Type derived
   --  type. It routes the call to the corresponding low-level next_choice
   --  function.

   function Prev_Router (Fld : Field;
                         Usr : System.Address) return Curses_Bool;
   pragma Convention (C, Prev_Router);
   --  This is the Choice_Function for the internal low-level types
   --  introduced to wrap the low-level types by a Field_Type derived
   --  type. It routes the call to the corresponding low-level prev_choice
   --  function.

   --  This is the Argument structure maintained by all low-level field types
   --  introduced by this binding.
   type Argument is record
      Typ : Field_Type_Access;   --  the Field_Type creating this record
      Usr : System.Address;      --  original arg for builtin low-level types
      Cft : C_Field_Type;        --  the original low-level type
   end record;
   type Argument_Access is access all Argument;

   --  +----------------------------------------------------------------------
   --  |
   --  | Some Imports of libform routines to deal with low-level fieldtypes.
   --  |
   function New_Fieldtype (Fcheck : Field_Check_Function;
                           Ccheck : Char_Check_Function)
     return C_Field_Type;
   pragma Import (C, New_Fieldtype, "new_fieldtype");

   function Set_Fieldtype_Arg (Cft : C_Field_Type;
                               Mak : Makearg_Function := Make_Arg'Access;
                               Cop : Copyarg_Function := Copy_Arg'Access;
                               Fre : Freearg_Function := Free_Arg'Access)
     return Aux.Eti_Error;
   pragma Import (C, Set_Fieldtype_Arg, "set_fieldtype_arg");

   function Set_Fieldtype_Choice (Cft : C_Field_Type;
                                  Next, Prev : Choice_Function)
     return Aux.Eti_Error;
   pragma Import (C, Set_Fieldtype_Choice, "set_fieldtype_choice");

end Terminal_Interface.Curses.Forms.Field_Types;
AdaCurses-20170708/doc/ada/terminal_interface-curses_constants__ads.htm0000644000175100001440000011306012534703456024612 0ustar tomusers terminal_interface-curses_constants.ads

File : terminal_interface-curses_constants.ads


--  Generated by the C program ./generate (source ./gen.c).
--  Do not edit this file directly.
--  The values provided here may vary on your system.

with System;
package Terminal_Interface.Curses_Constants is
   pragma Pure;

   DFT_ARG_SUFFIX : constant String := "";
   Bit_Order : constant System.Bit_Order := System.Low_Order_First;
   Sizeof_Bool                  : constant := 8;
   OK                           : constant := 0;
   ERR                          : constant := -1;
   pragma Warnings (Off); -- redefinition of Standard.True and False
   TRUE                         : constant := 1;
   FALSE                        : constant := 0;
   pragma Warnings (On);

   --  Version of the ncurses library from extensions(3NCURSES)

   NCURSES_VERSION_MAJOR        : constant := 6;
   NCURSES_VERSION_MINOR        : constant := 0;
   Version : constant String := "6.0";

   --  Character non-color attributes from attr(3NCURSES)

   --  attr_t and chtype may be signed in C.
   type attr_t is mod 2 ** 32;
   A_CHARTEXT_First             : constant := 0;
   A_CHARTEXT_Last              : constant := 7;
   A_COLOR_First                : constant := 8;
   A_COLOR_Last                 : constant := 15;
   Attr_First                   : constant := 16;
   Attr_Last                    : constant := 31;
   A_STANDOUT_First             : constant := 16;
   A_STANDOUT_Last              : constant := 16;
   A_UNDERLINE_First            : constant := 17;
   A_UNDERLINE_Last             : constant := 17;
   A_REVERSE_First              : constant := 18;
   A_REVERSE_Last               : constant := 18;
   A_BLINK_First                : constant := 19;
   A_BLINK_Last                 : constant := 19;
   A_DIM_First                  : constant := 20;
   A_DIM_Last                   : constant := 20;
   A_BOLD_First                 : constant := 21;
   A_BOLD_Last                  : constant := 21;
   A_PROTECT_First              : constant := 24;
   A_PROTECT_Last               : constant := 24;
   A_INVIS_First                : constant := 23;
   A_INVIS_Last                 : constant := 23;
   A_ALTCHARSET_First           : constant := 22;
   A_ALTCHARSET_Last            : constant := 22;
   A_HORIZONTAL_First           : constant := 25;
   A_HORIZONTAL_Last            : constant := 25;
   A_LEFT_First                 : constant := 26;
   A_LEFT_Last                  : constant := 26;
   A_LOW_First                  : constant := 27;
   A_LOW_Last                   : constant := 27;
   A_RIGHT_First                : constant := 28;
   A_RIGHT_Last                 : constant := 28;
   A_TOP_First                  : constant := 29;
   A_TOP_Last                   : constant := 29;
   A_VERTICAL_First             : constant := 30;
   A_VERTICAL_Last              : constant := 30;
   chtype_Size                  : constant := 32;

   --  predefined color numbers from color(3NCURSES)

   COLOR_BLACK                  : constant := 0;
   COLOR_RED                    : constant := 1;
   COLOR_GREEN                  : constant := 2;
   COLOR_YELLOW                 : constant := 3;
   COLOR_BLUE                   : constant := 4;
   COLOR_MAGENTA                : constant := 5;
   COLOR_CYAN                   : constant := 6;
   COLOR_WHITE                  : constant := 7;

   --  ETI return codes from ncurses.h

   E_OK                         : constant := 0;
   E_SYSTEM_ERROR               : constant := -1;
   E_BAD_ARGUMENT               : constant := -2;
   E_POSTED                     : constant := -3;
   E_CONNECTED                  : constant := -4;
   E_BAD_STATE                  : constant := -5;
   E_NO_ROOM                    : constant := -6;
   E_NOT_POSTED                 : constant := -7;
   E_UNKNOWN_COMMAND            : constant := -8;
   E_NO_MATCH                   : constant := -9;
   E_NOT_SELECTABLE             : constant := -10;
   E_NOT_CONNECTED              : constant := -11;
   E_REQUEST_DENIED             : constant := -12;
   E_INVALID_FIELD              : constant := -13;
   E_CURRENT                    : constant := -14;

   --  Input key codes not defined in any ncurses manpage

   KEY_MIN                      : constant := 257;
   KEY_MAX                      : constant := 511;
   KEY_CODE_YES                 : constant := 256;

   --  Input key codes from getch(3NCURSES)

   KEY_BREAK                    : constant := 257;
   KEY_DOWN                     : constant := 258;
   KEY_UP                       : constant := 259;
   KEY_LEFT                     : constant := 260;
   KEY_RIGHT                    : constant := 261;
   KEY_HOME                     : constant := 262;
   KEY_BACKSPACE                : constant := 263;
   KEY_F0                       : constant := 264;
   KEY_F1                       : constant := 265;
   KEY_F2                       : constant := 266;
   KEY_F3                       : constant := 267;
   KEY_F4                       : constant := 268;
   KEY_F5                       : constant := 269;
   KEY_F6                       : constant := 270;
   KEY_F7                       : constant := 271;
   KEY_F8                       : constant := 272;
   KEY_F9                       : constant := 273;
   KEY_F10                      : constant := 274;
   KEY_F11                      : constant := 275;
   KEY_F12                      : constant := 276;
   KEY_F13                      : constant := 277;
   KEY_F14                      : constant := 278;
   KEY_F15                      : constant := 279;
   KEY_F16                      : constant := 280;
   KEY_F17                      : constant := 281;
   KEY_F18                      : constant := 282;
   KEY_F19                      : constant := 283;
   KEY_F20                      : constant := 284;
   KEY_F21                      : constant := 285;
   KEY_F22                      : constant := 286;
   KEY_F23                      : constant := 287;
   KEY_F24                      : constant := 288;
   KEY_DL                       : constant := 328;
   KEY_IL                       : constant := 329;
   KEY_DC                       : constant := 330;
   KEY_IC                       : constant := 331;
   KEY_EIC                      : constant := 332;
   KEY_CLEAR                    : constant := 333;
   KEY_EOS                      : constant := 334;
   KEY_EOL                      : constant := 335;
   KEY_SF                       : constant := 336;
   KEY_SR                       : constant := 337;
   KEY_NPAGE                    : constant := 338;
   KEY_PPAGE                    : constant := 339;
   KEY_STAB                     : constant := 340;
   KEY_CTAB                     : constant := 341;
   KEY_CATAB                    : constant := 342;
   KEY_ENTER                    : constant := 343;
   KEY_SRESET                   : constant := 344;
   KEY_RESET                    : constant := 345;
   KEY_PRINT                    : constant := 346;
   KEY_LL                       : constant := 347;
   KEY_A1                       : constant := 348;
   KEY_A3                       : constant := 349;
   KEY_B2                       : constant := 350;
   KEY_C1                       : constant := 351;
   KEY_C3                       : constant := 352;
   KEY_BTAB                     : constant := 353;
   KEY_BEG                      : constant := 354;
   KEY_CANCEL                   : constant := 355;
   KEY_CLOSE                    : constant := 356;
   KEY_COMMAND                  : constant := 357;
   KEY_COPY                     : constant := 358;
   KEY_CREATE                   : constant := 359;
   KEY_END                      : constant := 360;
   KEY_EXIT                     : constant := 361;
   KEY_FIND                     : constant := 362;
   KEY_HELP                     : constant := 363;
   KEY_MARK                     : constant := 364;
   KEY_MESSAGE                  : constant := 365;
   KEY_MOVE                     : constant := 366;
   KEY_NEXT                     : constant := 367;
   KEY_OPEN                     : constant := 368;
   KEY_OPTIONS                  : constant := 369;
   KEY_PREVIOUS                 : constant := 370;
   KEY_REDO                     : constant := 371;
   KEY_REFERENCE                : constant := 372;
   KEY_REFRESH                  : constant := 373;
   KEY_REPLACE                  : constant := 374;
   KEY_RESTART                  : constant := 375;
   KEY_RESUME                   : constant := 376;
   KEY_SAVE                     : constant := 377;
   KEY_SBEG                     : constant := 378;
   KEY_SCANCEL                  : constant := 379;
   KEY_SCOMMAND                 : constant := 380;
   KEY_SCOPY                    : constant := 381;
   KEY_SCREATE                  : constant := 382;
   KEY_SDC                      : constant := 383;
   KEY_SDL                      : constant := 384;
   KEY_SELECT                   : constant := 385;
   KEY_SEND                     : constant := 386;
   KEY_SEOL                     : constant := 387;
   KEY_SEXIT                    : constant := 388;
   KEY_SFIND                    : constant := 389;
   KEY_SHELP                    : constant := 390;
   KEY_SHOME                    : constant := 391;
   KEY_SIC                      : constant := 392;
   KEY_SLEFT                    : constant := 393;
   KEY_SMESSAGE                 : constant := 394;
   KEY_SMOVE                    : constant := 395;
   KEY_SNEXT                    : constant := 396;
   KEY_SOPTIONS                 : constant := 397;
   KEY_SPREVIOUS                : constant := 398;
   KEY_SPRINT                   : constant := 399;
   KEY_SREDO                    : constant := 400;
   KEY_SREPLACE                 : constant := 401;
   KEY_SRIGHT                   : constant := 402;
   KEY_SRSUME                   : constant := 403;
   KEY_SSAVE                    : constant := 404;
   KEY_SSUSPEND                 : constant := 405;
   KEY_SUNDO                    : constant := 406;
   KEY_SUSPEND                  : constant := 407;
   KEY_UNDO                     : constant := 408;
   KEY_MOUSE                    : constant := 409;
   KEY_RESIZE                   : constant := 410;

   --  alternate character codes (ACS) from addch(3NCURSES)

   ACS_ULCORNER                 : constant := 108;
   ACS_LLCORNER                 : constant := 109;
   ACS_URCORNER                 : constant := 107;
   ACS_LRCORNER                 : constant := 106;
   ACS_LTEE                     : constant := 116;
   ACS_RTEE                     : constant := 117;
   ACS_BTEE                     : constant := 118;
   ACS_TTEE                     : constant := 119;
   ACS_HLINE                    : constant := 113;
   ACS_VLINE                    : constant := 120;
   ACS_PLUS                     : constant := 110;
   ACS_S1                       : constant := 111;
   ACS_S9                       : constant := 115;
   ACS_DIAMOND                  : constant := 96;
   ACS_CKBOARD                  : constant := 97;
   ACS_DEGREE                   : constant := 102;
   ACS_PLMINUS                  : constant := 103;
   ACS_BULLET                   : constant := 126;
   ACS_LARROW                   : constant := 44;
   ACS_RARROW                   : constant := 43;
   ACS_DARROW                   : constant := 46;
   ACS_UARROW                   : constant := 45;
   ACS_BOARD                    : constant := 104;
   ACS_LANTERN                  : constant := 105;
   ACS_BLOCK                    : constant := 48;
   ACS_S3                       : constant := 112;
   ACS_S7                       : constant := 114;
   ACS_LEQUAL                   : constant := 121;
   ACS_GEQUAL                   : constant := 122;
   ACS_PI                       : constant := 123;
   ACS_NEQUAL                   : constant := 124;
   ACS_STERLING                 : constant := 125;

   --  Menu_Options from opts(3MENU)

   O_ONEVALUE_First             : constant := 0;
   O_ONEVALUE_Last              : constant := 0;
   O_SHOWDESC_First             : constant := 1;
   O_SHOWDESC_Last              : constant := 1;
   O_ROWMAJOR_First             : constant := 2;
   O_ROWMAJOR_Last              : constant := 2;
   O_IGNORECASE_First           : constant := 3;
   O_IGNORECASE_Last            : constant := 3;
   O_SHOWMATCH_First            : constant := 4;
   O_SHOWMATCH_Last             : constant := 4;
   O_NONCYCLIC_First            : constant := 5;
   O_NONCYCLIC_Last             : constant := 5;
   Menu_Options_Size            : constant := 32;

   --  Item_Options from menu_opts(3MENU)

   O_SELECTABLE_First           : constant := 0;
   O_SELECTABLE_Last            : constant := 0;
   Item_Options_Size            : constant := 32;

   --  Field_Options from field_opts(3FORM)

   O_VISIBLE_First              : constant := 0;
   O_VISIBLE_Last               : constant := 0;
   O_ACTIVE_First               : constant := 1;
   O_ACTIVE_Last                : constant := 1;
   O_PUBLIC_First               : constant := 2;
   O_PUBLIC_Last                : constant := 2;
   O_EDIT_First                 : constant := 3;
   O_EDIT_Last                  : constant := 3;
   O_WRAP_First                 : constant := 4;
   O_WRAP_Last                  : constant := 4;
   O_BLANK_First                : constant := 5;
   O_BLANK_Last                 : constant := 5;
   O_AUTOSKIP_First             : constant := 6;
   O_AUTOSKIP_Last              : constant := 6;
   O_NULLOK_First               : constant := 7;
   O_NULLOK_Last                : constant := 7;
   O_PASSOK_First               : constant := 8;
   O_PASSOK_Last                : constant := 8;
   O_STATIC_First               : constant := 9;
   O_STATIC_Last                : constant := 9;
   Field_Options_Size           : constant := 32;

   --  Field_Options from opts(3FORM)

   O_NL_OVERLOAD_First          : constant := 0;
   O_NL_OVERLOAD_Last           : constant := 0;
   O_BS_OVERLOAD_First          : constant := 1;
   O_BS_OVERLOAD_Last           : constant := 1;

   --  MEVENT structure from mouse(3NCURSES)

   MEVENT_id_First              : constant := 0;
   MEVENT_id_Last               : constant := 15;
   MEVENT_x_First               : constant := 32;
   MEVENT_x_Last                : constant := 63;
   MEVENT_y_First               : constant := 64;
   MEVENT_y_Last                : constant := 95;
   MEVENT_z_First               : constant := 96;
   MEVENT_z_Last                : constant := 127;
   MEVENT_bstate_First          : constant := 128;
   MEVENT_bstate_Last           : constant := 159;
   MEVENT_Size                  : constant := 160;

   --  mouse events from mouse(3NCURSES)

   BUTTON1_RELEASED             : constant := 1;
   BUTTON1_PRESSED              : constant := 2;
   BUTTON1_CLICKED              : constant := 4;
   BUTTON1_DOUBLE_CLICKED       : constant := 8;
   BUTTON1_TRIPLE_CLICKED       : constant := 16;
   all_events_button_1          : constant := 31;
   BUTTON2_RELEASED             : constant := 32;
   BUTTON2_PRESSED              : constant := 64;
   BUTTON2_CLICKED              : constant := 128;
   BUTTON2_DOUBLE_CLICKED       : constant := 256;
   BUTTON2_TRIPLE_CLICKED       : constant := 512;
   all_events_button_2          : constant := 992;
   BUTTON3_RELEASED             : constant := 1024;
   BUTTON3_PRESSED              : constant := 2048;
   BUTTON3_CLICKED              : constant := 4096;
   BUTTON3_DOUBLE_CLICKED       : constant := 8192;
   BUTTON3_TRIPLE_CLICKED       : constant := 16384;
   all_events_button_3          : constant := 31744;
   BUTTON4_RELEASED             : constant := 32768;
   BUTTON4_PRESSED              : constant := 65536;
   BUTTON4_CLICKED              : constant := 131072;
   BUTTON4_DOUBLE_CLICKED       : constant := 262144;
   BUTTON4_TRIPLE_CLICKED       : constant := 524288;
   all_events_button_4          : constant := 1015808;
   BUTTON_CTRL                  : constant := 33554432;
   BUTTON_SHIFT                 : constant := 67108864;
   BUTTON_ALT                   : constant := 134217728;
   REPORT_MOUSE_POSITION        : constant := 268435456;
   ALL_MOUSE_EVENTS             : constant := 268435455;

   --  trace selection from trace(3NCURSES)

   TRACE_TIMES_First            : constant := 0;
   TRACE_TIMES_Last             : constant := 0;
   TRACE_TPUTS_First            : constant := 1;
   TRACE_TPUTS_Last             : constant := 1;
   TRACE_UPDATE_First           : constant := 2;
   TRACE_UPDATE_Last            : constant := 2;
   TRACE_MOVE_First             : constant := 3;
   TRACE_MOVE_Last              : constant := 3;
   TRACE_CHARPUT_First          : constant := 4;
   TRACE_CHARPUT_Last           : constant := 4;
   TRACE_CALLS_First            : constant := 5;
   TRACE_CALLS_Last             : constant := 5;
   TRACE_VIRTPUT_First          : constant := 6;
   TRACE_VIRTPUT_Last           : constant := 6;
   TRACE_IEVENT_First           : constant := 7;
   TRACE_IEVENT_Last            : constant := 7;
   TRACE_BITS_First             : constant := 8;
   TRACE_BITS_Last              : constant := 8;
   TRACE_ICALLS_First           : constant := 9;
   TRACE_ICALLS_Last            : constant := 9;
   TRACE_CCALLS_First           : constant := 10;
   TRACE_CCALLS_Last            : constant := 10;
   TRACE_DATABASE_First         : constant := 11;
   TRACE_DATABASE_Last          : constant := 11;
   TRACE_ATTRS_First            : constant := 12;
   TRACE_ATTRS_Last             : constant := 12;
   Trace_Size                   : constant := 32;
end Terminal_Interface.Curses_Constants;
AdaCurses-20170708/doc/ada/terminal_interface-curses-menus-item_user_data__ads.htm0000644000175100001440000002265712340214310026616 0ustar tomusers terminal_interface-curses-menus-item_user_data.ads

File : terminal_interface-curses-menus-item_user_data.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Menus.Item_User_Data             --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2009 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, 1996
--  Version Control:
--  @Revision: 1.17 @
--  @Date: 2009/12/26 17:31:35 @
--  Binding Version 01.00
------------------------------------------------------------------------------

generic
   type User is limited private;
   type User_Access is access User;
package Terminal_Interface.Curses.Menus.Item_User_Data is
   pragma Preelaborate (Terminal_Interface.Curses.Menus.Item_User_Data);

   --  The binding uses the same user pointer for menu items
   --  as the low level C implementation. So you can safely
   --  read or write the user pointer also with the C routines
   --
   --  |=====================================================================
   --  | Man page mitem_userptr.3x
   --  |=====================================================================

   --  #1A NAME="AFU_1"#2|
   procedure Set_User_Data (Itm  : Item;
                            Data : User_Access);
   --  AKA: set_item_userptr
   pragma Inline (Set_User_Data);

   --  #1A NAME="AFU_2"#2|
   procedure Get_User_Data (Itm  : Item;
                            Data : out User_Access);
   --  AKA: item_userptr

   --  #1A NAME="AFU_3"#2|
   function Get_User_Data (Itm  : Item) return User_Access;
   --  AKA: item_userptr
   --  Same as function
   pragma Inline (Get_User_Data);

end Terminal_Interface.Curses.Menus.Item_User_Data;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-float_io__adb.htm0000644000175100001440000002637412340214310025730 0ustar tomusers terminal_interface-curses-text_io-float_io.adb

File : terminal_interface-curses-text_io-float_io.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                Terminal_Interface.Curses.Text_IO.Float_IO                --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.11 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Terminal_Interface.Curses.Text_IO.Aux;

package body Terminal_Interface.Curses.Text_IO.Float_IO is

   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
   package FIO is new Ada.Text_IO.Float_IO (Num);

   procedure Put
     (Win  : Window;
      Item : Num;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp)
   is
      Buf : String (1 .. Field'Last);
      Len : Field := Fore + 1 + Aft;
   begin
      if Exp > 0 then
         Len := Len + 1 + Exp;
      end if;
      FIO.Put (Buf, Item, Aft, Exp);
      Aux.Put_Buf (Win, Buf, Len, False);
   end Put;

   procedure Put
     (Item : Num;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp)
   is
   begin
      Put (Get_Window, Item, Fore, Aft, Exp);
   end Put;

end Terminal_Interface.Curses.Text_IO.Float_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-decimal_io__adb.htm0000644000175100001440000002653112340214310026214 0ustar tomusers terminal_interface-curses-text_io-decimal_io.adb

File : terminal_interface-curses-text_io-decimal_io.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Text_IO.Decimal_IO               --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.11 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Terminal_Interface.Curses.Text_IO.Aux;

package body Terminal_Interface.Curses.Text_IO.Decimal_IO is

   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
   package DIO is new Ada.Text_IO.Decimal_IO (Num);

   procedure Put
     (Win  : Window;
      Item : Num;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp)
   is
      Buf : String (1 .. Field'Last);
      Len : Field := Fore + 1 + Aft;
   begin
      if Exp > 0 then
         Len := Len + 1 + Exp;
      end if;
      DIO.Put (Buf, Item, Aft, Exp);
      Aux.Put_Buf (Win, Buf, Len, False);
   end Put;

   procedure Put
     (Item : Num;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp) is
   begin
      Put (Get_Window, Item, Fore, Aft, Exp);
   end Put;

end Terminal_Interface.Curses.Text_IO.Decimal_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-menus__ads.htm0000644000175100001440000024767312340214310023642 0ustar tomusers terminal_interface-curses-menus.ads

File : terminal_interface-curses-menus.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                      Terminal_Interface.Curses.Menu                      --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2014 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, 1996
--  Version Control:
--  @Revision: 1.31 @
--  @Date: 2014/05/24 21:31:57 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with System;
with Ada.Characters.Latin_1;

package Terminal_Interface.Curses.Menus is
   pragma Preelaborate (Terminal_Interface.Curses.Menus);
   pragma Linker_Options ("-lmenu" & Curses_Constants.DFT_ARG_SUFFIX);

   Space : Character renames Ada.Characters.Latin_1.Space;

   type Item is private;
   type Menu is private;

   ---------------------------
   --  Interface constants  --
   ---------------------------
   Null_Item : constant Item;
   Null_Menu : constant Menu;

   subtype Menu_Request_Code is Key_Code
     range (Key_Max + 1) .. (Key_Max + 17);

   --  The prefix M_ stands for "Menu Request"
   M_Left_Item       : constant Menu_Request_Code := Key_Max + 1;
   M_Right_Item      : constant Menu_Request_Code := Key_Max + 2;
   M_Up_Item         : constant Menu_Request_Code := Key_Max + 3;
   M_Down_Item       : constant Menu_Request_Code := Key_Max + 4;
   M_ScrollUp_Line   : constant Menu_Request_Code := Key_Max + 5;
   M_ScrollDown_Line : constant Menu_Request_Code := Key_Max + 6;
   M_ScrollDown_Page : constant Menu_Request_Code := Key_Max + 7;
   M_ScrollUp_Page   : constant Menu_Request_Code := Key_Max + 8;
   M_First_Item      : constant Menu_Request_Code := Key_Max + 9;
   M_Last_Item       : constant Menu_Request_Code := Key_Max + 10;
   M_Next_Item       : constant Menu_Request_Code := Key_Max + 11;
   M_Previous_Item   : constant Menu_Request_Code := Key_Max + 12;
   M_Toggle_Item     : constant Menu_Request_Code := Key_Max + 13;
   M_Clear_Pattern   : constant Menu_Request_Code := Key_Max + 14;
   M_Back_Pattern    : constant Menu_Request_Code := Key_Max + 15;
   M_Next_Match      : constant Menu_Request_Code := Key_Max + 16;
   M_Previous_Match  : constant Menu_Request_Code := Key_Max + 17;

   --  For those who like the old 'C' names for the request codes
   REQ_LEFT_ITEM     : Menu_Request_Code renames M_Left_Item;
   REQ_RIGHT_ITEM    : Menu_Request_Code renames M_Right_Item;
   REQ_UP_ITEM       : Menu_Request_Code renames M_Up_Item;
   REQ_DOWN_ITEM     : Menu_Request_Code renames M_Down_Item;
   REQ_SCR_ULINE     : Menu_Request_Code renames M_ScrollUp_Line;
   REQ_SCR_DLINE     : Menu_Request_Code renames M_ScrollDown_Line;
   REQ_SCR_DPAGE     : Menu_Request_Code renames M_ScrollDown_Page;
   REQ_SCR_UPAGE     : Menu_Request_Code renames M_ScrollUp_Page;
   REQ_FIRST_ITEM    : Menu_Request_Code renames M_First_Item;
   REQ_LAST_ITEM     : Menu_Request_Code renames M_Last_Item;
   REQ_NEXT_ITEM     : Menu_Request_Code renames M_Next_Item;
   REQ_PREV_ITEM     : Menu_Request_Code renames M_Previous_Item;
   REQ_TOGGLE_ITEM   : Menu_Request_Code renames M_Toggle_Item;
   REQ_CLEAR_PATTERN : Menu_Request_Code renames M_Clear_Pattern;
   REQ_BACK_PATTERN  : Menu_Request_Code renames M_Back_Pattern;
   REQ_NEXT_MATCH    : Menu_Request_Code renames M_Next_Match;
   REQ_PREV_MATCH    : Menu_Request_Code renames M_Previous_Match;

   procedure Request_Name (Key  : Menu_Request_Code;
                           Name : out String);

   function  Request_Name (Key : Menu_Request_Code) return String;
   --  Same as function

   ------------------
   --  Exceptions  --
   ------------------

   Menu_Exception : exception;
   --
   --  Menu options
   --
   type Menu_Option_Set is
      record
         One_Valued        : Boolean;
         Show_Descriptions : Boolean;
         Row_Major_Order   : Boolean;
         Ignore_Case       : Boolean;
         Show_Matches      : Boolean;
         Non_Cyclic        : Boolean;
      end record;
   pragma Convention (C_Pass_By_Copy, Menu_Option_Set);

   for Menu_Option_Set use
      record
         One_Valued        at 0 range Curses_Constants.O_ONEVALUE_First
           .. Curses_Constants.O_ONEVALUE_Last;
         Show_Descriptions at 0 range Curses_Constants.O_SHOWDESC_First
           .. Curses_Constants.O_SHOWDESC_Last;
         Row_Major_Order   at 0 range Curses_Constants.O_ROWMAJOR_First
           .. Curses_Constants.O_ROWMAJOR_Last;
         Ignore_Case       at 0 range Curses_Constants.O_IGNORECASE_First
           .. Curses_Constants.O_IGNORECASE_Last;
         Show_Matches      at 0 range Curses_Constants.O_SHOWMATCH_First
           .. Curses_Constants.O_SHOWMATCH_Last;
         Non_Cyclic        at 0 range Curses_Constants.O_NONCYCLIC_First
           .. Curses_Constants.O_NONCYCLIC_Last;
      end record;
   pragma Warnings (Off);
   for Menu_Option_Set'Size use Curses_Constants.Menu_Options_Size;
   pragma Warnings (On);

   function Default_Menu_Options return Menu_Option_Set;
   --  Initial default options for a menu.
   pragma Inline (Default_Menu_Options);
   --
   --  Item options
   --
   type Item_Option_Set is
      record
         Selectable : Boolean;
      end record;
   pragma Convention (C_Pass_By_Copy, Item_Option_Set);

   for Item_Option_Set use
      record
         Selectable at 0 range Curses_Constants.O_SELECTABLE_First
           ..  Curses_Constants.O_SELECTABLE_Last;
      end record;
   pragma Warnings (Off);
   for Item_Option_Set'Size use Curses_Constants.Item_Options_Size;
   pragma Warnings (On);

   function Default_Item_Options return Item_Option_Set;
   --  Initial default options for an item.
   pragma Inline (Default_Item_Options);

   --
   --  Item Array
   --
   type Item_Array is array (Positive range <>) of aliased Item;
   pragma Convention (C, Item_Array);

   type Item_Array_Access is access Item_Array;

   procedure Free (IA         : in out Item_Array_Access;
                   Free_Items : Boolean := False);
   --  Release the memory for an allocated item array
   --  If Free_Items is True, call Delete() for all the items in
   --  the array.

   --  |=====================================================================
   --  | Man page mitem_new.3x
   --  |=====================================================================

   --  #1A NAME="AFU_1"#2|
   function Create (Name        : String;
                    Description : String := "") return Item;
   --  AKA: new_item()
   --  Not inlined.

   --  #1A NAME="AFU_2"#2|
   function New_Item (Name        : String;
                      Description : String := "") return Item
     renames Create;
   --  AKA: new_item()

   --  #1A NAME="AFU_3"#2|
   procedure Delete (Itm : in out Item);
   --  AKA: free_item()
   --  Resets Itm to Null_Item

   --  |=====================================================================
   --  | Man page mitem_value.3x
   --  |=====================================================================

   --  #1A NAME="AFU_4"#2|
   procedure Set_Value (Itm   : Item;
                        Value : Boolean := True);
   --  AKA: set_item_value()
   pragma Inline (Set_Value);

   --  #1A NAME="AFU_5"#2|
   function Value (Itm : Item) return Boolean;
   --  AKA: item_value()
   pragma Inline (Value);

   --  |=====================================================================
   --  | Man page mitem_visible.3x
   --  |=====================================================================

   --  #1A NAME="AFU_6"#2|
   function Visible (Itm : Item) return Boolean;
   --  AKA: item_visible()
   pragma Inline (Visible);

   --  |=====================================================================
   --  | Man page mitem_opts.3x
   --  |=====================================================================

   --  #1A NAME="AFU_7"#2|
   procedure Set_Options (Itm     : Item;
                          Options : Item_Option_Set);
   --  AKA: set_item_opts()
   --  An overloaded Set_Options is defined later. Pragma Inline appears there

   --  #1A NAME="AFU_8"#2|
   procedure Switch_Options (Itm     : Item;
                             Options : Item_Option_Set;
                             On      : Boolean := True);
   --  AKA: item_opts_on()
   --  AKA: item_opts_off()
   --  An overloaded Switch_Options is defined later.
   --  Pragma Inline appears there

   --  #1A NAME="AFU_9"#2|
   procedure Get_Options (Itm     : Item;
                          Options : out Item_Option_Set);
   --  AKA: item_opts()

   --  #1A NAME="AFU_10"#2|
   function Get_Options (Itm : Item := Null_Item) return Item_Option_Set;
   --  AKA: item_opts()
   --  An overloaded Get_Options is defined later. Pragma Inline appears there

   --  |=====================================================================
   --  | Man page mitem_name.3x
   --  |=====================================================================

   --  #1A NAME="AFU_11"#2|
   procedure Name (Itm  : Item;
                   Name : out String);
   --  AKA: item_name()
   function  Name (Itm : Item) return String;
   --  AKA: item_name()
   --  Implemented as function
   pragma Inline (Name);

   --  #1A NAME="AFU_12"#2|
   procedure Description (Itm         : Item;
                          Description : out String);
   --  AKA: item_description();

   function  Description (Itm : Item) return String;
   --  AKA: item_description();
   --  Implemented as function
   pragma Inline (Description);

   --  |=====================================================================
   --  | Man page mitem_current.3x
   --  |=====================================================================

   --  #1A NAME="AFU_13"#2|
   procedure Set_Current (Men : Menu;
                          Itm : Item);
   --  AKA: set_current_item()
   pragma Inline (Set_Current);

   --  #1A NAME="AFU_14"#2|
   function Current (Men : Menu) return Item;
   --  AKA: current_item()
   pragma Inline (Current);

   --  #1A NAME="AFU_15"#2|
   procedure Set_Top_Row (Men  : Menu;
                          Line : Line_Position);
   --  AKA: set_top_row()
   pragma Inline (Set_Top_Row);

   --  #1A NAME="AFU_16"#2|
   function Top_Row (Men : Menu) return Line_Position;
   --  AKA: top_row()
   pragma Inline (Top_Row);

   --  #1A NAME="AFU_17"#2|
   function Get_Index (Itm : Item) return Positive;
   --  AKA: item_index()
   --  Please note that in this binding we start the numbering of items
   --  with 1. So this is number is one more than you get from the low
   --  level call.
   pragma Inline (Get_Index);

   --  |=====================================================================
   --  | Man page menu_post.3x
   --  |=====================================================================

   --  #1A NAME="AFU_18"#2|
   procedure Post (Men  : Menu;
                   Post : Boolean := True);
   --  AKA: post_menu()
   --  AKA: unpost_menu()
   pragma Inline (Post);

   --  |=====================================================================
   --  | Man page menu_opts.3x
   --  |=====================================================================

   --  #1A NAME="AFU_19"#2|
   procedure Set_Options (Men     : Menu;
                          Options : Menu_Option_Set);
   --  AKA: set_menu_opts()
   pragma Inline (Set_Options);

   --  #1A NAME="AFU_20"#2|
   procedure Switch_Options (Men     : Menu;
                             Options : Menu_Option_Set;
                             On      : Boolean := True);
   --  AKA: menu_opts_on()
   --  AKA: menu_opts_off()
   pragma Inline (Switch_Options);

   --  #1A NAME="AFU_21"#2|
   procedure Get_Options (Men     : Menu;
                          Options : out Menu_Option_Set);
   --  AKA: menu_opts()

   --  #1A NAME="AFU_22"#2|
   function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set;
   --  AKA: menu_opts()
   pragma Inline (Get_Options);

   --  |=====================================================================
   --  | Man page menu_win.3x
   --  |=====================================================================

   --  #1A NAME="AFU_23"#2|
   procedure Set_Window (Men : Menu;
                         Win : Window);
   --  AKA: set_menu_win()
   pragma Inline (Set_Window);

   --  #1A NAME="AFU_24"#2|
   function Get_Window (Men : Menu) return Window;
   --  AKA: menu_win()
   pragma Inline (Get_Window);

   --  #1A NAME="AFU_25"#2|
   procedure Set_Sub_Window (Men : Menu;
                             Win : Window);
   --  AKA: set_menu_sub()
   pragma Inline (Set_Sub_Window);

   --  #1A NAME="AFU_26"#2|
   function Get_Sub_Window (Men : Menu) return Window;
   --  AKA: menu_sub()
   pragma Inline (Get_Sub_Window);

   --  #1A NAME="AFU_27"#2|
   procedure Scale (Men     : Menu;
                    Lines   : out Line_Count;
                    Columns : out Column_Count);
   --  AKA: scale_menu()
   pragma Inline (Scale);

   --  |=====================================================================
   --  | Man page menu_cursor.3x
   --  |=====================================================================

   --  #1A NAME="AFU_28"#2|
   procedure Position_Cursor (Men : Menu);
   --  AKA: pos_menu_cursor()
   pragma Inline (Position_Cursor);

   --  |=====================================================================
   --  | Man page menu_mark.3x
   --  |=====================================================================

   --  #1A NAME="AFU_29"#2|
   procedure Set_Mark (Men  : Menu;
                       Mark : String);
   --  AKA: set_menu_mark()
   pragma Inline (Set_Mark);

   --  #1A NAME="AFU_30"#2|
   procedure Mark (Men  : Menu;
                   Mark : out String);
   --  AKA: menu_mark()

   function  Mark (Men : Menu) return String;
   --  AKA: menu_mark()
   --  Implemented as function
   pragma Inline (Mark);

   --  |=====================================================================
   --  | Man page menu_attributes.3x
   --  |=====================================================================

   --  #1A NAME="AFU_31"#2|
   procedure Set_Foreground
     (Men   : Menu;
      Fore  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First);
   --  AKA: set_menu_fore()
   pragma Inline (Set_Foreground);

   --  #1A NAME="AFU_32"#2|
   procedure Foreground (Men   : Menu;
                         Fore  : out Character_Attribute_Set);
   --  AKA: menu_fore()

   --  #1A NAME="AFU_33"#2|
   procedure Foreground (Men   : Menu;
                         Fore  : out Character_Attribute_Set;
                         Color : out Color_Pair);
   --  AKA: menu_fore()
   pragma Inline (Foreground);

   --  #1A NAME="AFU_34"#2|
   procedure Set_Background
     (Men   : Menu;
      Back  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First);
   --  AKA: set_menu_back()
   pragma Inline (Set_Background);

   --  #1A NAME="AFU_35"#2|
   procedure Background (Men  : Menu;
                         Back : out Character_Attribute_Set);
   --  AKA: menu_back()
   --  #1A NAME="AFU_36"#2|

   procedure Background (Men   : Menu;
                         Back  : out Character_Attribute_Set;
                         Color : out Color_Pair);
   --  AKA: menu_back()
   pragma Inline (Background);

   --  #1A NAME="AFU_37"#2|
   procedure Set_Grey
     (Men   : Menu;
      Grey  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First);
   --  AKA: set_menu_grey()
   pragma Inline (Set_Grey);

   --  #1A NAME="AFU_38"#2|
   procedure Grey (Men  : Menu;
                   Grey : out Character_Attribute_Set);
   --  AKA: menu_grey()

   --  #1A NAME="AFU_39"#2|
   procedure Grey
     (Men   : Menu;
      Grey  : out Character_Attribute_Set;
      Color : out Color_Pair);
   --  AKA: menu_grey()
   pragma Inline (Grey);

   --  #1A NAME="AFU_40"#2|
   procedure Set_Pad_Character (Men : Menu;
                                Pad : Character := Space);
   --  AKA: set_menu_pad()
   pragma Inline (Set_Pad_Character);

   --  #1A NAME="AFU_41"#2|
   procedure Pad_Character (Men : Menu;
                            Pad : out Character);
   --  AKA: menu_pad()
   pragma Inline (Pad_Character);

   --  |=====================================================================
   --  | Man page menu_spacing.3x
   --  |=====================================================================

   --  #1A NAME="AFU_42"#2|
   procedure Set_Spacing (Men   : Menu;
                          Descr : Column_Position := 0;
                          Row   : Line_Position   := 0;
                          Col   : Column_Position := 0);
   --  AKA: set_menu_spacing()
   pragma Inline (Set_Spacing);

   --  #1A NAME="AFU_43"#2|
   procedure Spacing (Men   : Menu;
                      Descr : out Column_Position;
                      Row   : out Line_Position;
                      Col   : out Column_Position);
   --  AKA: menu_spacing()
   pragma Inline (Spacing);

   --  |=====================================================================
   --  | Man page menu_pattern.3x
   --  |=====================================================================

   --  #1A NAME="AFU_44"#2|
   function Set_Pattern (Men  : Menu;
                         Text : String) return Boolean;
   --  AKA: set_menu_pattern()
   --  Return TRUE if the pattern matches, FALSE otherwise
   pragma Inline (Set_Pattern);

   --  #1A NAME="AFU_45"#2|
   procedure Pattern (Men  : Menu;
                      Text : out String);
   --  AKA: menu_pattern()
   pragma Inline (Pattern);

   --  |=====================================================================
   --  | Man page menu_format.3x
   --  |=====================================================================

   --  #1A NAME="AFU_46"#2|
   procedure Set_Format (Men     : Menu;
                         Lines   : Line_Count;
                         Columns : Column_Count);
   --  Not implemented: 0 argument for Lines or Columns;
   --  instead use Format to get the current sizes
   --      The  default  format  is  16  rows,  1  column.    Calling
   --      set_menu_format  with a null menu pointer will change this
   --      default.  A zero row or column argument to set_menu_format
   --      is  interpreted  as  a  request  not to change the current
   --      value.
   --  AKA: set_menu_format()
   pragma Inline (Set_Format);

   --  #1A NAME="AFU_47"#2|
   procedure Format (Men     : Menu;
                     Lines   : out Line_Count;
                     Columns : out Column_Count);
   --  AKA: menu_format()
   pragma Inline (Format);

   --  |=====================================================================
   --  | Man page menu_hook.3x
   --  |=====================================================================

   type Menu_Hook_Function is access procedure (Men : Menu);
   pragma Convention (C, Menu_Hook_Function);

   --  #1A NAME="AFU_48"#2|
   procedure Set_Item_Init_Hook (Men  : Menu;
                                 Proc : Menu_Hook_Function);
   --  AKA: set_item_init()
   pragma Inline (Set_Item_Init_Hook);

   --  #1A NAME="AFU_49"#2|
   procedure Set_Item_Term_Hook (Men  : Menu;
                                 Proc : Menu_Hook_Function);
   --  AKA: set_item_term()
   pragma Inline (Set_Item_Term_Hook);

   --  #1A NAME="AFU_50"#2|
   procedure Set_Menu_Init_Hook (Men  : Menu;
                                 Proc : Menu_Hook_Function);
   --  AKA: set_menu_init()
   pragma Inline (Set_Menu_Init_Hook);

   --  #1A NAME="AFU_51"#2|
   procedure Set_Menu_Term_Hook (Men  : Menu;
                                 Proc : Menu_Hook_Function);
   --  AKA: set_menu_term()
   pragma Inline (Set_Menu_Term_Hook);

   --  #1A NAME="AFU_52"#2|
   function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function;
   --  AKA: item_init()
   pragma Inline (Get_Item_Init_Hook);

   --  #1A NAME="AFU_53"#2|
   function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function;
   --  AKA: item_term()
   pragma Inline (Get_Item_Term_Hook);

   --  #1A NAME="AFU_54"#2|
   function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function;
   --  AKA: menu_init()
   pragma Inline (Get_Menu_Init_Hook);

   --  #1A NAME="AFU_55"#2|
   function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function;
   --  AKA: menu_term()
   pragma Inline (Get_Menu_Term_Hook);

   --  |=====================================================================
   --  | Man page menu_items.3x
   --  |=====================================================================

   --  #1A NAME="AFU_56"#2|
   procedure Redefine (Men   : Menu;
                       Items : Item_Array_Access);
   --  AKA: set_menu_items()
   pragma Inline (Redefine);

   procedure Set_Items (Men   : Menu;
                        Items : Item_Array_Access) renames Redefine;
   --  pragma Inline (Set_Items);

   --  #1A NAME="AFU_57"#2|
   function Items (Men   : Menu;
                   Index : Positive) return Item;
   --  AKA: menu_items()
   pragma Inline (Items);

   --  #1A NAME="AFU_58"#2|
   function Item_Count (Men : Menu) return Natural;
   --  AKA: item_count()
   pragma Inline (Item_Count);

   --  |=====================================================================
   --  | Man page menu_new.3x
   --  |=====================================================================

   --  #1A NAME="AFU_59"#2|
   function Create (Items : Item_Array_Access) return Menu;
   --  AKA: new_menu()
   --  Not inlined

   function New_Menu (Items : Item_Array_Access) return Menu renames Create;

   --  #1A NAME="AFU_60"#2|
   procedure Delete (Men : in out Menu);
   --  AKA: free_menu()
   --  Reset Men to Null_Menu
   --  Not inlined

   --  |=====================================================================
   --  | Man page menu_driver.3x
   --  |=====================================================================

   type Driver_Result is (Menu_Ok,
                          Request_Denied,
                          Unknown_Request,
                          No_Match);

   --  #1A NAME="AFU_61"#2|
   function Driver (Men : Menu;
                    Key : Key_Code) return Driver_Result;
   --  AKA: menu_driver()
   --  Driver is not inlined

   --  #1A NAME="AFU_62"#2|
   --  Not Implemented: menu_request_name, menu_request_by_name
-------------------------------------------------------------------------------
private
   type Item   is new System.Storage_Elements.Integer_Address;
   type Menu   is new System.Storage_Elements.Integer_Address;

   Null_Item : constant Item := 0;
   Null_Menu : constant Menu := 0;

end Terminal_Interface.Curses.Menus;
AdaCurses-20170708/doc/ada/table.html0000644000175100001440000016102613076721162015637 0ustar tomusers Correspondence between ncurses C and Ada functions

Correspondence between ncurses C and Ada functions

Sorted by C function name

C nameAda nameman page
assume_default_colors()Assume_Default_Colorsdefault_colors.3x
baudrate()Baudratecurs_termattrs.3x
beep()Beepcurs_beep.3x
bottom_panel()Bottompanel.3x
box()Boxcurs_border.3x
can_change_color()Can_Change_Colorcurs_color.3x
cbreak()Set_Cbreak_Modecurs_inopts.3x
clearok()Clear_On_Next_Updatecurs_outopts.3x
color_content()Color_Contentcurs_color.3x
copywin()Copycurs_overlay.3x
current_field()Currentform_page.3x
current_item()Currentmitem_current.3x
curscrCurrent_Windowcurs_initscr.3x
curses_version()Curses_Versioncurs_extend.3x
curs_set()Set_Cursor_Visibilitycurs_kernel.3x
data_ahead()Data_Aheadform_data.3x
data_behind()Data_Behindform_data.3x
define_key()Define_Keydefine_key.3x
def_prog_mode()Save_Curses_Modecurs_kernel.3x
delay_output()Delay_Outputcurs_util.3x
del_panel()Deletepanel.3x
delwin()Deletecurs_window.3x
derwin()Derived_Windowcurs_window.3x
doupdate()Update_Screencurs_refresh.3x
dup_field()Duplicateform_field_new.3x
dupwin()Duplicatecurs_window.3x
dynamic_field_info()Dynamic_Infoform_field_info.3x
echo()Set_Echo_Modecurs_inopts.3x
endwin()End_Windowscurs_initscr.3x
erasechar()Erase_Charactercurs_termattrs.3x
field_back()Backgroundform_field_attributes.3x
field_back()Backgroundform_field_attributes.3x
field_buffer()Get_Bufferform_field_buffer.3x
field_count()Field_Countform_field.3x
field_fore()Foregroundform_field_attributes.3x
field_fore()Foregroundform_field_attributes.3x
field_index()Get_Indexform_page.3x
field_info()Infoform_field_info.3x
field_init()Get_Field_Init_Hookform_hook.3x
field_just()Get_Justificationform_field_just.3x
field_opts_on()Switch_Optionsform_field_opts.3x
field_opts()Get_Optionsform_field_opts.3x
field_opts()Get_Optionsform_field_opts.3x
field_pad()Pad_Characterform_field_attributes.3x
field_status()Changedform_field_buffer.3x
field_term()Get_Field_Term_Hookform_hook.3x
field_type()Get_Typeform_field_validation.3x
field_userptrGet_User_Dataform_field_userptr.3x
field_userptrGet_User_Dataform_field_userptr.3x
flash()Flash_Screencurs_beep.3x
flushinp()Flush_Inputcurs_util.3x
form_driver()Driverform_driver.3x
form_fields()Fieldsform_field.3x
form_init()Get_Form_Init_Hookform_hook.3x
form_opts_on()Switch_Optionsform_opts.3x
form_opts()Get_Optionsform_opts.3x
form_opts()Get_Optionsform_opts.3x
form_page()Pageform_page.3x
form_sub()Get_Sub_Windowform_win.3x
form_term()Get_Form_Term_Hookform_hook.3x
form_userptrGet_User_Dataform_userptr.3x
form_userptrGet_User_Dataform_userptr.3x
form_win()Get_Windowform_win.3x
free_field()Deleteform_field_new.3x
free_form()Deleteform_new.3x
free_item()Deletemitem_new.3x
free_menu()Deletemenu_new.3x
getbegyx()Get_Window_Positioncurs_getyx.3x
getmaxyx()Get_Sizecurs_getyx.3x
getmouse()Get_Mousecurs_mouse.3x
getparyx()Get_Origin_Relative_To_Parentcurs_getyx.3x
getyx()Get_Cursor_Positioncurs_getyx.3x
halfdelay()Half_Delaycurs_inopts.3x
has_colors()Has_Colorscurs_color.3x
has_ic()Has_Insert_Charactercurs_termattrs.3x
has_il()Has_Insert_Linecurs_termattrs.3x
has_key()Has_Keycurs_getch.3x
hide_panel()Hidepanel.3x
idcok()Use_Insert_Delete_Charactercurs_outopts.3x
idlok()Use_Insert_Delete_Linecurs_outopts.3x
immedok()Immediate_Update_Modecurs_outopts.3x
init_color()Init_Colorcurs_color.3x
init_pair()Init_Paircurs_color.3x
initscr()Init_Screencurs_initscr.3x
initscr()Init_Windowscurs_initscr.3x
intrflush()Set_Flush_On_Interrupt_Modecurs_inopts.3x
isendwin()Is_End_Windowcurs_initscr.3x
is_linetouched()Is_Touchedcurs_touch.3x
is_wintouched()Is_Touchedcurs_touch.3x
item_count()Item_Countmenu_items.3x
item_description();Descriptionmitem_name.3x
item_index()Get_Indexmitem_current.3x
item_init()Get_Item_Init_Hookmenu_hook.3x
item_name()Namemitem_name.3x
item_opts_on()Switch_Optionsmitem_opts.3x
item_opts()Get_Optionsmitem_opts.3x
item_opts()Get_Optionsmitem_opts.3x
item_term()Get_Item_Term_Hookmenu_hook.3x
item_userptrGet_User_Datamitem_userptr.3x
item_userptrGet_User_Datamitem_userptr.3x
item_value()Valuemitem_value.3x
item_visible()Visiblemitem_visible.3x
keyname()Key_Namecurs_util.3x
keyname()Key_Namecurs_util.3x
keyok()Enable_Keykeyok.3x
keypad()Set_KeyPad_Modecurs_inopts.3x
killchar()Kill_Charactercurs_termattrs.3x
leaveok()Leave_Cursor_After_Updatecurs_outopts.3x
link_field()Linkform_field_new.3x
longname()Long_Namecurs_termattrs.3x
longname()Long_Namecurs_termattrs.3x
menu_back()Backgroundmenu_attributes.3x
menu_back()Backgroundmenu_attributes.3x
menu_driver()Drivermenu_driver.3x
menu_fore()Foregroundmenu_attributes.3x
menu_fore()Foregroundmenu_attributes.3x
menu_format()Formatmenu_format.3x
menu_grey()Greymenu_attributes.3x
menu_grey()Greymenu_attributes.3x
menu_init()Get_Menu_Init_Hookmenu_hook.3x
menu_items()Itemsmenu_items.3x
menu_mark()Markmenu_mark.3x
menu_opts_on()Switch_Optionsmenu_opts.3x
menu_opts()Get_Optionsmenu_opts.3x
menu_opts()Get_Optionsmenu_opts.3x
menu_pad()Pad_Charactermenu_attributes.3x
menu_pattern()Patternmenu_pattern.3x
menu_requestname.3xmenu_driver.3x
menu_spacing()Spacingmenu_spacing.3x
menu_sub()Get_Sub_Windowmenu_win.3x
menu_term()Get_Menu_Term_Hookmenu_hook.3x
menu_userptrGet_User_Datamenu_userptr.3x
menu_userptrGet_User_Datamenu_userptr.3x
menu_win()Get_Windowmenu_win.3x
meta()Set_Meta_Modecurs_inopts.3x
mouseinterval()Mouse_Intervalcurs_mouse.3x
mousemask()Start_Mousecurs_mouse.3x
move_field()Moveform_field.3x
move_panel()Movepanel.3x
mvderwin()Move_Derived_Windowcurs_window.3x
mvwaddchnstr()Addcurs_addchstr.3x
mvwaddch()Addcurs_addch.3x
mvwaddnstr()Addcurs_addstr.3x
mvwchgat()Change_Attributescurs_attr.3x
mvwdelch()Delete_Charactercurs_delch.3x
mvwgetnstr()Getcurs_getstr.3x
mvwinchnstr()Peekcurs_inchstr.3x
mvwinch()Peekcurs_inch.3x
mvwinnstr()Peekcurs_instr.3x
mvwinsch()Insertcurs_insch.3x
mvwinsnstr()Insertcurs_insstr.3x
mvwin()Move_Windowcurs_window.3x
napms()Nap_Milli_Secondscurs_kernel.3x
_nc_freeall()Curses_Free_Allcurs_trace.3x
new_field()Createform_field_new.3x
new_field()New_Fieldform_field_new.3x
new_form()Createform_new.3x
new_form()New_Formform_new.3x
new_item()Createmitem_new.3x
new_item()New_Itemmitem_new.3x
new_menu()Createmenu_new.3x
newpad()New_Padcurs_pad.3x
new_page()Is_New_Pageform_new_page.3x
new_panel()Createpanel.3x
new_panel()New_Panelpanel.3x
newwin()Createcurs_window.3x
nl()Set_NL_Modecurs_outopts.3x
nodelay()Set_NoDelay_Modecurs_inopts.3x
notimeout()Set_Escape_Time_Modecurs_inopts.3x
overlay()Overlaycurs_overlay.3x
overwrite()Overwritecurs_overlay.3x
pair_content()Pair_Contentcurs_color.3x
panel_above()Abovepanel.3x
panel_below()Belowpanel.3x
panel_hidden()Is_Hiddenpanel.3x
panel_userptrGet_User_Datapanel.3x
panel_userptrGet_User_Datapanel.3x
panel_window()Get_Windowpanel.3x
panel_window()Panel_Windowpanel.3x
pechochar()Add_Character_To_Pad_And_Echo_Itcurs_pad.3x
pnoutrefresh()Refresh_Without_Updatecurs_pad.3x
pos_form_cursor()Position_Cursorform_cursor.3x
pos_menu_cursor()Position_Cursormenu_cursor.3x
post_form()Postform_post.3x
post_menu()Postmenu_post.3x
prefresh()Refreshcurs_pad.3x
qiflush()Set_Queue_Interrupt_Modecurs_inopts.3x
raw()Set_Raw_Modecurs_inopts.3x
redrawwin()Redrawcurs_refresh.3x
replace_panel()Replacepanel.3x
reset_prog_mode()Reset_Curses_Modecurs_kernel.3x
resetty();Reset_Terminal_Statecurs_kernel.3x
ripoffline()Rip_Off_Linescurs_kernel.3x
savetty()Save_Terminal_Statecurs_kernel.3x
scale_form()Scaleform_win.3x
scale_menu()Scalemenu_win.3x
scr_dump()Screen_Dump_To_Filecurs_scr_dump.3x
scr_init()Screen_Init_From_Filecurs_scr_dump.3x
scrollok()Allow_Scrollingcurs_outopts.3x
scr_restore()Screen_Restore_From_Filecurs_scr_dump.3x
scr_set()Screen_Set_Filecurs_scr_dump.3x
set_current_field()Set_Currentform_page.3x
set_current_item()Set_Currentmitem_current.3x
set_field_back()Set_Backgroundform_field_attributes.3x
set_field_buffer()Set_Bufferform_field_buffer.3x
set_field_fore()Set_Foregroundform_field_attributes.3x
set_field_init()Set_Field_Init_Hookform_hook.3x
set_field_just()Set_Justificationform_field_just.3x
set_field_max()Set_Maximum_Sizeform_field_buffer.3x
set_field_opts()Set_Optionsform_field_opts.3x
set_field_pad()Set_Pad_Characterform_field_attributes.3x
set_field_status()Set_Statusform_field_buffer.3x
set_field_term()Set_Field_Term_Hookform_hook.3x
set_field_type()Set_Typeform_fieldtype.3x
set_field_userptrSet_User_Dataform_field_userptr.3x
set_form_fields()Redefineform_field.3x
set_form_fields()Set_Fieldsform_field.3x
set_form_init()Set_Form_Init_Hookform_hook.3x
set_form_opts()Set_Optionsform_opts.3x
set_form_page()Set_Pageform_page.3x
set_form_sub()Set_Sub_Windowform_win.3x
set_form_term()Set_Form_Term_Hookform_hook.3x
set_form_userptrSet_User_Dataform_userptr.3x
set_form_win()Set_Windowform_win.3x
set_item_init()Set_Item_Init_Hookmenu_hook.3x
set_item_opts()Set_Optionsmitem_opts.3x
set_item_term()Set_Item_Term_Hookmenu_hook.3x
set_item_userptrSet_User_Datamitem_userptr.3x
set_item_value()Set_Valuemitem_value.3x
set_menu_back()Set_Backgroundmenu_attributes.3x
set_menu_fore()Set_Foregroundmenu_attributes.3x
set_menu_format()Set_Formatmenu_format.3x
set_menu_grey()Set_Greymenu_attributes.3x
set_menu_init()Set_Menu_Init_Hookmenu_hook.3x
set_menu_items()Redefinemenu_items.3x
set_menu_mark()Set_Markmenu_mark.3x
set_menu_opts()Set_Optionsmenu_opts.3x
set_menu_pad()Set_Pad_Charactermenu_attributes.3x
set_menu_pattern()Set_Patternmenu_pattern.3x
set_menu_spacing()Set_Spacingmenu_spacing.3x
set_menu_sub()Set_Sub_Windowmenu_win.3x
set_menu_term()Set_Menu_Term_Hookmenu_hook.3x
set_menu_userptrSet_User_Datamenu_userptr.3x
set_menu_win()Set_Windowmenu_win.3x
set_new_page()Set_New_Pageform_new_page.3x
set_panel_userptrSet_User_Datapanel.3x
set_top_row()Set_Top_Rowmitem_current.3x
show_panel()Showpanel.3x
slk_attron()Switch_Soft_Label_Key_Attributescurs_slk.3x
slk_attrset()Set_Soft_Label_Key_Attributescurs_slk.3x
slk_attr()Get_Soft_Label_Key_Attributescurs_slk.3x
slk_attr()Get_Soft_Label_Key_Attributescurs_slk.3x
slk_clear()Clear_Soft_Label_Keyscurs_slk.3x
slk_color()Set_Soft_Label_Key_Colorcurs_slk.3x
slk_init()Init_Soft_Label_Keyscurs_slk.3x
slk_label()Get_Soft_Label_Keycurs_slk.3x
slk_label()Get_Soft_Label_Keycurs_slk.3x
slk_noutrefresh()Refresh_Soft_Label_Keys_Without_Updatecurs_slk.3x
slk_refresh()Refresh_Soft_Label_Keycurs_slk.3x
slk_restore()Restore_Soft_Label_Keyscurs_slk.3x
slk_set()Set_Soft_Label_Keycurs_slk.3x
slk_touch()Touch_Soft_Label_Keyscurs_slk.3x
standout()Standoutcurs_attr.3x
start_color()Start_Colorcurs_color.3x
stdscrStandard_Windowcurs_initscr.3x
subpad()Sub_Padcurs_pad.3x
subwin()Sub_Windowcurs_window.3x
syncok()Set_Synch_Modecurs_window.3x
termattrs()Supported_Attributescurs_termattrs.3x
termname()Terminal_Namecurs_termattrs.3x
termname()Terminal_Namecurs_termattrs.3x
top_panel()Toppanel.3x
top_row()Top_Rowmitem_current.3x
touchline()Touchcurs_touch.3x
touchwin()Touchcurs_touch.3x
_tracef()Trace_Putcurs_trace.3x
trace()Trace_oncurs_trace.3x
unctrl()Un_Controlcurs_util.3x
unctrl()Un_Controlcurs_util.3x
ungetch()Undo_Keystrokecurs_getch.3x
ungetmouse()Unget_Mousecurs_mouse.3x
untouchwin()Untouchcurs_touch.3x
update_panels()Update_Panelspanel.3x
use_default_colors()Use_Default_Colorsdefault_colors.3x
use_extended_names()Use_Extended_Namescurs_extend.3x
waddchnstr()Addcurs_addchstr.3x
waddch()Addcurs_addch.3x
waddnstr()Addcurs_addstr.3x
wattr_get()Get_Character_Attributescurs_attr.3x
wattr_get()Get_Character_Attributecurs_attr.3x
wattron()Switch_Character_Attributecurs_attr.3x
wattrset()Set_Character_Attributescurs_attr.3x
wbkgdget()Get_Backgroundcurs_bkgd.3x
wbkgdset()Set_Backgroundcurs_bkgd.3x
wbkgd()Change_Backgroundcurs_bkgd.3x
wborder()Bordercurs_border.3x
wchgat()Change_Attributescurs_attr.3x
wclear()Clearcurs_clear.3x
wclrtobot()Clear_To_End_Of_Screencurs_clear.3x
wclrtoeol()Clear_To_End_Of_Linecurs_clear.3x
wcolor_set()Set_Colorcurs_attr.3x
wdelch()Delete_Charactercurs_delch.3x
wdeleteln()Delete_Linecurs_deleteln.3x
wechochar()Add_With_Immediate_Echocurs_addch.3x
wenclose()Enclosed_In_Windowcurs_mouse.3x
werase()Erasecurs_clear.3x
wgetch()Get_Keystrokecurs_getch.3x
wgetnstr()Getcurs_getstr.3x
whline()Horizontal_Linecurs_border.3x
winchnstr()Peekcurs_inchstr.3x
winch()Peekcurs_inch.3x
winnstr()Peekcurs_instr.3x
winsch()Insertcurs_insch.3x
winsdelln()Insert_Delete_Linescurs_deleteln.3x
winsertln()Insert_Linecurs_deleteln.3x
winsnstr()Insertcurs_insstr.3x
wmove()Move_Cursorcurs_move.3x
wnoutrefresh()Refresh_Without_Updatecurs_refresh.3x
wredrawln()Redrawcurs_refresh.3x
wrefresh()Refreshcurs_refresh.3x
wresize()Resizewresize.3x
wscrl()Scrollcurs_scroll.3x
wsetscrreg()Set_Scroll_Regioncurs_outopts.3x
wsyncdown()Synchronize_Downwardscurs_window.3x
wsyncup()Synchronize_Upwardscurs_window.3x
wtimeout()Set_Timeout_Modecurs_inopts.3x
wtouchln()Change_Line_Statuscurs_touch.3x
wvline()Vertical_Linecurs_border.3x
AdaCurses-20170708/doc/ada/terminal_interface-curses__ads.htm0000644000175100001440000102633712340214310022506 0ustar tomusers terminal_interface-curses.ads

File : terminal_interface-curses.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                         Terminal_Interface.Curses                        --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.47 @
--  @Date: 2014/05/24 21:31:57 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with System.Storage_Elements;
with Interfaces.C;   --  We need this for some assertions.

with Terminal_Interface.Curses_Constants;

package Terminal_Interface.Curses is
   pragma Preelaborate (Terminal_Interface.Curses);
   pragma Linker_Options ("-lncurses" & Curses_Constants.DFT_ARG_SUFFIX);

   Major_Version : constant := Curses_Constants.NCURSES_VERSION_MAJOR;
   Minor_Version : constant := Curses_Constants.NCURSES_VERSION_MINOR;
   NC_Version : String renames Curses_Constants.Version;

   type Window is private;
   Null_Window : constant Window;

   type Line_Position   is new Integer; --  line coordinate
   type Column_Position is new Integer; --  column coordinate

   subtype Line_Count   is Line_Position   range 1 .. Line_Position'Last;
   --  Type to count lines. We do not allow null windows, so must be positive
   subtype Column_Count is Column_Position range 1 .. Column_Position'Last;
   --  Type to count columns. We do not allow null windows, so must be positive

   type Key_Code is new Integer;
   --  That is anything including real characters, special keys and logical
   --  request codes.

   --  FIXME: The "-1" should be Curses_Err
   subtype Real_Key_Code is Key_Code range -1 .. Curses_Constants.KEY_MAX;
   --  This are the codes that potentially represent a real keystroke.
   --  Not all codes may be possible on a specific terminal. To check the
   --  availability of a special key, the Has_Key function is provided.

   subtype Special_Key_Code is Real_Key_Code
     range Curses_Constants. KEY_MIN - 1 .. Real_Key_Code'Last;
   --  Type for a function- or special key number

   subtype Normal_Key_Code is Real_Key_Code range
     Character'Pos (Character'First) .. Character'Pos (Character'Last);
   --  This are the codes for regular (incl. non-graphical) characters.

   --  For those who like to use the original key names we produce them were
   --  they differ from the original.

   --  Constants for function- and special keys
   Key_None                    : constant Special_Key_Code
     := Curses_Constants.KEY_MIN - 1;
   Key_Min                     : constant Special_Key_Code
     := Curses_Constants.KEY_MIN;
   Key_Break                   : constant Special_Key_Code
     := Curses_Constants.KEY_BREAK;
   KEY_DOWN                    : constant Special_Key_Code
     := Curses_Constants.KEY_DOWN;
   Key_Cursor_Down             : Special_Key_Code renames KEY_DOWN;
   KEY_UP                      : constant Special_Key_Code
     := Curses_Constants.KEY_UP;
   Key_Cursor_Up               : Special_Key_Code renames KEY_UP;
   KEY_LEFT                    : constant Special_Key_Code
     := Curses_Constants.KEY_LEFT;
   Key_Cursor_Left             : Special_Key_Code renames KEY_LEFT;
   KEY_RIGHT                   : constant Special_Key_Code
     := Curses_Constants.KEY_RIGHT;
   Key_Cursor_Right            : Special_Key_Code renames KEY_RIGHT;
   Key_Home                    : constant Special_Key_Code
     := Curses_Constants.KEY_HOME;
   Key_Backspace               : constant Special_Key_Code
     := Curses_Constants.KEY_BACKSPACE;
   Key_F0                      : constant Special_Key_Code
     := Curses_Constants.KEY_F0;
   Key_F1                      : constant Special_Key_Code
     := Curses_Constants.KEY_F1;
   Key_F2                      : constant Special_Key_Code
     := Curses_Constants.KEY_F2;
   Key_F3                      : constant Special_Key_Code
     := Curses_Constants.KEY_F3;
   Key_F4                      : constant Special_Key_Code
     := Curses_Constants.KEY_F4;
   Key_F5                      : constant Special_Key_Code
     := Curses_Constants.KEY_F5;
   Key_F6                      : constant Special_Key_Code
     := Curses_Constants.KEY_F6;
   Key_F7                      : constant Special_Key_Code
     := Curses_Constants.KEY_F7;
   Key_F8                      : constant Special_Key_Code
     := Curses_Constants.KEY_F8;
   Key_F9                      : constant Special_Key_Code
     := Curses_Constants.KEY_F9;
   Key_F10                     : constant Special_Key_Code
     := Curses_Constants.KEY_F10;
   Key_F11                     : constant Special_Key_Code
     := Curses_Constants.KEY_F11;
   Key_F12                     : constant Special_Key_Code
     := Curses_Constants.KEY_F12;
   Key_F13                     : constant Special_Key_Code
     := Curses_Constants.KEY_F13;
   Key_F14                     : constant Special_Key_Code
     := Curses_Constants.KEY_F14;
   Key_F15                     : constant Special_Key_Code
     := Curses_Constants.KEY_F15;
   Key_F16                     : constant Special_Key_Code
     := Curses_Constants.KEY_F16;
   Key_F17                     : constant Special_Key_Code
     := Curses_Constants.KEY_F17;
   Key_F18                     : constant Special_Key_Code
     := Curses_Constants.KEY_F18;
   Key_F19                     : constant Special_Key_Code
     := Curses_Constants.KEY_F19;
   Key_F20                     : constant Special_Key_Code
     := Curses_Constants.KEY_F20;
   Key_F21                     : constant Special_Key_Code
     := Curses_Constants.KEY_F21;
   Key_F22                     : constant Special_Key_Code
     := Curses_Constants.KEY_F22;
   Key_F23                     : constant Special_Key_Code
     := Curses_Constants.KEY_F23;
   Key_F24                     : constant Special_Key_Code
     := Curses_Constants.KEY_F24;
   KEY_DL                      : constant Special_Key_Code
     := Curses_Constants.KEY_DL;
   Key_Delete_Line             : Special_Key_Code renames KEY_DL;
   KEY_IL                      : constant Special_Key_Code
     := Curses_Constants.KEY_IL;
   Key_Insert_Line             : Special_Key_Code renames KEY_IL;
   KEY_DC                      : constant Special_Key_Code
     := Curses_Constants.KEY_DC;
   Key_Delete_Char             : Special_Key_Code renames KEY_DC;
   KEY_IC                      : constant Special_Key_Code
     := Curses_Constants.KEY_IC;
   Key_Insert_Char             : Special_Key_Code renames KEY_IC;
   KEY_EIC                     : constant Special_Key_Code
     := Curses_Constants.KEY_EIC;
   Key_Exit_Insert_Mode        : Special_Key_Code renames KEY_EIC;
   KEY_CLEAR                   : constant Special_Key_Code
     := Curses_Constants.KEY_CLEAR;
   Key_Clear_Screen            : Special_Key_Code renames KEY_CLEAR;
   KEY_EOS                     : constant Special_Key_Code
     := Curses_Constants.KEY_EOS;
   Key_Clear_End_Of_Screen     : Special_Key_Code renames KEY_EOS;
   KEY_EOL                     : constant Special_Key_Code
     := Curses_Constants.KEY_EOL;
   Key_Clear_End_Of_Line       : Special_Key_Code renames KEY_EOL;
   KEY_SF                      : constant Special_Key_Code
     := Curses_Constants.KEY_SF;
   Key_Scroll_1_Forward        : Special_Key_Code renames KEY_SF;
   KEY_SR                      : constant Special_Key_Code
     := Curses_Constants.KEY_SR;
   Key_Scroll_1_Backward       : Special_Key_Code renames KEY_SR;
   KEY_NPAGE                   : constant Special_Key_Code
     := Curses_Constants.KEY_NPAGE;
   Key_Next_Page               : Special_Key_Code renames KEY_NPAGE;
   KEY_PPAGE                   : constant Special_Key_Code
     := Curses_Constants.KEY_PPAGE;
   Key_Previous_Page           : Special_Key_Code renames KEY_PPAGE;
   KEY_STAB                    : constant Special_Key_Code
     := Curses_Constants.KEY_STAB;
   Key_Set_Tab                 : Special_Key_Code renames KEY_STAB;
   KEY_CTAB                    : constant Special_Key_Code
     := Curses_Constants.KEY_CTAB;
   Key_Clear_Tab               : Special_Key_Code renames KEY_CTAB;
   KEY_CATAB                   : constant Special_Key_Code
     := Curses_Constants.KEY_CATAB;
   Key_Clear_All_Tabs          : Special_Key_Code renames KEY_CATAB;
   KEY_ENTER                   : constant Special_Key_Code
     := Curses_Constants.KEY_ENTER;
   Key_Enter_Or_Send           : Special_Key_Code renames KEY_ENTER;
   KEY_SRESET                  : constant Special_Key_Code
     := Curses_Constants.KEY_SRESET;
   Key_Soft_Reset              : Special_Key_Code renames KEY_SRESET;
   Key_Reset                   : constant Special_Key_Code
     := Curses_Constants.KEY_RESET;
   Key_Print                   : constant Special_Key_Code
     := Curses_Constants.KEY_PRINT;
   KEY_LL                      : constant Special_Key_Code
     := Curses_Constants.KEY_LL;
   Key_Bottom                  : Special_Key_Code renames KEY_LL;
   KEY_A1                      : constant Special_Key_Code
     := Curses_Constants.KEY_A1;
   Key_Upper_Left_Of_Keypad    : Special_Key_Code renames KEY_A1;
   KEY_A3                      : constant Special_Key_Code
     := Curses_Constants.KEY_A3;
   Key_Upper_Right_Of_Keypad   : Special_Key_Code renames KEY_A3;
   KEY_B2                      : constant Special_Key_Code
     := Curses_Constants.KEY_B2;
   Key_Center_Of_Keypad        : Special_Key_Code renames KEY_B2;
   KEY_C1                      : constant Special_Key_Code
     := Curses_Constants.KEY_C1;
   Key_Lower_Left_Of_Keypad    : Special_Key_Code renames KEY_C1;
   KEY_C3                      : constant Special_Key_Code
     := Curses_Constants.KEY_C3;
   Key_Lower_Right_Of_Keypad   : Special_Key_Code renames KEY_C3;
   KEY_BTAB                    : constant Special_Key_Code
     := Curses_Constants.KEY_BTAB;
   Key_Back_Tab                : Special_Key_Code renames KEY_BTAB;
   KEY_BEG                     : constant Special_Key_Code
     := Curses_Constants.KEY_BEG;
   Key_Beginning               : Special_Key_Code renames KEY_BEG;
   Key_Cancel                  : constant Special_Key_Code
     := Curses_Constants.KEY_CANCEL;
   Key_Close                   : constant Special_Key_Code
     := Curses_Constants.KEY_CLOSE;
   Key_Command                 : constant Special_Key_Code
     := Curses_Constants.KEY_COMMAND;
   Key_Copy                    : constant Special_Key_Code
     := Curses_Constants.KEY_COPY;
   Key_Create                  : constant Special_Key_Code
     := Curses_Constants.KEY_CREATE;
   Key_End                     : constant Special_Key_Code
     := Curses_Constants.KEY_END;
   Key_Exit                    : constant Special_Key_Code
     := Curses_Constants.KEY_EXIT;
   Key_Find                    : constant Special_Key_Code
     := Curses_Constants.KEY_FIND;
   Key_Help                    : constant Special_Key_Code
     := Curses_Constants.KEY_HELP;
   Key_Mark                    : constant Special_Key_Code
     := Curses_Constants.KEY_MARK;
   Key_Message                 : constant Special_Key_Code
     := Curses_Constants.KEY_MESSAGE;
   Key_Move                    : constant Special_Key_Code
     := Curses_Constants.KEY_MOVE;
   Key_Next                    : constant Special_Key_Code
     := Curses_Constants.KEY_NEXT;
   Key_Open                    : constant Special_Key_Code
     := Curses_Constants.KEY_OPEN;
   Key_Options                 : constant Special_Key_Code
     := Curses_Constants.KEY_OPTIONS;
   Key_Previous                : constant Special_Key_Code
     := Curses_Constants.KEY_PREVIOUS;
   Key_Redo                    : constant Special_Key_Code
     := Curses_Constants.KEY_REDO;
   Key_Reference               : constant Special_Key_Code
     := Curses_Constants.KEY_REFERENCE;
   Key_Refresh                 : constant Special_Key_Code
     := Curses_Constants.KEY_REFRESH;
   Key_Replace                 : constant Special_Key_Code
     := Curses_Constants.KEY_REPLACE;
   Key_Restart                 : constant Special_Key_Code
     := Curses_Constants.KEY_RESTART;
   Key_Resume                  : constant Special_Key_Code
     := Curses_Constants.KEY_RESUME;
   Key_Save                    : constant Special_Key_Code
     := Curses_Constants.KEY_SAVE;
   KEY_SBEG                    : constant Special_Key_Code
     := Curses_Constants.KEY_SBEG;
   Key_Shift_Begin             : Special_Key_Code renames KEY_SBEG;
   KEY_SCANCEL                 : constant Special_Key_Code
     := Curses_Constants.KEY_SCANCEL;
   Key_Shift_Cancel            : Special_Key_Code renames KEY_SCANCEL;
   KEY_SCOMMAND                : constant Special_Key_Code
     := Curses_Constants.KEY_SCOMMAND;
   Key_Shift_Command           : Special_Key_Code renames KEY_SCOMMAND;
   KEY_SCOPY                   : constant Special_Key_Code
     := Curses_Constants.KEY_SCOPY;
   Key_Shift_Copy              : Special_Key_Code renames KEY_SCOPY;
   KEY_SCREATE                 : constant Special_Key_Code
     := Curses_Constants.KEY_SCREATE;
   Key_Shift_Create            : Special_Key_Code renames KEY_SCREATE;
   KEY_SDC                     : constant Special_Key_Code
     := Curses_Constants.KEY_SDC;
   Key_Shift_Delete_Char       : Special_Key_Code renames KEY_SDC;
   KEY_SDL                     : constant Special_Key_Code
     := Curses_Constants.KEY_SDL;
   Key_Shift_Delete_Line       : Special_Key_Code renames KEY_SDL;
   Key_Select                  : constant Special_Key_Code
     := Curses_Constants.KEY_SELECT;
   KEY_SEND                    : constant Special_Key_Code
     := Curses_Constants.KEY_SEND;
   Key_Shift_End               : Special_Key_Code renames KEY_SEND;
   KEY_SEOL                    : constant Special_Key_Code
     := Curses_Constants.KEY_SEOL;
   Key_Shift_Clear_End_Of_Line : Special_Key_Code renames KEY_SEOL;
   KEY_SEXIT                   : constant Special_Key_Code
     := Curses_Constants.KEY_SEXIT;
   Key_Shift_Exit              : Special_Key_Code renames KEY_SEXIT;
   KEY_SFIND                   : constant Special_Key_Code
     := Curses_Constants.KEY_SFIND;
   Key_Shift_Find              : Special_Key_Code renames KEY_SFIND;
   KEY_SHELP                   : constant Special_Key_Code
     := Curses_Constants.KEY_SHELP;
   Key_Shift_Help              : Special_Key_Code renames KEY_SHELP;
   KEY_SHOME                   : constant Special_Key_Code
     := Curses_Constants.KEY_SHOME;
   Key_Shift_Home              : Special_Key_Code renames KEY_SHOME;
   KEY_SIC                     : constant Special_Key_Code
     := Curses_Constants.KEY_SIC;
   Key_Shift_Insert_Char       : Special_Key_Code renames KEY_SIC;
   KEY_SLEFT                   : constant Special_Key_Code
     := Curses_Constants.KEY_SLEFT;
   Key_Shift_Cursor_Left       : Special_Key_Code renames KEY_SLEFT;
   KEY_SMESSAGE                : constant Special_Key_Code
     := Curses_Constants.KEY_SMESSAGE;
   Key_Shift_Message           : Special_Key_Code renames KEY_SMESSAGE;
   KEY_SMOVE                   : constant Special_Key_Code
     := Curses_Constants.KEY_SMOVE;
   Key_Shift_Move              : Special_Key_Code renames KEY_SMOVE;
   KEY_SNEXT                   : constant Special_Key_Code
     := Curses_Constants.KEY_SNEXT;
   Key_Shift_Next_Page         : Special_Key_Code renames KEY_SNEXT;
   KEY_SOPTIONS                : constant Special_Key_Code
     := Curses_Constants.KEY_SOPTIONS;
   Key_Shift_Options           : Special_Key_Code renames KEY_SOPTIONS;
   KEY_SPREVIOUS               : constant Special_Key_Code
     := Curses_Constants.KEY_SPREVIOUS;
   Key_Shift_Previous_Page     : Special_Key_Code renames KEY_SPREVIOUS;
   KEY_SPRINT                  : constant Special_Key_Code
     := Curses_Constants.KEY_SPRINT;
   Key_Shift_Print             : Special_Key_Code renames KEY_SPRINT;
   KEY_SREDO                   : constant Special_Key_Code
     := Curses_Constants.KEY_SREDO;
   Key_Shift_Redo              : Special_Key_Code renames KEY_SREDO;
   KEY_SREPLACE                : constant Special_Key_Code
     := Curses_Constants.KEY_SREPLACE;
   Key_Shift_Replace           : Special_Key_Code renames KEY_SREPLACE;
   KEY_SRIGHT                  : constant Special_Key_Code
     := Curses_Constants.KEY_SRIGHT;
   Key_Shift_Cursor_Right      : Special_Key_Code renames KEY_SRIGHT;
   KEY_SRSUME                  : constant Special_Key_Code
     := Curses_Constants.KEY_SRSUME;
   Key_Shift_Resume            : Special_Key_Code renames KEY_SRSUME;
   KEY_SSAVE                   : constant Special_Key_Code
     := Curses_Constants.KEY_SSAVE;
   Key_Shift_Save              : Special_Key_Code renames KEY_SSAVE;
   KEY_SSUSPEND                : constant Special_Key_Code
     := Curses_Constants.KEY_SSUSPEND;
   Key_Shift_Suspend           : Special_Key_Code renames KEY_SSUSPEND;
   KEY_SUNDO                   : constant Special_Key_Code
     := Curses_Constants.KEY_SUNDO;
   Key_Shift_Undo              : Special_Key_Code renames KEY_SUNDO;
   Key_Suspend                 : constant Special_Key_Code
     := Curses_Constants.KEY_SUSPEND;
   Key_Undo                    : constant Special_Key_Code
     := Curses_Constants.KEY_UNDO;
   Key_Mouse                   : constant Special_Key_Code
     := Curses_Constants.KEY_MOUSE;
   Key_Resize                  : constant Special_Key_Code
     := Curses_Constants.KEY_RESIZE;
   Key_Max                     : constant Special_Key_Code
     := Special_Key_Code'Last;

   subtype User_Key_Code is Key_Code
     range (Key_Max + 129) .. Key_Code'Last;
   --  This is reserved for user defined key codes. The range between Key_Max
   --  and the first user code is reserved for subsystems like menu and forms.

   --------------------------------------------------------------------------

   type Color_Number is range -1 .. Integer (Interfaces.C.short'Last);
   for Color_Number'Size use Interfaces.C.short'Size;
   --  (n)curses uses a short for the color index
   --  The model is, that a Color_Number is an index into an array of
   --  (potentially) definable colors. Some of those indices are
   --  predefined (see below), although they may not really exist.

   Black   : constant Color_Number := Curses_Constants.COLOR_BLACK;
   Red     : constant Color_Number := Curses_Constants.COLOR_RED;
   Green   : constant Color_Number := Curses_Constants.COLOR_GREEN;
   Yellow  : constant Color_Number := Curses_Constants.COLOR_YELLOW;
   Blue    : constant Color_Number := Curses_Constants.COLOR_BLUE;
   Magenta : constant Color_Number := Curses_Constants.COLOR_MAGENTA;
   Cyan    : constant Color_Number := Curses_Constants.COLOR_CYAN;
   White   : constant Color_Number := Curses_Constants.COLOR_WHITE;

   type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last);
   for RGB_Value'Size use Interfaces.C.short'Size;
   --  Some system may allow to redefine a color by setting RGB values.

   type Color_Pair is range 0 .. 255;
   for Color_Pair'Size use 8;
   subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255;
   --  (n)curses reserves 1 Byte for the color-pair number. Color Pair 0
   --  is fixed (Black & White). A color pair is simply a combination of
   --  two colors described by Color_Numbers, one for the foreground and
   --  the other for the background

   type Character_Attribute_Set is
      record
         Stand_Out               : Boolean;
         Under_Line              : Boolean;
         Reverse_Video           : Boolean;
         Blink                   : Boolean;
         Dim_Character           : Boolean;
         Bold_Character          : Boolean;
         Protected_Character     : Boolean;
         Invisible_Character     : Boolean;
         Alternate_Character_Set : Boolean;
         Horizontal              : Boolean;
         Left                    : Boolean;
         Low                     : Boolean;
         Right                   : Boolean;
         Top                     : Boolean;
         Vertical                : Boolean;
      end record;

   for Character_Attribute_Set use
      record
         Stand_Out at 0 range
           Curses_Constants.A_STANDOUT_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_STANDOUT_Last - Curses_Constants.Attr_First;
         Under_Line at 0 range
           Curses_Constants.A_UNDERLINE_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_UNDERLINE_Last - Curses_Constants.Attr_First;
         Reverse_Video at 0 range
           Curses_Constants.A_REVERSE_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_REVERSE_Last - Curses_Constants.Attr_First;
         Blink at 0 range
           Curses_Constants.A_BLINK_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_BLINK_Last - Curses_Constants.Attr_First;
         Dim_Character at 0 range
           Curses_Constants.A_DIM_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_DIM_Last - Curses_Constants.Attr_First;
         Bold_Character at 0 range
           Curses_Constants.A_BOLD_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_BOLD_Last - Curses_Constants.Attr_First;
         Protected_Character at 0 range
           Curses_Constants.A_PROTECT_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_PROTECT_Last - Curses_Constants.Attr_First;
         Invisible_Character at 0 range
           Curses_Constants.A_INVIS_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_INVIS_Last - Curses_Constants.Attr_First;
         Alternate_Character_Set at 0 range
           Curses_Constants.A_ALTCHARSET_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_ALTCHARSET_Last - Curses_Constants.Attr_First;
         Horizontal at 0 range
           Curses_Constants.A_HORIZONTAL_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_HORIZONTAL_Last - Curses_Constants.Attr_First;
         Left at 0 range
           Curses_Constants.A_LEFT_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_LEFT_Last - Curses_Constants.Attr_First;
         Low at 0 range
           Curses_Constants.A_LOW_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_LOW_Last - Curses_Constants.Attr_First;
         Right at 0 range
           Curses_Constants.A_RIGHT_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_RIGHT_Last - Curses_Constants.Attr_First;
         Top at 0 range
           Curses_Constants.A_TOP_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_TOP_Last - Curses_Constants.Attr_First;
         Vertical at 0 range
           Curses_Constants.A_VERTICAL_First - Curses_Constants.Attr_First
           .. Curses_Constants.A_VERTICAL_Last - Curses_Constants.Attr_First;
      end record;

   Normal_Video : constant Character_Attribute_Set := (others => False);

   type Attributed_Character is
      record
         Attr  : Character_Attribute_Set;
         Color : Color_Pair;
         Ch    : Character;
      end record;
   pragma Convention (C_Pass_By_Copy, Attributed_Character);
   --  This is the counterpart for the chtype in C.

   for Attributed_Character use
      record
         Ch    at 0 range Curses_Constants.A_CHARTEXT_First
           .. Curses_Constants.A_CHARTEXT_Last;
         Color at 0 range Curses_Constants.A_COLOR_First
           .. Curses_Constants.A_COLOR_Last;
         pragma Warnings (Off);
         Attr  at 0 range Curses_Constants.Attr_First
           .. Curses_Constants.Attr_Last;
         pragma Warnings (On);
      end record;
   for Attributed_Character'Size use Curses_Constants.chtype_Size;

   Default_Character : constant Attributed_Character
     := (Ch    => Character'First,
         Color => Color_Pair'First,
         Attr  => (others => False));  --  preelaboratable Normal_Video

   type Attributed_String is array (Positive range <>) of Attributed_Character;
   pragma Convention (C, Attributed_String);
   --  In this binding we allow strings of attributed characters.

   ------------------
   --  Exceptions  --
   ------------------
   Curses_Exception     : exception;
   Wrong_Curses_Version : exception;

   --  Those exceptions are raised by the ETI (Extended Terminal Interface)
   --  subpackets for Menu and Forms handling.
   --
   Eti_System_Error    : exception;
   Eti_Bad_Argument    : exception;
   Eti_Posted          : exception;
   Eti_Connected       : exception;
   Eti_Bad_State       : exception;
   Eti_No_Room         : exception;
   Eti_Not_Posted      : exception;
   Eti_Unknown_Command : exception;
   Eti_No_Match        : exception;
   Eti_Not_Selectable  : exception;
   Eti_Not_Connected   : exception;
   Eti_Request_Denied  : exception;
   Eti_Invalid_Field   : exception;
   Eti_Current         : exception;

   --------------------------------------------------------------------------
   --  External C variables
   --  Conceptually even in C this are kind of constants, but they are
   --  initialized and sometimes changed by the library routines at runtime
   --  depending on the type of terminal. I believe the best way to model
   --  this is to use functions.
   --------------------------------------------------------------------------

   function Lines            return Line_Count;
   pragma Inline (Lines);

   function Columns          return Column_Count;
   pragma Inline (Columns);

   function Tab_Size         return Natural;
   pragma Inline (Tab_Size);

   function Number_Of_Colors return Natural;
   pragma Inline (Number_Of_Colors);

   function Number_Of_Color_Pairs return Natural;
   pragma Inline (Number_Of_Color_Pairs);

   subtype ACS_Index is Character range
     Character'Val (0) .. Character'Val (127);
   function ACS_Map (Index : ACS_Index) return Attributed_Character;
   pragma Import (C, ACS_Map, "acs_map_as_function");

   --  Constants for several characters from the Alternate Character Set
   --  You must use these constants as indices into the ACS_Map function
   --  to get the corresponding attributed character at runtime
   ACS_Upper_Left_Corner  : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_ULCORNER);
   ACS_Lower_Left_Corner  : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_LLCORNER);
   ACS_Upper_Right_Corner : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_URCORNER);
   ACS_Lower_Right_Corner : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_LRCORNER);
   ACS_Left_Tee           : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_LTEE);
   ACS_Right_Tee          : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_RTEE);
   ACS_Bottom_Tee         : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_BTEE);
   ACS_Top_Tee            : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_TTEE);
   ACS_Horizontal_Line    : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_HLINE);
   ACS_Vertical_Line      : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_VLINE);
   ACS_Plus_Symbol        : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_PLUS);
   ACS_Scan_Line_1        : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_S1);
   ACS_Scan_Line_9        : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_S9);
   ACS_Diamond            : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_DIAMOND);
   ACS_Checker_Board      : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_CKBOARD);
   ACS_Degree             : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_DEGREE);
   ACS_Plus_Minus         : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_PLMINUS);
   ACS_Bullet             : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_BULLET);
   ACS_Left_Arrow         : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_LARROW);
   ACS_Right_Arrow        : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_RARROW);
   ACS_Down_Arrow         : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_DARROW);
   ACS_Up_Arrow           : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_UARROW);
   ACS_Board_Of_Squares   : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_BOARD);
   ACS_Lantern            : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_LANTERN);
   ACS_Solid_Block        : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_BLOCK);
   ACS_Scan_Line_3        : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_S3);
   ACS_Scan_Line_7        : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_S7);
   ACS_Less_Or_Equal      : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_LEQUAL);
   ACS_Greater_Or_Equal   : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_GEQUAL);
   ACS_PI                 : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_PI);
   ACS_Not_Equal          : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_NEQUAL);
   ACS_Sterling           : constant ACS_Index
      := Character'Val (Curses_Constants.ACS_STERLING);

   --  |=====================================================================
   --  | Man page curs_initscr.3x
   --  |=====================================================================
   --  | Not implemented: newterm, set_term, delscreen

   --  #1A NAME="AFU_1"#2|
   function Standard_Window return Window;
   --  AKA: stdscr
   pragma Import (C, Standard_Window, "stdscr_as_function");
   pragma Inline (Standard_Window);

   --  #1A NAME="AFU_2"#2|
   function Current_Window return Window;
   --  AKA: curscr
   pragma Import (C, Current_Window, "curscr_as_function");
   pragma Inline (Current_Window);

   --  #1A NAME="AFU_3"#2|
   procedure Init_Screen;

   --  #1A NAME="AFU_4"#2|
   procedure Init_Windows renames Init_Screen;
   --  AKA: initscr()
   pragma Inline (Init_Screen);
   --  pragma Inline (Init_Windows);

   --  #1A NAME="AFU_5"#2|
   procedure End_Windows;
   --  AKA: endwin()
   procedure End_Screen renames End_Windows;
   pragma Inline (End_Windows);
   --  pragma Inline (End_Screen);

   --  #1A NAME="AFU_6"#2|
   function Is_End_Window return Boolean;
   --  AKA: isendwin()
   pragma Inline (Is_End_Window);

   --  |=====================================================================
   --  | Man page curs_move.3x
   --  |=====================================================================

   --  #1A NAME="AFU_7"#2|
   procedure Move_Cursor (Win    : Window := Standard_Window;
                          Line   : Line_Position;
                          Column : Column_Position);
   --  AKA: wmove()
   --  AKA: move()
   pragma Inline (Move_Cursor);

   --  |=====================================================================
   --  | Man page curs_addch.3x
   --  |=====================================================================

   --  #1A NAME="AFU_8"#2|
   procedure Add (Win : Window := Standard_Window;
                  Ch  : Attributed_Character);
   --  AKA: waddch()
   --  AKA: addch()

   procedure Add (Win : Window := Standard_Window;
                  Ch  : Character);
   --  Add a single character at the current logical cursor position to
   --  the window. Use the current windows attributes.

   --  #1A NAME="AFU_9"#2|
   procedure Add
     (Win    : Window := Standard_Window;
      Line   : Line_Position;
      Column : Column_Position;
      Ch     : Attributed_Character);
   --  AKA: mvwaddch()
   --  AKA: mvaddch()

   procedure Add
     (Win    : Window := Standard_Window;
      Line   : Line_Position;
      Column : Column_Position;
      Ch     : Character);
   --  Move to the position and add a single character into the window
   --  There are more Add routines, so the Inline pragma follows later

   --  #1A NAME="AFU_10"#2|
   procedure Add_With_Immediate_Echo
     (Win : Window := Standard_Window;
      Ch  : Attributed_Character);
   --  AKA: wechochar()
   --  AKA: echochar()

   procedure Add_With_Immediate_Echo
     (Win : Window := Standard_Window;
      Ch  : Character);
   --  Add a character and do an immediate refresh of the screen.
   pragma Inline (Add_With_Immediate_Echo);

   --  |=====================================================================
   --  | Man page curs_window.3x
   --  |=====================================================================
   --  Not Implemented: wcursyncup

   --  #1A NAME="AFU_11"#2|
   function Create
     (Number_Of_Lines       : Line_Count;
      Number_Of_Columns     : Column_Count;
      First_Line_Position   : Line_Position;
      First_Column_Position : Column_Position) return Window;
   --  Not Implemented: Default Number_Of_Lines, Number_Of_Columns
   --  the C version lets them be 0, see the man page.
   --  AKA: newwin()
   pragma Inline (Create);

   function New_Window
     (Number_Of_Lines       : Line_Count;
      Number_Of_Columns     : Column_Count;
      First_Line_Position   : Line_Position;
      First_Column_Position : Column_Position) return Window
     renames Create;
   --  pragma Inline (New_Window);

   --  #1A NAME="AFU_12"#2|
   procedure Delete (Win : in out Window);
   --  AKA: delwin()
   --  Reset Win to Null_Window
   pragma Inline (Delete);

   --  #1A NAME="AFU_13"#2|
   function Sub_Window
     (Win                   : Window := Standard_Window;
      Number_Of_Lines       : Line_Count;
      Number_Of_Columns     : Column_Count;
      First_Line_Position   : Line_Position;
      First_Column_Position : Column_Position) return Window;
   --  AKA: subwin()
   pragma Inline (Sub_Window);

   --  #1A NAME="AFU_14"#2|
   function Derived_Window
     (Win                   : Window := Standard_Window;
      Number_Of_Lines       : Line_Count;
      Number_Of_Columns     : Column_Count;
      First_Line_Position   : Line_Position;
      First_Column_Position : Column_Position) return Window;
   --  AKA: derwin()
   pragma Inline (Derived_Window);

   --  #1A NAME="AFU_15"#2|
   function Duplicate (Win : Window) return Window;
   --  AKA: dupwin()
   pragma Inline (Duplicate);

   --  #1A NAME="AFU_16"#2|
   procedure Move_Window (Win    : Window;
                          Line   : Line_Position;
                          Column : Column_Position);
   --  AKA: mvwin()
   pragma Inline (Move_Window);

   --  #1A NAME="AFU_17"#2|
   procedure Move_Derived_Window (Win    : Window;
                                  Line   : Line_Position;
                                  Column : Column_Position);
   --  AKA: mvderwin()
   pragma Inline (Move_Derived_Window);

   --  #1A NAME="AFU_18"#2|
   procedure Synchronize_Upwards (Win : Window);
   --  AKA: wsyncup()
   pragma Import (C, Synchronize_Upwards, "wsyncup");

   --  #1A NAME="AFU_19"#2|
   procedure Synchronize_Downwards (Win : Window);
   --  AKA: wsyncdown()
   pragma Import (C, Synchronize_Downwards, "wsyncdown");

   --  #1A NAME="AFU_20"#2|
   procedure Set_Synch_Mode (Win  : Window := Standard_Window;
                             Mode : Boolean := False);
   --  AKA: syncok()
   pragma Inline (Set_Synch_Mode);

   --  |=====================================================================
   --  | Man page curs_addstr.3x
   --  |=====================================================================

   --  #1A NAME="AFU_21"#2|
   procedure Add (Win : Window := Standard_Window;
                  Str : String;
                  Len : Integer := -1);
   --  AKA: waddnstr()
   --  AKA: waddstr()
   --  AKA: addnstr()
   --  AKA: addstr()

   --  #1A NAME="AFU_22"#2|
   procedure Add (Win    : Window := Standard_Window;
                  Line   : Line_Position;
                  Column : Column_Position;
                  Str    : String;
                  Len    : Integer := -1);
   --  AKA: mvwaddnstr()
   --  AKA: mvwaddstr()
   --  AKA: mvaddnstr()
   --  AKA: mvaddstr()

   --  |=====================================================================
   --  | Man page curs_addchstr.3x
   --  |=====================================================================

   --  #1A NAME="AFU_23"#2|
   procedure Add (Win : Window := Standard_Window;
                  Str : Attributed_String;
                  Len : Integer := -1);
   --  AKA: waddchnstr()
   --  AKA: waddchstr()
   --  AKA: addchnstr()
   --  AKA: addchstr()

   --  #1A NAME="AFU_24"#2|
   procedure Add (Win    : Window := Standard_Window;
                  Line   : Line_Position;
                  Column : Column_Position;
                  Str    : Attributed_String;
                  Len    : Integer := -1);
   --  AKA: mvwaddchnstr()
   --  AKA: mvwaddchstr()
   --  AKA: mvaddchnstr()
   --  AKA: mvaddchstr()
   pragma Inline (Add);

   --  |=====================================================================
   --  | Man page curs_border.3x
   --  |=====================================================================
   --  | Not implemented: mvhline,  mvwhline, mvvline, mvwvline
   --  | use Move_Cursor then Horizontal_Line or Vertical_Line

   --  #1A NAME="AFU_25"#2|
   procedure Border
     (Win                       : Window := Standard_Window;
      Left_Side_Symbol          : Attributed_Character := Default_Character;
      Right_Side_Symbol         : Attributed_Character := Default_Character;
      Top_Side_Symbol           : Attributed_Character := Default_Character;
      Bottom_Side_Symbol        : Attributed_Character := Default_Character;
      Upper_Left_Corner_Symbol  : Attributed_Character := Default_Character;
      Upper_Right_Corner_Symbol : Attributed_Character := Default_Character;
      Lower_Left_Corner_Symbol  : Attributed_Character := Default_Character;
      Lower_Right_Corner_Symbol : Attributed_Character := Default_Character
     );
   --  AKA: wborder()
   --  AKA: border()
   pragma Inline (Border);

   --  #1A NAME="AFU_26"#2|
   procedure Box
     (Win               : Window := Standard_Window;
      Vertical_Symbol   : Attributed_Character := Default_Character;
      Horizontal_Symbol : Attributed_Character := Default_Character);
   --  AKA: box()
   pragma Inline (Box);

   --  #1A NAME="AFU_27"#2|
   procedure Horizontal_Line
     (Win         : Window := Standard_Window;
      Line_Size   : Natural;
      Line_Symbol : Attributed_Character := Default_Character);
   --  AKA: whline()
   --  AKA: hline()
   pragma Inline (Horizontal_Line);

   --  #1A NAME="AFU_28"#2|
   procedure Vertical_Line
     (Win         : Window := Standard_Window;
      Line_Size   : Natural;
      Line_Symbol : Attributed_Character := Default_Character);
   --  AKA: wvline()
   --  AKA: vline()
   pragma Inline (Vertical_Line);

   --  |=====================================================================
   --  | Man page curs_getch.3x
   --  |=====================================================================
   --  Not implemented: mvgetch, mvwgetch

   --  #1A NAME="AFU_29"#2|
   function Get_Keystroke (Win : Window := Standard_Window)
                           return Real_Key_Code;
   --  AKA: wgetch()
   --  AKA: getch()
   --  Get a character from the keyboard and echo it - if enabled - to the
   --  window.
   --  If for any reason (i.e. a timeout) we could not get a character the
   --  returned keycode is Key_None.
   pragma Inline (Get_Keystroke);

   --  #1A NAME="AFU_30"#2|
   procedure Undo_Keystroke (Key : Real_Key_Code);
   --  AKA: ungetch()
   pragma Inline (Undo_Keystroke);

   --  #1A NAME="AFU_31"#2|
   function Has_Key (Key : Special_Key_Code) return Boolean;
   --  AKA: has_key()
   pragma Inline (Has_Key);

   --  |
   --  | Some helper functions
   --  |
   function Is_Function_Key (Key : Special_Key_Code) return Boolean;
   --  Return True if the Key is a function key (i.e. one of F0 .. F63)
   pragma Inline (Is_Function_Key);

   subtype Function_Key_Number is Integer range 0 .. 63;
   --  (n)curses allows for 64 function keys.

   function Function_Key (Key : Real_Key_Code) return Function_Key_Number;
   --  Return the number of the function key. If the code is not a
   --  function key, a CONSTRAINT_ERROR will be raised.
   pragma Inline (Function_Key);

   function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code;
   --  Return the key code for a given function-key number.
   pragma Inline (Function_Key_Code);

   --  |=====================================================================
   --  | Man page curs_attr.3x
   --  |=====================================================================
   --  | Not implemented attr_off,  wattr_off,
   --  |  attr_on, wattr_on, attr_set, wattr_set

   --  PAIR_NUMBER
   --  PAIR_NUMBER(c) is the same as c.Color

   --  #1A NAME="AFU_32"#2|
   procedure Standout (Win : Window  := Standard_Window;
                       On  : Boolean := True);
   --  AKA: wstandout()
   --  AKA: wstandend()

   --  #1A NAME="AFU_33"#2|
   procedure Switch_Character_Attribute
     (Win  : Window := Standard_Window;
      Attr : Character_Attribute_Set := Normal_Video;
      On   : Boolean := True); --  if False we switch Off.
   --  Switches those Attributes set to true in the list.
   --  AKA: wattron()
   --  AKA: wattroff()
   --  AKA: attron()
   --  AKA: attroff()

   --  #1A NAME="AFU_34"#2|
   procedure Set_Character_Attributes
     (Win   : Window := Standard_Window;
      Attr  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First);
   --  AKA: wattrset()
   --  AKA: attrset()
   pragma Inline (Set_Character_Attributes);

   --  #1A NAME="AFU_35"#2|
   function Get_Character_Attribute
     (Win : Window := Standard_Window) return Character_Attribute_Set;
   --  AKA: wattr_get()
   --  AKA: attr_get()

   --  #1A NAME="AFU_36"#2|
   function Get_Character_Attribute
     (Win : Window := Standard_Window) return Color_Pair;
   --  AKA: wattr_get()
   pragma Inline (Get_Character_Attribute);

   --  #1A NAME="AFU_37"#2|
   procedure Set_Color (Win  : Window := Standard_Window;
                        Pair : Color_Pair);
   --  AKA: wcolor_set()
   --  AKA: color_set()
   pragma Inline (Set_Color);

   --  #1A NAME="AFU_38"#2|
   procedure Change_Attributes
     (Win   : Window := Standard_Window;
      Count : Integer := -1;
      Attr  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First);
   --  AKA: wchgat()
   --  AKA: chgat()

   --  #1A NAME="AFU_39"#2|
   procedure Change_Attributes
     (Win    : Window := Standard_Window;
      Line   : Line_Position := Line_Position'First;
      Column : Column_Position := Column_Position'First;
      Count  : Integer := -1;
      Attr   : Character_Attribute_Set := Normal_Video;
      Color  : Color_Pair := Color_Pair'First);
   --  AKA: mvwchgat()
   --  AKA: mvchgat()
   pragma Inline (Change_Attributes);

   --  |=====================================================================
   --  | Man page curs_beep.3x
   --  |=====================================================================

   --  #1A NAME="AFU_40"#2|
   procedure Beep;
   --  AKA: beep()
   pragma Inline (Beep);

   --  #1A NAME="AFU_41"#2|
   procedure Flash_Screen;
   --  AKA: flash()
   pragma Inline (Flash_Screen);

   --  |=====================================================================
   --  | Man page curs_inopts.3x
   --  |=====================================================================

   --  | Not implemented : typeahead
   --
   --  #1A NAME="AFU_42"#2|
   procedure Set_Cbreak_Mode (SwitchOn : Boolean := True);
   --  AKA: cbreak()
   --  AKA: nocbreak()
   pragma Inline (Set_Cbreak_Mode);

   --  #1A NAME="AFU_43"#2|
   procedure Set_Raw_Mode (SwitchOn : Boolean := True);
   --  AKA: raw()
   --  AKA: noraw()
   pragma Inline (Set_Raw_Mode);

   --  #1A NAME="AFU_44"#2|
   procedure Set_Echo_Mode (SwitchOn : Boolean := True);
   --  AKA: echo()
   --  AKA: noecho()
   pragma Inline (Set_Echo_Mode);

   --  #1A NAME="AFU_45"#2|
   procedure Set_Meta_Mode (Win      : Window := Standard_Window;
                            SwitchOn : Boolean := True);
   --  AKA: meta()
   pragma Inline (Set_Meta_Mode);

   --  #1A NAME="AFU_46"#2|
   procedure Set_KeyPad_Mode (Win      : Window := Standard_Window;
                              SwitchOn : Boolean := True);
   --  AKA: keypad()
   pragma Inline (Set_KeyPad_Mode);

   function Get_KeyPad_Mode (Win : Window := Standard_Window)
                             return Boolean;
   --  This has no pendant in C. There you've to look into the WINDOWS
   --  structure to get the value. Bad practice, not repeated in Ada.

   type Half_Delay_Amount is range 1 .. 255;

   --  #1A NAME="AFU_47"#2|
   procedure Half_Delay (Amount : Half_Delay_Amount);
   --  AKA: halfdelay()
   pragma Inline (Half_Delay);

   --  #1A NAME="AFU_48"#2|
   procedure Set_Flush_On_Interrupt_Mode
     (Win  : Window := Standard_Window;
      Mode : Boolean := True);
   --  AKA: intrflush()
   pragma Inline (Set_Flush_On_Interrupt_Mode);

   --  #1A NAME="AFU_49"#2|
   procedure Set_Queue_Interrupt_Mode
     (Win   : Window := Standard_Window;
      Flush : Boolean := True);
   --  AKA: qiflush()
   --  AKA: noqiflush()
   pragma Inline (Set_Queue_Interrupt_Mode);

   --  #1A NAME="AFU_50"#2|
   procedure Set_NoDelay_Mode
     (Win  : Window := Standard_Window;
      Mode : Boolean := False);
   --  AKA: nodelay()
   pragma Inline (Set_NoDelay_Mode);

   type Timeout_Mode is (Blocking, Non_Blocking, Delayed);

   --  #1A NAME="AFU_51"#2|
   procedure Set_Timeout_Mode (Win    : Window := Standard_Window;
                               Mode   : Timeout_Mode;
                               Amount : Natural); --  in Milliseconds
   --  AKA: wtimeout()
   --  AKA: timeout()
   --  Instead of overloading the semantic of the sign of amount, we
   --  introduce the Timeout_Mode parameter. This should improve
   --  readability. For Blocking and Non_Blocking, the Amount is not
   --  evaluated.
   --  We do not inline this procedure.

   --  #1A NAME="AFU_52"#2|
   procedure Set_Escape_Timer_Mode
     (Win       : Window := Standard_Window;
      Timer_Off : Boolean := False);
   --  AKA: notimeout()
   pragma Inline (Set_Escape_Timer_Mode);

   --  |=====================================================================
   --  | Man page curs_outopts.3x
   --  |=====================================================================

   --  #1A NAME="AFU_53"#2|
   procedure Set_NL_Mode (SwitchOn : Boolean := True);
   --  AKA: nl()
   --  AKA: nonl()
   pragma Inline (Set_NL_Mode);

   --  #1A NAME="AFU_54"#2|
   procedure Clear_On_Next_Update
     (Win      : Window := Standard_Window;
      Do_Clear : Boolean := True);
   --  AKA: clearok()
   pragma Inline (Clear_On_Next_Update);

   --  #1A NAME="AFU_55"#2|
   procedure Use_Insert_Delete_Line
     (Win    : Window := Standard_Window;
      Do_Idl : Boolean := True);
   --  AKA: idlok()
   pragma Inline (Use_Insert_Delete_Line);

   --  #1A NAME="AFU_56"#2|
   procedure Use_Insert_Delete_Character
     (Win    : Window := Standard_Window;
      Do_Idc : Boolean := True);
   --  AKA: idcok()
   pragma Inline (Use_Insert_Delete_Character);

   --  #1A NAME="AFU_57"#2|
   procedure Leave_Cursor_After_Update
     (Win      : Window := Standard_Window;
      Do_Leave : Boolean := True);
   --  AKA: leaveok()
   pragma Inline (Leave_Cursor_After_Update);

   --  #1A NAME="AFU_58"#2|
   procedure Immediate_Update_Mode
     (Win  : Window := Standard_Window;
      Mode : Boolean := False);
   --  AKA: immedok()
   pragma Inline (Immediate_Update_Mode);

   --  #1A NAME="AFU_59"#2|
   procedure Allow_Scrolling
     (Win  : Window := Standard_Window;
      Mode : Boolean := False);
   --  AKA: scrollok()
   pragma Inline (Allow_Scrolling);

   function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean;
   --  There is no such function in the C interface.
   pragma Inline (Scrolling_Allowed);

   --  #1A NAME="AFU_60"#2|
   procedure Set_Scroll_Region
     (Win         : Window := Standard_Window;
      Top_Line    : Line_Position;
      Bottom_Line : Line_Position);
   --  AKA: wsetscrreg()
   --  AKA: setscrreg()
   pragma Inline (Set_Scroll_Region);

   --  |=====================================================================
   --  | Man page curs_refresh.3x
   --  |=====================================================================

   --  #1A NAME="AFU_61"#2|
   procedure Update_Screen;
   --  AKA: doupdate()
   pragma Inline (Update_Screen);

   --  #1A NAME="AFU_62"#2|
   procedure Refresh (Win : Window := Standard_Window);
   --  AKA: wrefresh()
   --  There is an overloaded Refresh for Pads.
   --  The Inline pragma appears there
   --  AKA: refresh()

   --  #1A NAME="AFU_63"#2|
   procedure Refresh_Without_Update
     (Win : Window := Standard_Window);
   --  AKA: wnoutrefresh()
   --  There is an overloaded Refresh_Without_Update for Pads.
   --  The Inline pragma appears there

   --  #1A NAME="AFU_64"#2|
   procedure Redraw (Win : Window := Standard_Window);
   --  AKA: redrawwin()

   --  #1A NAME="AFU_65"#2|
   procedure Redraw (Win        : Window := Standard_Window;
                     Begin_Line : Line_Position;
                     Line_Count : Positive);
   --  AKA: wredrawln()
   pragma Inline (Redraw);

   --  |=====================================================================
   --  | Man page curs_clear.3x
   --  |=====================================================================

   --  #1A NAME="AFU_66"#2|
   procedure Erase (Win : Window := Standard_Window);
   --  AKA: werase()
   --  AKA: erase()
   pragma Inline (Erase);

   --  #1A NAME="AFU_67"#2|
   procedure Clear
     (Win : Window := Standard_Window);
   --  AKA: wclear()
   --  AKA: clear()
   pragma Inline (Clear);

   --  #1A NAME="AFU_68"#2|
   procedure Clear_To_End_Of_Screen
     (Win : Window := Standard_Window);
   --  AKA: wclrtobot()
   --  AKA: clrtobot()
   pragma Inline (Clear_To_End_Of_Screen);

   --  #1A NAME="AFU_69"#2|
   procedure Clear_To_End_Of_Line
     (Win : Window := Standard_Window);
   --  AKA: wclrtoeol()
   --  AKA: clrtoeol()
   pragma Inline (Clear_To_End_Of_Line);

   --  |=====================================================================
   --  | Man page curs_bkgd.3x
   --  |=====================================================================

   --  #1A NAME="AFU_70"#2|
   --  TODO: we could have Set_Background(Window; Character_Attribute_Set)
   --  because in C it is common to see bkgdset(A_BOLD) or
   --  bkgdset(COLOR_PAIR(n))
   procedure Set_Background
     (Win : Window := Standard_Window;
      Ch  : Attributed_Character);
   --  AKA: wbkgdset()
   --  AKA: bkgdset()
   pragma Inline (Set_Background);

   --  #1A NAME="AFU_71"#2|
   procedure Change_Background
     (Win : Window := Standard_Window;
      Ch  : Attributed_Character);
   --  AKA: wbkgd()
   --  AKA: bkgd()
   pragma Inline (Change_Background);

   --  #1A NAME="AFU_72"#2|
   --  ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough.
   function Get_Background (Win : Window := Standard_Window)
     return Attributed_Character;
   --  AKA: wbkgdget()
   --  AKA: bkgdget()
   pragma Inline (Get_Background);

   --  |=====================================================================
   --  | Man page curs_touch.3x
   --  |=====================================================================

   --  #1A NAME="AFU_73"#2|
   procedure Untouch (Win : Window := Standard_Window);
   --  AKA: untouchwin()
   pragma Inline (Untouch);

   --  #1A NAME="AFU_74"#2|
   procedure Touch (Win : Window := Standard_Window);
   --  AKA: touchwin()

   --  #1A NAME="AFU_75"#2|
   procedure Touch (Win   : Window := Standard_Window;
                    Start : Line_Position;
                    Count : Positive);
   --  AKA: touchline()
   pragma Inline (Touch);

   --  #1A NAME="AFU_76"#2|
   procedure Change_Lines_Status (Win   : Window := Standard_Window;
                                  Start : Line_Position;
                                  Count : Positive;
                                  State : Boolean);
   --  AKA: wtouchln()
   pragma Inline (Change_Lines_Status);

   --  #1A NAME="AFU_77"#2|
   function Is_Touched (Win  : Window := Standard_Window;
                        Line : Line_Position) return Boolean;
   --  AKA: is_linetouched()

   --  #1A NAME="AFU_78"#2|
   function Is_Touched (Win : Window := Standard_Window) return Boolean;
   --  AKA: is_wintouched()
   pragma Inline (Is_Touched);

   --  |=====================================================================
   --  | Man page curs_overlay.3x
   --  |=====================================================================

   --  #1A NAME="AFU_79"#2|
   procedure Copy
     (Source_Window            : Window;
      Destination_Window       : Window;
      Source_Top_Row           : Line_Position;
      Source_Left_Column       : Column_Position;
      Destination_Top_Row      : Line_Position;
      Destination_Left_Column  : Column_Position;
      Destination_Bottom_Row   : Line_Position;
      Destination_Right_Column : Column_Position;
      Non_Destructive_Mode     : Boolean := True);
   --  AKA: copywin()
   pragma Inline (Copy);

   --  #1A NAME="AFU_80"#2|
   procedure Overwrite (Source_Window      : Window;
                        Destination_Window : Window);
   --  AKA: overwrite()
   pragma Inline (Overwrite);

   --  #1A NAME="AFU_81"#2|
   procedure Overlay (Source_Window      : Window;
                      Destination_Window : Window);
   --  AKA: overlay()
   pragma Inline (Overlay);

   --  |=====================================================================
   --  | Man page curs_deleteln.3x
   --  |=====================================================================

   --  #1A NAME="AFU_82"#2|
   procedure Insert_Delete_Lines
     (Win   : Window  := Standard_Window;
      Lines : Integer := 1); --  default is to insert one line above
   --  AKA: winsdelln()
   --  AKA: insdelln()
   pragma Inline (Insert_Delete_Lines);

   --  #1A NAME="AFU_83"#2|
   procedure Delete_Line (Win : Window := Standard_Window);
   --  AKA: wdeleteln()
   --  AKA: deleteln()
   pragma Inline (Delete_Line);

   --  #1A NAME="AFU_84"#2|
   procedure Insert_Line (Win : Window := Standard_Window);
   --  AKA: winsertln()
   --  AKA: insertln()
   pragma Inline (Insert_Line);

   --  |=====================================================================
   --  | Man page curs_getyx.3x
   --  |=====================================================================

   --  #1A NAME="AFU_85"#2|
   procedure Get_Size
     (Win               : Window := Standard_Window;
      Number_Of_Lines   : out Line_Count;
      Number_Of_Columns : out Column_Count);
   --  AKA: getmaxyx()
   pragma Inline (Get_Size);

   --  #1A NAME="AFU_86"#2|
   procedure Get_Window_Position
     (Win             : Window := Standard_Window;
      Top_Left_Line   : out Line_Position;
      Top_Left_Column : out Column_Position);
   --  AKA: getbegyx()
   pragma Inline (Get_Window_Position);

   --  #1A NAME="AFU_87"#2|
   procedure Get_Cursor_Position
     (Win    : Window := Standard_Window;
      Line   : out Line_Position;
      Column : out Column_Position);
   --  AKA: getyx()
   pragma Inline (Get_Cursor_Position);

   --  #1A NAME="AFU_88"#2|
   procedure Get_Origin_Relative_To_Parent
     (Win                : Window;
      Top_Left_Line      : out Line_Position;
      Top_Left_Column    : out Column_Position;
      Is_Not_A_Subwindow : out Boolean);
   --  AKA: getparyx()
   --  Instead of placing -1 in the coordinates as return, we use a Boolean
   --  to return the info that the window has no parent.
   pragma Inline (Get_Origin_Relative_To_Parent);

   --  |=====================================================================
   --  | Man page curs_pad.3x
   --  |=====================================================================

   --  #1A NAME="AFU_89"#2|
   function New_Pad (Lines   : Line_Count;
                     Columns : Column_Count) return Window;
   --  AKA: newpad()
   pragma Inline (New_Pad);

   --  #1A NAME="AFU_90"#2|
   function Sub_Pad
     (Pad                   : Window;
      Number_Of_Lines       : Line_Count;
      Number_Of_Columns     : Column_Count;
      First_Line_Position   : Line_Position;
      First_Column_Position : Column_Position) return Window;
   --  AKA: subpad()
   pragma Inline (Sub_Pad);

   --  #1A NAME="AFU_91"#2|
   procedure Refresh
     (Pad                      : Window;
      Source_Top_Row           : Line_Position;
      Source_Left_Column       : Column_Position;
      Destination_Top_Row      : Line_Position;
      Destination_Left_Column  : Column_Position;
      Destination_Bottom_Row   : Line_Position;
      Destination_Right_Column : Column_Position);
   --  AKA: prefresh()
   pragma Inline (Refresh);

   --  #1A NAME="AFU_92"#2|
   procedure Refresh_Without_Update
     (Pad                      : Window;
      Source_Top_Row           : Line_Position;
      Source_Left_Column       : Column_Position;
      Destination_Top_Row      : Line_Position;
      Destination_Left_Column  : Column_Position;
      Destination_Bottom_Row   : Line_Position;
      Destination_Right_Column : Column_Position);
   --  AKA: pnoutrefresh()
   pragma Inline (Refresh_Without_Update);

   --  #1A NAME="AFU_93"#2|
   procedure Add_Character_To_Pad_And_Echo_It
     (Pad : Window;
      Ch  : Attributed_Character);
   --  AKA: pechochar()

   procedure Add_Character_To_Pad_And_Echo_It
     (Pad : Window;
      Ch  : Character);
   pragma Inline (Add_Character_To_Pad_And_Echo_It);

   --  |=====================================================================
   --  | Man page curs_scroll.3x
   --  |=====================================================================

   --  #1A NAME="AFU_94"#2|
   procedure Scroll (Win    : Window  := Standard_Window;
                     Amount : Integer := 1);
   --  AKA: wscrl()
   --  AKA: scroll()
   --  AKA: scrl()
   pragma Inline (Scroll);

   --  |=====================================================================
   --  | Man page curs_delch.3x
   --  |=====================================================================

   --  #1A NAME="AFU_95"#2|
   procedure Delete_Character (Win : Window := Standard_Window);
   --  AKA: wdelch()
   --  AKA: delch()

   --  #1A NAME="AFU_96"#2|
   procedure Delete_Character
     (Win    : Window := Standard_Window;
      Line   : Line_Position;
      Column : Column_Position);
   --  AKA: mvwdelch()
   --  AKA: mvdelch()
   pragma Inline (Delete_Character);

   --  |=====================================================================
   --  | Man page curs_inch.3x
   --  |=====================================================================

   --  #1A NAME="AFU_97"#2|
   function Peek (Win : Window := Standard_Window)
     return Attributed_Character;
   --  AKA: inch()
   --  AKA: winch()

   --  #1A NAME="AFU_98"#2|
   function Peek
     (Win    : Window := Standard_Window;
      Line   : Line_Position;
      Column : Column_Position) return Attributed_Character;
   --  AKA: mvwinch()
   --  AKA: mvinch()
   --  More Peek's follow, pragma Inline appears later.

   --  |=====================================================================
   --  | Man page curs_insch.3x
   --  |=====================================================================

   --  #1A NAME="AFU_99"#2|
   procedure Insert (Win : Window := Standard_Window;
                     Ch  : Attributed_Character);
   --  AKA: winsch()
   --  AKA: insch()

   --  #1A NAME="AFU_100"#2|
   procedure Insert (Win    : Window := Standard_Window;
                     Line   : Line_Position;
                     Column : Column_Position;
                     Ch     : Attributed_Character);
   --  AKA: mvwinsch()
   --  AKA: mvinsch()

   --  |=====================================================================
   --  | Man page curs_insstr.3x
   --  |=====================================================================

   --  #1A NAME="AFU_101"#2|
   procedure Insert (Win : Window := Standard_Window;
                     Str : String;
                     Len : Integer := -1);
   --  AKA: winsnstr()
   --  AKA: winsstr()
   --  AKA: insnstr()
   --  AKA: insstr()

   --  #1A NAME="AFU_102"#2|
   procedure Insert (Win    : Window := Standard_Window;
                     Line   : Line_Position;
                     Column : Column_Position;
                     Str    : String;
                     Len    : Integer := -1);
   --  AKA: mvwinsnstr()
   --  AKA: mvwinsstr()
   --  AKA: mvinsnstr()
   --  AKA: mvinsstr()
   pragma Inline (Insert);

   --  |=====================================================================
   --  | Man page curs_instr.3x
   --  |=====================================================================

   --  #1A NAME="AFU_103"#2|
   procedure Peek (Win : Window := Standard_Window;
                   Str : out String;
                   Len : Integer := -1);
   --  AKA: winnstr()
   --  AKA: winstr()
   --  AKA: innstr()
   --  AKA: instr()

   --  #1A NAME="AFU_104"#2|
   procedure Peek (Win    : Window := Standard_Window;
                   Line   : Line_Position;
                   Column : Column_Position;
                   Str    : out String;
                   Len    : Integer := -1);
   --  AKA: mvwinnstr()
   --  AKA: mvwinstr()
   --  AKA: mvinnstr()
   --  AKA: mvinstr()

   --  |=====================================================================
   --  | Man page curs_inchstr.3x
   --  |=====================================================================

   --  #1A NAME="AFU_105"#2|
   procedure Peek (Win : Window := Standard_Window;
                   Str : out Attributed_String;
                   Len : Integer := -1);
   --  AKA: winchnstr()
   --  AKA: winchstr()
   --  AKA: inchnstr()
   --  AKA: inchstr()

   --  #1A NAME="AFU_106"#2|
   procedure Peek (Win    : Window := Standard_Window;
                   Line   : Line_Position;
                   Column : Column_Position;
                   Str    : out Attributed_String;
                   Len    : Integer := -1);
   --  AKA: mvwinchnstr()
   --  AKA: mvwinchstr()
   --  AKA: mvinchnstr()
   --  AKA: mvinchstr()
   --  We do not inline the Peek procedures

   --  |=====================================================================
   --  | Man page curs_getstr.3x
   --  |=====================================================================

   --  #1A NAME="AFU_107"#2|
   procedure Get (Win : Window := Standard_Window;
                  Str : out String;
                  Len : Integer := -1);
   --  AKA: wgetnstr()
   --  AKA: wgetstr()
   --  AKA: getnstr()
   --  AKA: getstr()
   --  actually getstr is not supported because that results in buffer
   --  overflows.

   --  #1A NAME="AFU_108"#2|
   procedure Get (Win    : Window := Standard_Window;
                  Line   : Line_Position;
                  Column : Column_Position;
                  Str    : out String;
                  Len    : Integer := -1);
   --  AKA: mvwgetnstr()
   --  AKA: mvwgetstr()
   --  AKA: mvgetnstr()
   --  AKA: mvgetstr()
   --  Get is not inlined

   --  |=====================================================================
   --  | Man page curs_slk.3x
   --  |=====================================================================

   --  Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set

   type Soft_Label_Key_Format is (Three_Two_Three,
                                  Four_Four,
                                  PC_Style,              --  ncurses specific
                                  PC_Style_With_Index);  --  "
   type Label_Number is new Positive range 1 .. 12;
   type Label_Justification is (Left, Centered, Right);

   --  #1A NAME="AFU_109"#2|
   procedure Init_Soft_Label_Keys
     (Format : Soft_Label_Key_Format := Three_Two_Three);
   --  AKA: slk_init()
   pragma Inline (Init_Soft_Label_Keys);

   --  #1A NAME="AFU_110"#2|
   procedure Set_Soft_Label_Key (Label : Label_Number;
                                 Text  : String;
                                 Fmt   : Label_Justification := Left);
   --  AKA: slk_set()
   --  We do not inline this procedure

   --  #1A NAME="AFU_111"#2|
   procedure Refresh_Soft_Label_Keys;
   --  AKA: slk_refresh()
   pragma Inline (Refresh_Soft_Label_Keys);

   --  #1A NAME="AFU_112"#2|
   procedure Refresh_Soft_Label_Keys_Without_Update;
   --  AKA: slk_noutrefresh()
   pragma Inline (Refresh_Soft_Label_Keys_Without_Update);

   --  #1A NAME="AFU_113"#2|
   procedure Get_Soft_Label_Key (Label : Label_Number;
                                 Text  : out String);
   --  AKA: slk_label()

   --  #1A NAME="AFU_114"#2|
   function Get_Soft_Label_Key (Label : Label_Number) return String;
   --  AKA: slk_label()
   --  Same as function
   pragma Inline (Get_Soft_Label_Key);

   --  #1A NAME="AFU_115"#2|
   procedure Clear_Soft_Label_Keys;
   --  AKA: slk_clear()
   pragma Inline (Clear_Soft_Label_Keys);

   --  #1A NAME="AFU_116"#2|
   procedure Restore_Soft_Label_Keys;
   --  AKA: slk_restore()
   pragma Inline (Restore_Soft_Label_Keys);

   --  #1A NAME="AFU_117"#2|
   procedure Touch_Soft_Label_Keys;
   --  AKA: slk_touch()
   pragma Inline (Touch_Soft_Label_Keys);

   --  #1A NAME="AFU_118"#2|
   procedure Switch_Soft_Label_Key_Attributes
     (Attr : Character_Attribute_Set;
      On   : Boolean := True);
   --  AKA: slk_attron()
   --  AKA: slk_attroff()
   pragma Inline (Switch_Soft_Label_Key_Attributes);

   --  #1A NAME="AFU_119"#2|
   procedure Set_Soft_Label_Key_Attributes
     (Attr  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First);
   --  AKA: slk_attrset()
   pragma Inline (Set_Soft_Label_Key_Attributes);

   --  #1A NAME="AFU_120"#2|
   function Get_Soft_Label_Key_Attributes return Character_Attribute_Set;
   --  AKA: slk_attr()

   --  #1A NAME="AFU_121"#2|
   function Get_Soft_Label_Key_Attributes return Color_Pair;
   --  AKA: slk_attr()
   pragma Inline (Get_Soft_Label_Key_Attributes);

   --  #1A NAME="AFU_122"#2|
   procedure Set_Soft_Label_Key_Color (Pair : Color_Pair);
   --  AKA: slk_color()
   pragma Inline (Set_Soft_Label_Key_Color);

   --  |=====================================================================
   --  | Man page keybound.3x
   --  |=====================================================================
   --  Not Implemented: keybound

   --  |=====================================================================
   --  | Man page keyok.3x
   --  |=====================================================================

   --  #1A NAME="AFU_123"#2|
   procedure Enable_Key (Key    : Special_Key_Code;
                         Enable : Boolean := True);
   --  AKA: keyok()
   pragma Inline (Enable_Key);

   --  |=====================================================================
   --  | Man page define_key.3x
   --  |=====================================================================

   --  #1A NAME="AFU_124"#2|
   procedure Define_Key (Definition : String;
                         Key        : Special_Key_Code);
   --  AKA: define_key()
   pragma Inline (Define_Key);

   --  |=====================================================================
   --  | Man page curs_util.3x
   --  |=====================================================================

   --  | Not implemented : filter, use_env
   --  | putwin, getwin are in the child package PutWin
   --

   --  #1A NAME="AFU_125"#2|
   procedure Key_Name (Key  : Real_Key_Code;
                       Name : out String);
   --  AKA: keyname()
   --  The external name for a real keystroke.

   --  #1A NAME="AFU_126"#2|
   function Key_Name (Key  : Real_Key_Code) return String;
   --  AKA: keyname()
   --  Same as function
   --  We do not inline this routine

   --  #1A NAME="AFU_127"#2|
   procedure Un_Control (Ch  : Attributed_Character;
                         Str : out String);
   --  AKA: unctrl()

   --  #1A NAME="AFU_128"#2|
   function Un_Control (Ch  : Attributed_Character) return String;
   --  AKA: unctrl()
   --  Same as function
   pragma Inline (Un_Control);

   --  #1A NAME="AFU_129"#2|
   procedure Delay_Output (Msecs : Natural);
   --  AKA: delay_output()
   pragma Inline (Delay_Output);

   --  #1A NAME="AFU_130"#2|
   procedure Flush_Input;
   --  AKA: flushinp()
   pragma Inline (Flush_Input);

   --  |=====================================================================
   --  | Man page curs_termattrs.3x
   --  |=====================================================================

   --  #1A NAME="AFU_131"#2|
   function Baudrate return Natural;
   --  AKA: baudrate()
   pragma Inline (Baudrate);

   --  #1A NAME="AFU_132"#2|
   function Erase_Character return Character;
   --  AKA: erasechar()
   pragma Inline (Erase_Character);

   --  #1A NAME="AFU_133"#2|
   function Kill_Character return Character;
   --  AKA: killchar()
   pragma Inline (Kill_Character);

   --  #1A NAME="AFU_134"#2|
   function Has_Insert_Character return Boolean;
   --  AKA: has_ic()
   pragma Inline (Has_Insert_Character);

   --  #1A NAME="AFU_135"#2|
   function Has_Insert_Line return Boolean;
   --  AKA: has_il()
   pragma Inline (Has_Insert_Line);

   --  #1A NAME="AFU_136"#2|
   function Supported_Attributes return Character_Attribute_Set;
   --  AKA: termattrs()
   pragma Inline (Supported_Attributes);

   --  #1A NAME="AFU_137"#2|
   procedure Long_Name (Name : out String);
   --  AKA: longname()

   --  #1A NAME="AFU_138"#2|
   function Long_Name return String;
   --  AKA: longname()
   --  Same as function
   pragma Inline (Long_Name);

   --  #1A NAME="AFU_139"#2|
   procedure Terminal_Name (Name : out String);
   --  AKA: termname()

   --  #1A NAME="AFU_140"#2|
   function Terminal_Name return String;
   --  AKA: termname()
   --  Same as function
   pragma Inline (Terminal_Name);

   --  |=====================================================================
   --  | Man page curs_color.3x
   --  |=====================================================================

   --  COLOR_PAIR
   --  COLOR_PAIR(n) in C is the same as
   --  Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video)
   --  In C you often see something like c = c | COLOR_PAIR(n);
   --  This is equivalent to c.Color := n;

   --  #1A NAME="AFU_141"#2|
   procedure Start_Color;
   --  AKA: start_color()
   pragma Import (C, Start_Color, "start_color");

   --  #1A NAME="AFU_142"#2|
   procedure Init_Pair (Pair : Redefinable_Color_Pair;
                        Fore : Color_Number;
                        Back : Color_Number);
   --  AKA: init_pair()
   pragma Inline (Init_Pair);

   --  #1A NAME="AFU_143"#2|
   procedure Pair_Content (Pair : Color_Pair;
                           Fore : out Color_Number;
                           Back : out Color_Number);
   --  AKA: pair_content()
   pragma Inline (Pair_Content);

   --  #1A NAME="AFU_144"#2|
   function Has_Colors return Boolean;
   --  AKA: has_colors()
   pragma Inline (Has_Colors);

   --  #1A NAME="AFU_145"#2|
   procedure Init_Color (Color : Color_Number;
                         Red   : RGB_Value;
                         Green : RGB_Value;
                         Blue  : RGB_Value);
   --  AKA: init_color()
   pragma Inline (Init_Color);

   --  #1A NAME="AFU_146"#2|
   function Can_Change_Color return Boolean;
   --  AKA: can_change_color()
   pragma Inline (Can_Change_Color);

   --  #1A NAME="AFU_147"#2|
   procedure Color_Content (Color : Color_Number;
                            Red   : out RGB_Value;
                            Green : out RGB_Value;
                            Blue  : out RGB_Value);
   --  AKA: color_content()
   pragma Inline (Color_Content);

   --  |=====================================================================
   --  | Man page curs_kernel.3x
   --  |=====================================================================
   --  | Not implemented: getsyx, setsyx
   --
   type Curses_Mode is (Curses, Shell);

   --  #1A NAME="AFU_148"#2|
   procedure Save_Curses_Mode (Mode : Curses_Mode);
   --  AKA: def_prog_mode()
   --  AKA: def_shell_mode()
   pragma Inline (Save_Curses_Mode);

   --  #1A NAME="AFU_149"#2|
   procedure Reset_Curses_Mode (Mode : Curses_Mode);
   --  AKA: reset_prog_mode()
   --  AKA: reset_shell_mode()
   pragma Inline (Reset_Curses_Mode);

   --  #1A NAME="AFU_150"#2|
   procedure Save_Terminal_State;
   --  AKA: savetty()
   pragma Inline (Save_Terminal_State);

   --  #1A NAME="AFU_151"#2|
   procedure Reset_Terminal_State;
   --  AKA: resetty();
   pragma Inline (Reset_Terminal_State);

   type Stdscr_Init_Proc is access
      function (Win     : Window;
                Columns : Column_Count) return Integer;
   pragma Convention (C, Stdscr_Init_Proc);
   --  N.B.: the return value is actually ignored, but it seems to be
   --        a good practice to return 0 if you think all went fine
   --        and -1 otherwise.

   --  #1A NAME="AFU_152"#2|
   procedure Rip_Off_Lines (Lines : Integer;
                            Proc  : Stdscr_Init_Proc);
   --  AKA: ripoffline()
   --  N.B.: to be more precise, this uses a ncurses specific enhancement of
   --        ripoffline(), in which the Lines argument absolute value is the
   --        number of lines to be ripped of. The official ripoffline() only
   --        uses the sign of Lines to remove a single line from bottom or top.
   pragma Inline (Rip_Off_Lines);

   type Cursor_Visibility is (Invisible, Normal, Very_Visible);

   --  #1A NAME="AFU_153"#2|
   procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility);
   --  AKA: curs_set()
   pragma Inline (Set_Cursor_Visibility);

   --  #1A NAME="AFU_154"#2|
   procedure Nap_Milli_Seconds (Ms : Natural);
   --  AKA: napms()
   pragma Inline (Nap_Milli_Seconds);

   --  |=====================================================================
   --  | Some useful helpers.
   --  |=====================================================================
   type Transform_Direction is (From_Screen, To_Screen);
   procedure Transform_Coordinates
     (W      : Window := Standard_Window;
      Line   : in out Line_Position;
      Column : in out Column_Position;
      Dir    : Transform_Direction := From_Screen);
   --  This procedure transforms screen coordinates into coordinates relative
   --  to the window and vice versa, depending on the Dir parameter.
   --  Screen coordinates are the position information for the physical device.
   --  An Curses_Exception will be raised if Line and Column are not in the
   --  Window or if you pass the Null_Window as argument.
   --  We do not inline this procedure

   --  |=====================================================================
   --  | Man page default_colors.3x
   --  |=====================================================================

   Default_Color : constant Color_Number := -1;

   --  #1A NAME="AFU_155"#2|
   procedure Use_Default_Colors;
   --  AKA: use_default_colors()
   pragma Inline (Use_Default_Colors);

   --  #1A NAME="AFU_156"#2|
   procedure Assume_Default_Colors (Fore : Color_Number := Default_Color;
                                    Back : Color_Number := Default_Color);
   --  AKA: assume_default_colors()
   pragma Inline (Assume_Default_Colors);

   --  |=====================================================================
   --  | Man page curs_extend.3x
   --  |=====================================================================

   --  #1A NAME="AFU_157"#2|
   function Curses_Version return String;
   --  AKA: curses_version()

   --  #1A NAME="AFU_158"#2|
   --  The returnvalue is the previous setting of the flag
   function Use_Extended_Names (Enable : Boolean) return Boolean;
   --  AKA: use_extended_names()

   --  |=====================================================================
   --  | Man page curs_trace.3x
   --  |=====================================================================

   --  #1A NAME="AFU_159"#2|
   procedure Curses_Free_All;
   --  AKA: _nc_freeall()

   --  |=====================================================================
   --  | Man page curs_scr_dump.3x
   --  |=====================================================================

   --  #1A NAME="AFU_160"#2|
   procedure Screen_Dump_To_File (Filename : String);
   --  AKA: scr_dump()

   --  #1A NAME="AFU_161"#2|
   procedure Screen_Restore_From_File (Filename : String);
   --  AKA: scr_restore()

   --  #1A NAME="AFU_162"#2|
   procedure Screen_Init_From_File (Filename : String);
   --  AKA: scr_init()

   --  #1A NAME="AFU_163"#2|
   procedure Screen_Set_File (Filename : String);
   --  AKA: scr_set()

   --  |=====================================================================
   --  | Man page curs_print.3x
   --  |=====================================================================
   --  Not implemented: mcprint

   --  |=====================================================================
   --  | Man page curs_printw.3x
   --  |=====================================================================
   --  Not implemented: printw,  wprintw, mvprintw, mvwprintw, vwprintw,
   --                   vw_printw
   --  Please use the Ada style Text_IO child packages for formatted
   --  printing. It does not make a lot of sense to map the printf style
   --  C functions to Ada.

   --  |=====================================================================
   --  | Man page curs_scanw.3x
   --  |=====================================================================
   --  Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw

   --  |=====================================================================
   --  | Man page resizeterm.3x
   --  |=====================================================================
   --  Not Implemented: resizeterm

   --  |=====================================================================
   --  | Man page wresize.3x
   --  |=====================================================================

   --  #1A NAME="AFU_164"#2|
   procedure Resize (Win               : Window := Standard_Window;
                     Number_Of_Lines   : Line_Count;
                     Number_Of_Columns : Column_Count);
   --  AKA: wresize()

private
   type Window is new System.Storage_Elements.Integer_Address;
   Null_Window : constant Window := 0;

   --  The next constants are generated and may be different on your
   --  architecture.
   --

   Sizeof_Bool : constant := Curses_Constants.Sizeof_Bool;

   type Curses_Bool is mod 2 ** Sizeof_Bool;

   Curses_Bool_False : constant Curses_Bool := 0;

end Terminal_Interface.Curses;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-integer_io__adb.htm0000644000175100001440000002365212340214310026254 0ustar tomusers terminal_interface-curses-text_io-integer_io.adb

File : terminal_interface-curses-text_io-integer_io.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Text_IO.Integer_IO               --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.11 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Terminal_Interface.Curses.Text_IO.Aux;

package body Terminal_Interface.Curses.Text_IO.Integer_IO is

   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
   package IIO is new Ada.Text_IO.Integer_IO (Num);

   procedure Put
     (Win   : Window;
      Item  : Num;
      Width : Field := Default_Width;
      Base  : Number_Base := Default_Base)
   is
      Buf : String (1 .. Field'Last);
   begin
      IIO.Put (Buf, Item, Base);
      Aux.Put_Buf (Win, Buf, Width);
   end Put;

   procedure Put
     (Item  : Num;
      Width : Field := Default_Width;
      Base  : Number_Base := Default_Base)
   is
   begin
      Put (Get_Window, Item, Width, Base);
   end Put;

end Terminal_Interface.Curses.Text_IO.Integer_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io__ads.htm0000644000175100001440000004350512340214310024152 0ustar tomusers terminal_interface-curses-text_io.ads

File : terminal_interface-curses-text_io.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                     Terminal_Interface.Curses.Text_IO                    --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.14 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Ada.IO_Exceptions;

package Terminal_Interface.Curses.Text_IO is

   use type Ada.Text_IO.Count;
   subtype Count is Ada.Text_IO.Count;
   subtype Positive_Count is Count range 1 .. Count'Last;

   subtype Field is Ada.Text_IO.Field;
   subtype Number_Base is Integer range 2 .. 16;

   type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);

   --  For most of the routines you will see a version without a Window
   --  type parameter. They will operate on a default window, which can
   --  be set by the user. It is initially equal to Standard_Window.

   procedure Set_Window (Win : Window);
   --  Set Win as the default window

   function Get_Window return Window;
   --  Get the current default window

   procedure Flush (Win : Window);
   procedure Flush;

   --------------------------------------------
   -- Specification of line and page lengths --
   --------------------------------------------

   --  There are no set routines in this package. I assume, that you allocate
   --  the window with an appropriate size.
   --  A scroll-window is interpreted as an page with unbounded page length,
   --  i.e. it returns the conventional 0 as page length.

   function Line_Length (Win : Window) return Count;
   function Line_Length return Count;

   function Page_Length (Win : Window) return Count;
   function Page_Length return Count;

   ------------------------------------
   -- Column, Line, and Page Control --
   ------------------------------------
   procedure New_Line (Win : Window; Spacing : Positive_Count := 1);
   procedure New_Line (Spacing : Positive_Count := 1);

   procedure New_Page (Win : Window);
   procedure New_Page;

   procedure Set_Col (Win : Window;  To : Positive_Count);
   procedure Set_Col (To : Positive_Count);

   procedure Set_Line (Win : Window; To : Positive_Count);
   procedure Set_Line (To : Positive_Count);

   function Col (Win : Window) return Positive_Count;
   function Col return Positive_Count;

   function Line (Win : Window) return Positive_Count;
   function Line return Positive_Count;

   -----------------------
   -- Characters-Output --
   -----------------------

   procedure Put (Win  : Window; Item : Character);
   procedure Put (Item : Character);

   --------------------
   -- Strings-Output --
   --------------------

   procedure Put (Win  : Window; Item : String);
   procedure Put (Item : String);

   procedure Put_Line
     (Win  : Window;
      Item : String);

   procedure Put_Line
     (Item : String);

   --  Exceptions

   Status_Error : exception renames Ada.IO_Exceptions.Status_Error;
   Mode_Error   : exception renames Ada.IO_Exceptions.Mode_Error;
   Name_Error   : exception renames Ada.IO_Exceptions.Name_Error;
   Use_Error    : exception renames Ada.IO_Exceptions.Use_Error;
   Device_Error : exception renames Ada.IO_Exceptions.Device_Error;
   End_Error    : exception renames Ada.IO_Exceptions.End_Error;
   Data_Error   : exception renames Ada.IO_Exceptions.Data_Error;
   Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error;

end Terminal_Interface.Curses.Text_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-menus-item_user_data__adb.htm0000644000175100001440000002416112340214310026565 0ustar tomusers terminal_interface-curses-menus-item_user_data.adb

File : terminal_interface-curses-menus-item_user_data.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Menus.Item_User_Data             --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2014 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, 1996
--  Version Control:
--  @Revision: 1.14 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Menus.Item_User_Data is

   use type Interfaces.C.int;

   procedure Set_User_Data (Itm  : Item;
                            Data : User_Access)
   is
      function Set_Item_Userptr (Itm  : Item;
                                 Addr : User_Access)  return Eti_Error;
      pragma Import (C, Set_Item_Userptr, "set_item_userptr");

   begin
      Eti_Exception (Set_Item_Userptr (Itm, Data));
   end Set_User_Data;

   function Get_User_Data (Itm  : Item) return User_Access
   is
      function Item_Userptr (Itm : Item) return User_Access;
      pragma Import (C, Item_Userptr, "item_userptr");
   begin
      return Item_Userptr (Itm);
   end Get_User_Data;

   procedure Get_User_Data (Itm  : Item;
                            Data : out User_Access)
   is
   begin
      Data := Get_User_Data (Itm);
   end Get_User_Data;

end Terminal_Interface.Curses.Menus.Item_User_Data;
AdaCurses-20170708/doc/ada/terminal_interface-curses-panels__ads.htm0000644000175100001440000004025712340214310023762 0ustar tomusers terminal_interface-curses-panels.ads

File : terminal_interface-curses-panels.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                      Terminal_Interface.Curses.Panels                    --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2014 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, 1996
--  Version Control:
--  @Revision: 1.22 @
--  @Date: 2014/05/24 21:31:57 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with System;

package Terminal_Interface.Curses.Panels is
   pragma Preelaborate (Terminal_Interface.Curses.Panels);
   pragma Linker_Options ("-lpanel" & Curses_Constants.DFT_ARG_SUFFIX);

   type Panel is private;

   ---------------------------
   --  Interface constants  --
   ---------------------------
   Null_Panel : constant Panel;

   -------------------
   --  Exceptions   --
   -------------------

   Panel_Exception : exception;

   --  |=====================================================================
   --  | Man page panel.3x
   --  |=====================================================================

   --  #1A NAME="AFU_1"#2|
   function Create (Win : Window) return Panel;
   --  AKA: new_panel()
   pragma Inline (Create);

   --  #1A NAME="AFU_2"#2|
   function New_Panel (Win : Window) return Panel renames Create;
   --  AKA: new_panel()
   --  pragma Inline (New_Panel);

   --  #1A NAME="AFU_3"#2|
   procedure Bottom (Pan : Panel);
   --  AKA: bottom_panel()
   pragma Inline (Bottom);

   --  #1A NAME="AFU_4"#2|
   procedure Top (Pan : Panel);
   --  AKA: top_panel()
   pragma Inline (Top);

   --  #1A NAME="AFU_5"#2|
   procedure Show (Pan : Panel);
   --  AKA: show_panel()
   pragma Inline (Show);

   --  #1A NAME="AFU_6"#2|
   procedure Update_Panels;
   --  AKA: update_panels()
   pragma Import (C, Update_Panels, "update_panels");

   --  #1A NAME="AFU_7"#2|
   procedure Hide (Pan : Panel);
   --  AKA: hide_panel()
   pragma Inline (Hide);

   --  #1A NAME="AFU_8"#2|
   function Get_Window (Pan : Panel) return Window;
   --  AKA: panel_window()
   pragma Inline (Get_Window);

   --  #1A NAME="AFU_9"#2|
   function Panel_Window (Pan : Panel) return Window renames Get_Window;
   --  pragma Inline (Panel_Window);

   --  #1A NAME="AFU_10"#2|
   procedure Replace (Pan : Panel;
                      Win : Window);
   --  AKA: replace_panel()
   pragma Inline (Replace);

   --  #1A NAME="AFU_11"#2|
   procedure Move (Pan    : Panel;
                   Line   : Line_Position;
                   Column : Column_Position);
   --  AKA: move_panel()
   pragma Inline (Move);

   --  #1A NAME="AFU_12"#2|
   function Is_Hidden (Pan : Panel) return Boolean;
   --  AKA: panel_hidden()
   pragma Inline (Is_Hidden);

   --  #1A NAME="AFU_13"#2|
   function Above (Pan : Panel) return Panel;
   --  AKA: panel_above()
   pragma Import (C, Above, "panel_above");

   --  #1A NAME="AFU_14"#2|
   function Below (Pan : Panel) return Panel;
   --  AKA: panel_below()
   pragma Import (C, Below, "panel_below");

   --  #1A NAME="AFU_15"#2|
   procedure Delete (Pan : in out Panel);
   --  AKA: del_panel()
   pragma Inline (Delete);

private
      type Panel is new System.Storage_Elements.Integer_Address;
      Null_Panel : constant Panel := 0;

end Terminal_Interface.Curses.Panels;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm0000644000175100001440000003275112340214310031161 0ustar tomusers terminal_interface-curses-forms-field_types-enumeration-ada.adb

File : terminal_interface-curses-forms-field_types-enumeration-ada.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--         Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada      --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2004,2011 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, 1996
--  Version Control:
--  @Revision: 1.11 @
--  @Date: 2011/03/22 23:36:20 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Characters.Handling; use Ada.Characters.Handling;

package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is

   function Create (Set            : Type_Set := Mixed_Case;
                    Case_Sensitive : Boolean  := False;
                    Must_Be_Unique : Boolean  := False)
                    return Enumeration_Field
   is
      I : Enumeration_Info (T'Pos (T'Last) - T'Pos (T'First) + 1);
      J : Positive := 1;
   begin
      I.Case_Sensitive := Case_Sensitive;
      I.Match_Must_Be_Unique := Must_Be_Unique;

      for E in T'Range loop
         I.Names (J) := new String'(T'Image (E));
         --  The Image attribute defaults to upper case, so we have to handle
         --  only the other ones...
         if Set /= Upper_Case then
            I.Names (J).all := To_Lower (I.Names (J).all);
            if Set = Mixed_Case then
               I.Names (J).all (I.Names (J).all'First) :=
                 To_Upper (I.Names (J).all (I.Names (J).all'First));
            end if;
         end if;
         J := J + 1;
      end loop;

      return Create (I, True);
   end Create;

   function Value (Fld : Field;
                   Buf : Buffer_Number := Buffer_Number'First) return T
   is
   begin
      return T'Value (Get_Buffer (Fld, Buf));
   end Value;

end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm0000644000175100001440000003563012340214310030315 0ustar tomusers terminal_interface-curses-forms-field_types-user-choice.adb

File : terminal_interface-curses-forms-field_types-user-choice.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--          Terminal_Interface.Curses.Forms.Field_Types.User.Choice         --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.20 @
--  @Date: 2014/05/24 21:31:05 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with System.Address_To_Access_Conversions;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is

   package Argument_Conversions is
      new System.Address_To_Access_Conversions (Argument);

   function Generic_Next (Fld : Field;
                          Usr : System.Address) return Curses_Bool
   is
      Result : Boolean;
      Udf    : constant User_Defined_Field_Type_With_Choice_Access :=
        User_Defined_Field_Type_With_Choice_Access
        (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ);
   begin
      Result := Next (Fld, Udf.all);
      return Curses_Bool (Boolean'Pos (Result));
   end Generic_Next;

   function Generic_Prev (Fld : Field;
                          Usr : System.Address) return Curses_Bool
   is
      Result : Boolean;
      Udf    : constant User_Defined_Field_Type_With_Choice_Access :=
        User_Defined_Field_Type_With_Choice_Access
        (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ);
   begin
      Result := Previous (Fld, Udf.all);
      return Curses_Bool (Boolean'Pos (Result));
   end Generic_Prev;

   --  -----------------------------------------------------------------------
   --
   function C_Generic_Choice return C_Field_Type
   is
      Res : Eti_Error;
      T   : C_Field_Type;
   begin
      if M_Generic_Choice = Null_Field_Type then
         T := New_Fieldtype (Generic_Field_Check'Access,
                             Generic_Char_Check'Access);
         if T = Null_Field_Type then
            raise Form_Exception;
         else
            Res := Set_Fieldtype_Arg (T,
                                      Make_Arg'Access,
                                      Copy_Arg'Access,
                                      Free_Arg'Access);
            Eti_Exception (Res);

            Res := Set_Fieldtype_Choice (T,
                                         Generic_Next'Access,
                                         Generic_Prev'Access);
            Eti_Exception (Res);
         end if;
         M_Generic_Choice := T;
      end if;
      pragma Assert (M_Generic_Choice /= Null_Field_Type);
      return M_Generic_Choice;
   end C_Generic_Choice;

end Terminal_Interface.Curses.Forms.Field_Types.User.Choice;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm0000644000175100001440000001611112340214310030510 0ustar tomusers terminal_interface-curses-forms-field_types-ipv4_address.ads

File : terminal_interface-curses-forms-field_types-ipv4_address.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--          Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address        --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is
   pragma Preelaborate
     (Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address);

   type Internet_V4_Address_Field is new Field_Type with null record;

   procedure Set_Field_Type (Fld : Field;
                             Typ : Internet_V4_Address_Field);
   pragma Inline (Set_Field_Type);

end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address;
AdaCurses-20170708/doc/ada/terminal_interface-curses-menus-menu_user_data__adb.htm0000644000175100001440000002405712340214310026577 0ustar tomusers terminal_interface-curses-menus-menu_user_data.adb

File : terminal_interface-curses-menus-menu_user_data.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Menus.Menu_User_Data             --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2014 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, 1996
--  Version Control:
--  @Revision: 1.15 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Menus.Menu_User_Data is

   use type Interfaces.C.int;

   procedure Set_User_Data (Men  : Menu;
                            Data : User_Access)
   is
      function Set_Menu_Userptr (Men  : Menu;
                                 Data : User_Access)  return Eti_Error;
      pragma Import (C, Set_Menu_Userptr, "set_menu_userptr");

   begin
      Eti_Exception (Set_Menu_Userptr (Men, Data));

   end Set_User_Data;

   function Get_User_Data (Men  : Menu) return User_Access
   is
      function Menu_Userptr (Men : Menu) return User_Access;
      pragma Import (C, Menu_Userptr, "menu_userptr");
   begin
      return Menu_Userptr (Men);
   end Get_User_Data;

   procedure Get_User_Data (Men  : Menu;
                            Data : out User_Access)
   is
   begin
      Data := Get_User_Data (Men);
   end Get_User_Data;

end Terminal_Interface.Curses.Menus.Menu_User_Data;
AdaCurses-20170708/doc/ada/files.htm0000644000175100001440000000051212145772562015474 0ustar tomusers

Files

[T] AdaCurses-20170708/doc/ada/terminal_interface-curses-mouse__ads.htm0000644000175100001440000006426112534703456023654 0ustar tomusers terminal_interface-curses-mouse.ads

File : terminal_interface-curses-mouse.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                      Terminal_Interface.Curses.Mouse                     --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2014,2015 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, 1996
--  Version Control:
--  @Revision: 1.32 @
--  @Date: 2015/05/30 23:19:19 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with System;

package Terminal_Interface.Curses.Mouse is
   pragma Preelaborate (Terminal_Interface.Curses.Mouse);

   --  |=====================================================================
   --  | Man page curs_mouse.3x
   --  |=====================================================================
   --  mouse_trafo, wmouse_trafo are implemented as Transform_Coordinates
   --  in the parent package.
   --
   --  Not implemented:
   --  REPORT_MOUSE_POSITION (i.e. as a parameter to Register_Reportable_Event
   --  or Start_Mouse)
   type Event_Mask is private;
   No_Events  : constant Event_Mask;
   All_Events : constant Event_Mask;

   type Mouse_Button is (Left,     -- aka: Button 1
                         Middle,   -- aka: Button 2
                         Right,    -- aka: Button 3
                         Button4,  -- aka: Button 4
                         Control,  -- Control Key
                         Shift,    -- Shift Key
                         Alt);     -- ALT Key

   subtype Real_Buttons  is Mouse_Button range Left .. Button4;
   subtype Modifier_Keys is Mouse_Button range Control .. Alt;

   type Button_State is (Released,
                         Pressed,
                         Clicked,
                         Double_Clicked,
                         Triple_Clicked);

   type Button_States is array (Button_State) of Boolean;
   pragma Pack (Button_States);

   All_Clicks : constant Button_States := (Clicked .. Triple_Clicked => True,
                                           others => False);
   All_States : constant Button_States := (others => True);

   type Mouse_Event is private;

   --  |=====================================================================
   --  | Man page curs_mouse.3x
   --  |=====================================================================

   function Has_Mouse return Boolean;
   --  Return true if a mouse device is supported, false otherwise.

   procedure Register_Reportable_Event
     (Button : Mouse_Button;
      State  : Button_State;
      Mask   : in out Event_Mask);
   --  Stores the event described by the button and the state in the mask.
   --  Before you call this the first time, you should initialize the mask
   --  with the Empty_Mask constant
   pragma Inline (Register_Reportable_Event);

   procedure Register_Reportable_Events
     (Button : Mouse_Button;
      State  : Button_States;
      Mask   : in out Event_Mask);
   --  Register all events described by the Button and the State bitmap.
   --  Before you call this the first time, you should initialize the mask
   --  with the Empty_Mask constant

   --  #1A NAME="AFU_1"#2|
   --  There is one difference to mousmask(): we return the value of the
   --  old mask, that means the event mask value before this call.
   --  Not Implemented: The library version
   --  returns a Mouse_Mask that tells which events are reported.
   function Start_Mouse (Mask : Event_Mask := All_Events)
                         return Event_Mask;
   --  AKA: mousemask()
   pragma Inline (Start_Mouse);

   procedure End_Mouse (Mask : Event_Mask := No_Events);
   --  Terminates the mouse, restores the specified event mask
   pragma Inline (End_Mouse);

   --  #1A NAME="AFU_2"#2|
   function Get_Mouse return Mouse_Event;
   --  AKA: getmouse()
   pragma Inline (Get_Mouse);

   procedure Get_Event (Event  : Mouse_Event;
                        Y      : out Line_Position;
                        X      : out Column_Position;
                        Button : out Mouse_Button;
                        State  : out Button_State);
   --  !!! Warning: X and Y are screen coordinates. Due to ripped of lines they
   --  may not be identical to window coordinates.
   --  Not Implemented: Get_Event only reports one event, the C library
   --  version supports multiple events, e.g. {click-1, click-3}
   pragma Inline (Get_Event);

   --  #1A NAME="AFU_3"#2|
   procedure Unget_Mouse (Event : Mouse_Event);
   --  AKA: ungetmouse()
   pragma Inline (Unget_Mouse);

   --  #1A NAME="AFU_4"#2|
   function Enclosed_In_Window (Win    : Window := Standard_Window;
                                Event  : Mouse_Event) return Boolean;
   --  AKA: wenclose()
   --  But : use event instead of screen coordinates.
   pragma Inline (Enclosed_In_Window);

   --  #1A NAME="AFU_5"#2|
   function Mouse_Interval (Msec : Natural := 200) return Natural;
   --  AKA: mouseinterval()
   pragma Inline (Mouse_Interval);

private
   --  This can be as little as 32 bits (unsigned), or as long as the system's
   --  unsigned long.  Declare it as the minimum size to handle all valid
   --  sizes.
   type Event_Mask is mod 4294967296;

   type Mouse_Event is
      record
         Id      : Integer range Integer (Interfaces.C.short'First) ..
                                 Integer (Interfaces.C.short'Last);
         X, Y, Z : Integer range Integer (Interfaces.C.int'First) ..
                                 Integer (Interfaces.C.int'Last);
         Bstate  : Event_Mask;
      end record;
   pragma Convention (C, Mouse_Event);

   for Mouse_Event use
      record
         Id     at 0 range Curses_Constants.MEVENT_id_First
           .. Curses_Constants.MEVENT_id_Last;
         X      at 0 range Curses_Constants.MEVENT_x_First
           .. Curses_Constants.MEVENT_x_Last;
         Y      at 0 range Curses_Constants.MEVENT_y_First
           .. Curses_Constants.MEVENT_y_Last;
         Z      at 0 range Curses_Constants.MEVENT_z_First
           .. Curses_Constants.MEVENT_z_Last;
         Bstate at 0 range Curses_Constants.MEVENT_bstate_First
           .. Curses_Constants.MEVENT_bstate_Last;
      end record;
   for Mouse_Event'Size use Curses_Constants.MEVENT_Size;
   Generation_Bit_Order : System.Bit_Order renames Curses_Constants.Bit_Order;

   BUTTON_CTRL      : constant Event_Mask := Curses_Constants.BUTTON_CTRL;
   BUTTON_SHIFT     : constant Event_Mask := Curses_Constants.BUTTON_SHIFT;
   BUTTON_ALT       : constant Event_Mask := Curses_Constants.BUTTON_ALT;
   BUTTON1_EVENTS   : constant Event_Mask
     := Curses_Constants.all_events_button_1;
   BUTTON2_EVENTS   : constant Event_Mask
     := Curses_Constants.all_events_button_2;
   BUTTON3_EVENTS   : constant Event_Mask
     := Curses_Constants.all_events_button_3;
   BUTTON4_EVENTS   : constant Event_Mask
     := Curses_Constants.all_events_button_4;
   ALL_MOUSE_EVENTS : constant Event_Mask := Curses_Constants.ALL_MOUSE_EVENTS;
   No_Events        : constant Event_Mask := 0;
   All_Events       : constant Event_Mask := ALL_MOUSE_EVENTS;

end Terminal_Interface.Curses.Mouse;
AdaCurses-20170708/doc/ada/terminal_interface-curses-aux__ads.htm0000644000175100001440000003715312340214307023304 0ustar tomusers terminal_interface-curses-aux.ads

File : terminal_interface-curses-aux.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                       Terminal_Interface.Curses.Aux                      --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.23 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with System;
with Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;

package Terminal_Interface.Curses.Aux is
   pragma Preelaborate (Terminal_Interface.Curses.Aux);

   use type Interfaces.C.int;

   subtype C_Int      is Interfaces.C.int;
   subtype C_Short    is Interfaces.C.short;
   subtype C_Long_Int is Interfaces.C.long;
   subtype C_Size_T   is Interfaces.C.size_t;
   subtype C_UInt     is Interfaces.C.unsigned;
   subtype C_ULong    is Interfaces.C.unsigned_long;
   subtype C_Char_Ptr is Interfaces.C.Strings.chars_ptr;
   type    C_Void_Ptr is new System.Address;

   --  This is how those constants are defined in ncurses. I see them also
   --  exactly like this in all ETI implementations I ever tested. So it
   --  could be that this is quite general, but please check with your curses.
   --  This is critical, because curses sometime mixes Boolean returns with
   --  returning an error status.
   Curses_Ok    : constant C_Int := Curses_Constants.OK;
   Curses_Err   : constant C_Int := Curses_Constants.ERR;

   Curses_True  : constant C_Int := Curses_Constants.TRUE;
   Curses_False : constant C_Int := Curses_Constants.FALSE;

   --  Eti_Error: type for error codes returned by the menu and form subsystem
   type Eti_Error is
     (E_Current,
      E_Invalid_Field,
      E_Request_Denied,
      E_Not_Connected,
      E_Not_Selectable,
      E_No_Match,
      E_Unknown_Command,
      E_Not_Posted,
      E_No_Room,
      E_Bad_State,
      E_Connected,
      E_Posted,
      E_Bad_Argument,
      E_System_Error,
      E_Ok);

   procedure Eti_Exception (Code : Eti_Error);
   --  Do nothing if Code = E_Ok.
   --  Else dispatch the error code and raise the appropriate exception.

   procedure Fill_String (Cp  : chars_ptr;
                          Str : out String);
   --  Fill the Str parameter with the string denoted by the chars_ptr
   --  C-Style string.

   function Fill_String (Cp : chars_ptr) return String;
   --  Same but as function.

private
   for Eti_Error'Size use C_Int'Size;
   pragma Convention (C, Eti_Error);
   for Eti_Error use
     (E_Current         => Curses_Constants.E_CURRENT,
      E_Invalid_Field   => Curses_Constants.E_INVALID_FIELD,
      E_Request_Denied  => Curses_Constants.E_REQUEST_DENIED,
      E_Not_Connected   => Curses_Constants.E_NOT_CONNECTED,
      E_Not_Selectable  => Curses_Constants.E_NOT_SELECTABLE,
      E_No_Match        => Curses_Constants.E_NO_MATCH,
      E_Unknown_Command => Curses_Constants.E_UNKNOWN_COMMAND,
      E_Not_Posted      => Curses_Constants.E_NOT_POSTED,
      E_No_Room         => Curses_Constants.E_NO_ROOM,
      E_Bad_State       => Curses_Constants.E_BAD_STATE,
      E_Connected       => Curses_Constants.E_CONNECTED,
      E_Posted          => Curses_Constants.E_POSTED,
      E_Bad_Argument    => Curses_Constants.E_BAD_ARGUMENT,
      E_System_Error    => Curses_Constants.E_SYSTEM_ERROR,
      E_Ok              => Curses_Constants.E_OK);
end Terminal_Interface.Curses.Aux;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-float_io__ads.htm0000644000175100001440000002157712340214310025751 0ustar tomusers terminal_interface-curses-text_io-float_io.ads

File : terminal_interface-curses-text_io-float_io.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                Terminal_Interface.Curses.Text_IO.Float_IO                --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
generic
   type Num is digits <>;

package Terminal_Interface.Curses.Text_IO.Float_IO is

   Default_Fore : Field := 2;
   Default_Aft  : Field := Num'Digits - 1;
   Default_Exp  : Field := 3;

   procedure Put
     (Win  : Window;
      Item : Num;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp);

   procedure Put
     (Item : Num;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp);

private
   pragma Inline (Put);

end Terminal_Interface.Curses.Text_IO.Float_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-termcap__adb.htm0000644000175100001440000004757112340214310024120 0ustar tomusers terminal_interface-curses-termcap.adb

File : terminal_interface-curses-termcap.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                    Terminal_Interface.Curses.Termcap                     --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  @Date: 2009/12/26 17:38:58 @
--  Binding Version 01.00
------------------------------------------------------------------------------

with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;

package body Terminal_Interface.Curses.Termcap is

   function Get_Entry (Name : String) return Boolean
   is
      function tgetent (name : char_array; val : char_array)
                        return C_Int;
      pragma Import (C, tgetent, "tgetent");
      NameTxt : char_array (0 .. Name'Length);
      Length  : size_t;
      ignored : constant char_array (0 .. 0) := (0 => nul);
      result  : C_Int;
   begin
      To_C (Name, NameTxt, Length);
      result := tgetent (char_array (ignored), NameTxt);
      if result = -1 then
         raise Curses_Exception;
      else
         return Boolean'Val (result);
      end if;
   end Get_Entry;

------------------------------------------------------------------------------
   function Get_Flag (Name : String) return Boolean
   is
      function tgetflag (id : char_array) return C_Int;
      pragma Import (C, tgetflag, "tgetflag");
      Txt    : char_array (0 .. Name'Length);
      Length : size_t;
   begin
      To_C (Name, Txt, Length);
      if tgetflag (Txt) = 0 then
         return False;
      else
         return True;
      end if;
   end Get_Flag;

------------------------------------------------------------------------------
   procedure Get_Number (Name   : String;
                         Value  : out Integer;
                         Result : out Boolean)
   is
      function tgetnum (id : char_array) return C_Int;
      pragma Import (C, tgetnum, "tgetnum");
      Txt    : char_array (0 .. Name'Length);
      Length : size_t;
   begin
      To_C (Name, Txt, Length);
      Value := Integer (tgetnum (Txt));
      if Value = -1 then
         Result := False;
      else
         Result :=  True;
      end if;
   end Get_Number;

------------------------------------------------------------------------------
   procedure Get_String (Name   : String;
                         Value  : out String;
                         Result : out Boolean)
   is
      function tgetstr (id  : char_array;
                        buf : char_array) return chars_ptr;
      pragma Import (C, tgetstr, "tgetstr");
      Txt    : char_array (0 .. Name'Length);
      Length : size_t;
      Txt2   : chars_ptr;
      type t is new char_array (0 .. 1024); --  does it need to be 1024?
      Return_Buffer : constant t := (others => nul);
   begin
      To_C (Name, Txt, Length);
      Txt2 := tgetstr (Txt, char_array (Return_Buffer));
      if Txt2 = Null_Ptr then
         Result := False;
      else
         Value := Fill_String (Txt2);
         Result := True;
      end if;
   end Get_String;

   function Get_String (Name : String) return Boolean
   is
      function tgetstr (Id  : char_array;
                        buf : char_array) return chars_ptr;
      pragma Import (C, tgetstr, "tgetstr");
      Txt    : char_array (0 .. Name'Length);
      Length : size_t;
      Txt2   : chars_ptr;
      type t is new char_array (0 .. 1024); --  does it need to be 1024?
      Phony_Txt : constant t := (others => nul);
   begin
      To_C (Name, Txt, Length);
      Txt2 := tgetstr (Txt, char_array (Phony_Txt));
      if Txt2 = Null_Ptr then
         return False;
      else
         return True;
      end if;
   end Get_String;

------------------------------------------------------------------------------
   function TGoto (Cap : String;
                   Col : Column_Position;
                   Row : Line_Position) return Termcap_String is
      function tgoto (cap : char_array;
                      col : C_Int;
                      row : C_Int) return chars_ptr;
      pragma Import (C, tgoto);
      Txt    : char_array (0 .. Cap'Length);
      Length : size_t;
   begin
      To_C (Cap, Txt, Length);
      return Termcap_String (Fill_String
                             (tgoto (Txt, C_Int (Col), C_Int (Row))));
   end TGoto;

end Terminal_Interface.Curses.Termcap;
AdaCurses-20170708/doc/ada/terminal_interface-curses-mouse__adb.htm0000644000175100001440000007202212534703456023625 0ustar tomusers terminal_interface-curses-mouse.adb

File : terminal_interface-curses-mouse.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                     Terminal_Interface.Curses.Mouse                      --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2014 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, 1996
--  Version Control:
--  @Revision: 1.25 @
--  @Date: 2014/09/13 19:10:18 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Interfaces.C; use Interfaces.C;
use Interfaces;

package body Terminal_Interface.Curses.Mouse is

   use type System.Bit_Order;

   function Has_Mouse return Boolean
   is
      function Mouse_Avail return C_Int;
      pragma Import (C, Mouse_Avail, "has_mouse");
   begin
      if Has_Key (Key_Mouse) or else Mouse_Avail /= 0 then
         return True;
      else
         return False;
      end if;
   end Has_Mouse;

   function Get_Mouse return Mouse_Event
   is
      type Event_Access is access all Mouse_Event;

      function Getmouse (Ev : Event_Access) return C_Int;
      pragma Import (C, Getmouse, "getmouse");

      Event : aliased Mouse_Event;
   begin
      if Getmouse (Event'Access) = Curses_Err then
         raise Curses_Exception;
      end if;
      return Event;
   end Get_Mouse;

   procedure Register_Reportable_Event (Button : Mouse_Button;
                                        State  : Button_State;
                                        Mask   : in out Event_Mask)
   is
      Button_Nr : constant Natural := Mouse_Button'Pos (Button);
      State_Nr  : constant Natural := Button_State'Pos (State);
   begin
      if Button in Modifier_Keys and then State /= Pressed then
         raise Curses_Exception;
      else
         if Button in Real_Buttons then
            Mask := Mask or ((2 ** (6 * Button_Nr)) ** State_Nr);
         else
            Mask := Mask or (BUTTON_CTRL ** (Button_Nr - 4));
         end if;
      end if;
   end Register_Reportable_Event;

   procedure Register_Reportable_Events (Button : Mouse_Button;
                                         State  : Button_States;
                                         Mask   : in out Event_Mask)
   is
   begin
      for S in Button_States'Range loop
         if State (S) then
            Register_Reportable_Event (Button, S, Mask);
         end if;
      end loop;
   end Register_Reportable_Events;

   function Start_Mouse (Mask : Event_Mask := All_Events)
                         return Event_Mask
   is
      function MMask (M : Event_Mask;
                      O : access Event_Mask) return Event_Mask;
      pragma Import (C, MMask, "mousemask");
      R   : Event_Mask;
      Old : aliased Event_Mask;
   begin
      R := MMask (Mask, Old'Access);
      if R = No_Events then
         Beep;
      end if;
      return Old;
   end Start_Mouse;

   procedure End_Mouse (Mask : Event_Mask := No_Events)
   is
   begin
      if Mask /= No_Events then
         Beep;
      end if;
   end End_Mouse;

   procedure Dispatch_Event (Mask   : Event_Mask;
                             Button : out Mouse_Button;
                             State  : out Button_State);

   procedure Dispatch_Event (Mask   : Event_Mask;
                             Button : out Mouse_Button;
                             State  : out Button_State) is
      L : Event_Mask;
   begin
      Button := Alt;  --  preset to non real button;
      if (Mask and BUTTON1_EVENTS) /= 0 then
         Button := Left;
      elsif (Mask and BUTTON2_EVENTS) /= 0 then
         Button := Middle;
      elsif (Mask and BUTTON3_EVENTS) /= 0 then
         Button := Right;
      elsif (Mask and BUTTON4_EVENTS) /= 0 then
         Button := Button4;
      end if;
      if Button in Real_Buttons then
         L := 2 ** (6 * Mouse_Button'Pos (Button));
         for I in Button_State'Range loop
            if (Mask and L) /= 0 then
               State := I;
               exit;
            end if;
            L := 2 * L;
         end loop;
      else
         State := Pressed;
         if (Mask and BUTTON_CTRL) /= 0 then
            Button := Control;
         elsif (Mask and BUTTON_SHIFT) /= 0 then
            Button := Shift;
         elsif (Mask and BUTTON_ALT) /= 0 then
            Button := Alt;
         end if;
      end if;
   end Dispatch_Event;

   procedure Get_Event (Event  : Mouse_Event;
                        Y      : out Line_Position;
                        X      : out Column_Position;
                        Button : out Mouse_Button;
                        State  : out Button_State)
   is
      Mask  : constant Event_Mask := Event.Bstate;
   begin
      X := Column_Position (Event.X);
      Y := Line_Position   (Event.Y);
      Dispatch_Event (Mask, Button, State);
   end Get_Event;

   procedure Unget_Mouse (Event : Mouse_Event)
   is
      function Ungetmouse (Ev : Mouse_Event) return C_Int;
      pragma Import (C, Ungetmouse, "ungetmouse");
   begin
      if Ungetmouse (Event) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Unget_Mouse;

   function Enclosed_In_Window (Win    : Window := Standard_Window;
                                Event  : Mouse_Event) return Boolean
   is
      function Wenclose (Win : Window; Y : C_Int; X : C_Int)
                         return Curses_Bool;
      pragma Import (C, Wenclose, "wenclose");
   begin
      if Wenclose (Win, C_Int (Event.Y), C_Int (Event.X))
        = Curses_Bool_False
      then
         return False;
      else
         return True;
      end if;
   end Enclosed_In_Window;

   function Mouse_Interval (Msec : Natural := 200) return Natural
   is
      function Mouseinterval (Msec : C_Int) return C_Int;
      pragma Import (C, Mouseinterval, "mouseinterval");
   begin
      return Natural (Mouseinterval (C_Int (Msec)));
   end Mouse_Interval;

end Terminal_Interface.Curses.Mouse;
AdaCurses-20170708/doc/ada/terminal_interface-curses-menus-menu_user_data__ads.htm0000644000175100001440000002201512340214310026610 0ustar tomusers terminal_interface-curses-menus-menu_user_data.ads

File : terminal_interface-curses-menus-menu_user_data.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Menus.Menu_User_Data             --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.15 @
--  Binding Version 01.00
------------------------------------------------------------------------------

generic
   type User is limited private;
   type User_Access is access User;
package Terminal_Interface.Curses.Menus.Menu_User_Data is
   pragma Preelaborate (Terminal_Interface.Curses.Menus.Menu_User_Data);

   --  |=====================================================================
   --  | Man page menu_userptr.3x
   --  |=====================================================================

   --  #1A NAME="AFU_1"#2|
   procedure Set_User_Data (Men  : Menu;
                            Data : User_Access);
   --  AKA: set_menu_userptr
   pragma Inline (Set_User_Data);

   --  #1A NAME="AFU_2"#2|
   procedure Get_User_Data (Men  : Menu;
                            Data : out User_Access);
   --  AKA: menu_userptr

   --  #1A NAME="AFU_3"#2|
   function Get_User_Data (Men  : Menu) return User_Access;
   --  AKA: menu_userptr
   --  Same as function
   pragma Inline (Get_User_Data);

end Terminal_Interface.Curses.Menus.Menu_User_Data;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm0000644000175100001440000002006412340214310030471 0ustar tomusers terminal_interface-curses-forms-field_types-ipv4_address.adb

File : terminal_interface-curses-forms-field_types-ipv4_address.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--          Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address        --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.13 @
--  @Date: 2014/05/24 21:31:05 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is

   procedure Set_Field_Type (Fld : Field;
                             Typ : Internet_V4_Address_Field)
   is
      function Set_Fld_Type (F : Field := Fld)
                             return Eti_Error;
      pragma Import (C, Set_Fld_Type, "set_field_type_ipv4");

   begin
      Eti_Exception (Set_Fld_Type);
      Wrap_Builtin (Fld, Typ);
   end Set_Field_Type;

end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm0000644000175100001440000002411412340214310027544 0ustar tomusers terminal_interface-curses-forms-field_types-numeric.adb

File : terminal_interface-curses-forms-field_types-numeric.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--            Terminal_Interface.Curses.Forms.Field_Types.Numeric           --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.14 @
--  @Date: 2014/05/24 21:31:05 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Forms.Field_Types.Numeric is

   procedure Set_Field_Type (Fld : Field;
                             Typ : Numeric_Field)
   is
      type Double is new Interfaces.C.double;

      function Set_Fld_Type (F    : Field := Fld;
                             Arg1 : C_Int;
                             Arg2 : Double;
                             Arg3 : Double) return Eti_Error;
      pragma Import (C, Set_Fld_Type, "set_field_type_numeric");

   begin
      Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
                                   Arg2 => Double (Typ.Lower_Limit),
                                   Arg3 => Double (Typ.Upper_Limit)));
      Wrap_Builtin (Fld, Typ);
   end Set_Field_Type;

end Terminal_Interface.Curses.Forms.Field_Types.Numeric;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-form_user_data__ads.htm0000644000175100001440000002201512340214310026606 0ustar tomusers terminal_interface-curses-forms-form_user_data.ads

File : terminal_interface-curses-forms-form_user_data.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                Terminal_Interface.Curses.Forms.Form_User_Data            --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.15 @
--  Binding Version 01.00
------------------------------------------------------------------------------

generic
   type User is limited private;
   type User_Access is access User;
package Terminal_Interface.Curses.Forms.Form_User_Data is
   pragma Preelaborate (Terminal_Interface.Curses.Forms.Form_User_Data);

   --  |=====================================================================
   --  | Man page form_userptr.3x
   --  |=====================================================================

   --  #1A NAME="AFU_1"#2|
   procedure Set_User_Data (Frm  : Form;
                            Data : User_Access);
   --  AKA: set_form_userptr
   pragma Inline (Set_User_Data);

   --  #1A NAME="AFU_2"#2|
   procedure Get_User_Data (Frm  : Form;
                            Data : out User_Access);
   --  AKA: form_userptr

   --  #1A NAME="AFU_3"#2|
   function Get_User_Data (Frm  : Form) return User_Access;
   --  AKA: form_userptr
   --  Same as function
   pragma Inline (Get_User_Data);

end Terminal_Interface.Curses.Forms.Form_User_Data;
AdaCurses-20170708/doc/ada/terminal_interface-curses-panels-user_data__ads.htm0000644000175100001440000002164512340214310025727 0ustar tomusers terminal_interface-curses-panels-user_data.ads

File : terminal_interface-curses-panels-user_data.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                 Terminal_Interface.Curses.Panels.User_Data               --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.15 @
--  Binding Version 01.00
------------------------------------------------------------------------------

generic
   type User is limited private;
   type User_Access is access all User;
package Terminal_Interface.Curses.Panels.User_Data is
   pragma Preelaborate (Terminal_Interface.Curses.Panels.User_Data);

   --  |=====================================================================
   --  | Man page panel.3x
   --  |=====================================================================

   --  #1A NAME="AFU_1"#2|
   procedure Set_User_Data (Pan  : Panel;
                            Data : User_Access);
   --  AKA: set_panel_userptr
   pragma Inline (Set_User_Data);

   --  #1A NAME="AFU_2"#2|
   procedure Get_User_Data (Pan  : Panel;
                            Data : out User_Access);
   --  AKA: panel_userptr

   --  #1A NAME="AFU_3"#2|
   function Get_User_Data (Pan  : Panel) return User_Access;
   --  AKA: panel_userptr
   --  Same as function
   pragma Inline (Get_User_Data);

end Terminal_Interface.Curses.Panels.User_Data;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm0000644000175100001440000002671512340214310027150 0ustar tomusers terminal_interface-curses-text_io-enumeration_io.adb

File : terminal_interface-curses-text_io-enumeration_io.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--             Terminal_Interface.Curses.Text_IO.Enumeration_IO             --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.11 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Ada.Characters.Handling; use Ada.Characters.Handling;
with Terminal_Interface.Curses.Text_IO.Aux;

package body Terminal_Interface.Curses.Text_IO.Enumeration_IO is

   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
   package EIO is new Ada.Text_IO.Enumeration_IO (Enum);

   procedure Put
     (Win   : Window;
      Item  : Enum;
      Width : Field := Default_Width;
      Set   : Type_Set := Default_Setting)
   is
      Buf  : String (1 .. Field'Last);
      Tset : Ada.Text_IO.Type_Set;
   begin
      if Set /= Mixed_Case then
         Tset := Ada.Text_IO.Type_Set'Val (Type_Set'Pos (Set));
      else
         Tset := Ada.Text_IO.Lower_Case;
      end if;
      EIO.Put (Buf, Item, Tset);
      if Set = Mixed_Case then
         Buf (Buf'First) := To_Upper (Buf (Buf'First));
      end if;
      Aux.Put_Buf (Win, Buf, Width, True, True);
   end Put;

   procedure Put
     (Item  : Enum;
      Width : Field := Default_Width;
      Set   : Type_Set := Default_Setting)
   is
   begin
      Put (Get_Window, Item, Width, Set);
   end Put;

end Terminal_Interface.Curses.Text_IO.Enumeration_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-complex_io__adb.htm0000644000175100001440000002471412340214310026266 0ustar tomusers terminal_interface-curses-text_io-complex_io.adb

File : terminal_interface-curses-text_io-complex_io.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Text_IO.Complex_IO               --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.11 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Text_IO.Float_IO;

package body Terminal_Interface.Curses.Text_IO.Complex_IO is

   package FIO is new
     Terminal_Interface.Curses.Text_IO.Float_IO (Complex_Types.Real'Base);

   procedure Put
     (Win  : Window;
      Item : Complex;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp)
   is
   begin
      Put (Win, '(');
      FIO.Put (Win, Item.Re, Fore, Aft, Exp);
      Put (Win, ',');
      FIO.Put (Win, Item.Im, Fore, Aft, Exp);
      Put (Win, ')');
   end Put;

   procedure Put
     (Item : Complex;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp)
   is
   begin
      Put (Get_Window, Item, Fore, Aft, Exp);
   end Put;

end Terminal_Interface.Curses.Text_IO.Complex_IO;
AdaCurses-20170708/doc/ada/funcs/0000755000175100001440000000000013130303161014754 5ustar tomusersAdaCurses-20170708/doc/ada/funcs/D.htm0000644000175100001440000001145612340214307015665 0ustar tomusers D

Functions - D

[index] AdaCurses-20170708/doc/ada/funcs/R.htm0000644000175100001440000000771512340214307015706 0ustar tomusers R

Functions - R

[index] AdaCurses-20170708/doc/ada/funcs/K.htm0000644000175100001440000000176112340214307015672 0ustar tomusers K

Functions - K

[index] AdaCurses-20170708/doc/ada/funcs/F.htm0000644000175100001440000001335612340214307015670 0ustar tomusers F

Functions - F

[index] AdaCurses-20170708/doc/ada/funcs/O.htm0000644000175100001440000000162212340214307015672 0ustar tomusers O

Functions - O

[index] AdaCurses-20170708/doc/ada/funcs/T.htm0000644000175100001440000000733612534703455015723 0ustar tomusers T

Functions - T

[index] AdaCurses-20170708/doc/ada/funcs/H.htm0000644000175100001440000000325212340214307015664 0ustar tomusers H

Functions - H

[index] AdaCurses-20170708/doc/ada/funcs/A.htm0000644000175100001440000000463312340214307015661 0ustar tomusers A

Functions - A

[index] AdaCurses-20170708/doc/ada/funcs/W.htm0000644000175100001440000001072412340214307015705 0ustar tomusers W

Functions - W

[index] AdaCurses-20170708/doc/ada/funcs/V.htm0000644000175100001440000000145712340214307015707 0ustar tomusers V

Functions - V

[index] AdaCurses-20170708/doc/ada/funcs/U.htm0000644000175100001440000000372312340214307015704 0ustar tomusers U

Functions - U

[index] AdaCurses-20170708/doc/ada/funcs/E.htm0000644000175100001440000000246212340214307015663 0ustar tomusers E

Functions - E

[index] AdaCurses-20170708/doc/ada/funcs/L.htm0000644000175100001440000000364612340214307015677 0ustar tomusers L

Functions - L

[index] AdaCurses-20170708/doc/ada/funcs/P.htm0000644000175100001440000001553512340214307015703 0ustar tomusers P

Functions - P

[index] AdaCurses-20170708/doc/ada/funcs/N.htm0000644000175100001440000000617312340214307015677 0ustar tomusers N

Functions - N

[index] AdaCurses-20170708/doc/ada/funcs/M.htm0000644000175100001440000001223612534703455015707 0ustar tomusers M

Functions - M

[index] AdaCurses-20170708/doc/ada/funcs/C.htm0000644000175100001440000001406712340214307015665 0ustar tomusers C

Functions - C

[index] AdaCurses-20170708/doc/ada/funcs/G.htm0000644000175100001440000002642712340214307015674 0ustar tomusers G

Functions - G

[index] AdaCurses-20170708/doc/ada/funcs/S.htm0000644000175100001440000005320312534703455015714 0ustar tomusers S

Functions - S

[index] AdaCurses-20170708/doc/ada/funcs/B.htm0000644000175100001440000000335212340214307015657 0ustar tomusers B

Functions - B

[index] AdaCurses-20170708/doc/ada/funcs/I.htm0000644000175100001440000001134712340214307015671 0ustar tomusers I

Functions - I

[index] AdaCurses-20170708/doc/ada/funcs/Q.htm0000644000175100001440000000060412340214307015673 0ustar tomusers Q

Functions - Q

[index] AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-form_user_data__adb.htm0000644000175100001440000002530712340214310026574 0ustar tomusers terminal_interface-curses-forms-form_user_data.adb

File : terminal_interface-curses-forms-form_user_data.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                Terminal_Interface.Curses.Forms.Form_User_Data            --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2014 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, 1996
--  Version Control:
--  @Revision: 1.15 @
--  Binding Version 01.00
------------------------------------------------------------------------------
--  |
--  |=====================================================================
--  | man page form__userptr.3x
--  |=====================================================================
--  |
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Forms.Form_User_Data is

   use type Interfaces.C.int;

   --  |
   --  |
   --  |
   procedure Set_User_Data (Frm  : Form;
                            Data : User_Access)
   is
      function Set_Form_Userptr (Frm  : Form;
                                 Data : User_Access)  return Eti_Error;
      pragma Import (C, Set_Form_Userptr, "set_form_userptr");

   begin
      Eti_Exception (Set_Form_Userptr (Frm, Data));
   end Set_User_Data;
   --  |
   --  |
   --  |
   function Get_User_Data (Frm  : Form) return User_Access
   is
      function Form_Userptr (Frm : Form) return User_Access;
      pragma Import (C, Form_Userptr, "form_userptr");
   begin
      return Form_Userptr (Frm);
   end Get_User_Data;

   procedure Get_User_Data (Frm  : Form;
                            Data : out User_Access)
   is
   begin
      Data := Get_User_Data (Frm);
   end Get_User_Data;

end Terminal_Interface.Curses.Forms.Form_User_Data;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm0000644000175100001440000002140213076721162031210 0ustar tomusers terminal_interface-curses-forms-field_types-enumeration-ada.ads

File : terminal_interface-curses-forms-field_types-enumeration-ada.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--         Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada      --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998,2003 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, 1996
--  Version Control:
--  @Revision: 1.11 @
--  Binding Version 01.00
------------------------------------------------------------------------------
generic
   type T is (<>);

package Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is
   pragma Preelaborate
     (Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada);

   function Create (Set            : Type_Set := Mixed_Case;
                    Case_Sensitive : Boolean  := False;
                    Must_Be_Unique : Boolean  := False)
                    return Enumeration_Field;

   function Value (Fld : Field;
                   Buf : Buffer_Number := Buffer_Number'First) return T;
   --  Translate the content of the fields buffer - indicated by the
   --  buffer number - into an enumeration value. If the buffer is empty
   --  or the content is invalid, a Constraint_Error is raises.

end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
AdaCurses-20170708/doc/ada/main.htm0000644000175100001440000001256512340214310015304 0ustar tomusers

[No frame version is here]

Files

[T]

Functions/Procedures

[A] [B] [C] [D] [E] [F] [G] [H] [I] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W]
You should start your browsing with one of these files: AdaCurses-20170708/doc/ada/terminal_interface-curses-putwin__adb.htm0000644000175100001440000002325013076721162024016 0ustar tomusers terminal_interface-curses-putwin.adb

File : terminal_interface-curses-putwin.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                    Terminal_Interface.Curses.PutWin                      --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 2000,2003 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, 1996
--  Version Control:
--  @Revision: 1.4 @
--  Binding Version 01.00

with Ada.Streams.Stream_IO.C_Streams;
with Interfaces.C_Streams;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.PutWin is

   package ICS renames Interfaces.C_Streams;
   package ACS renames Ada.Streams.Stream_IO.C_Streams;
   use type C_Int;

   procedure Put_Window (Win  : Window;
                         File : Ada.Streams.Stream_IO.File_Type) is
      function putwin (Win : Window; f : ICS.FILEs) return C_Int;
      pragma Import (C, putwin, "putwin");

      R : constant C_Int := putwin (Win, ACS.C_Stream (File));
   begin
      if R /= Curses_Ok then
         raise Curses_Exception;
      end if;
   end Put_Window;

   function Get_Window (File : Ada.Streams.Stream_IO.File_Type)
                        return Window is
      function getwin (f : ICS.FILEs) return Window;
      pragma Import (C, getwin, "getwin");

      W : constant Window := getwin (ACS.C_Stream (File));
   begin
      if W = Null_Window then
         raise Curses_Exception;
      else
         return W;
      end if;
   end Get_Window;

end Terminal_Interface.Curses.PutWin;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm0000644000175100001440000002123212340214310030550 0ustar tomusers terminal_interface-curses-forms-field_types-alphanumeric.adb

File : terminal_interface-curses-forms-field_types-alphanumeric.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--          Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric        --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.13 @
--  @Date: 2014/05/24 21:31:05 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is

   procedure Set_Field_Type (Fld : Field;
                             Typ : AlphaNumeric_Field)
   is
      function Set_Fld_Type (F    : Field := Fld;
                             Arg1 : C_Int) return Eti_Error;
      pragma Import (C, Set_Fld_Type, "set_field_type_alnum");

   begin
      Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width)));
      Wrap_Builtin (Fld, Typ);
   end Set_Field_Type;

end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric;
AdaCurses-20170708/doc/ada/terminal_interface-curses-trace__adb.htm0000644000175100001440000001656512534703456023605 0ustar tomusers terminal_interface-curses-trace.adb

File : terminal_interface-curses-trace.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                      Terminal_Interface.Curses.Trace                     --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2009,2014 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, 1996
--  Version Control:
--  @Revision: 1.11 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C; use Interfaces.C;

package body Terminal_Interface.Curses.Trace is

   procedure Trace_On (x : Trace_Attribute_Set) is
      procedure traceC (y : Trace_Attribute_Set);
      pragma Import (C, traceC, "trace");
   begin
      traceC (x);
   end Trace_On;

   procedure Trace_Put (str : String) is
      procedure tracef (format : char_array; s : char_array);
      pragma Import (C, tracef, "_traces");
      --  _traces() is defined in c_varargs_to_ada.h
   begin
      tracef (To_C ("%s"), To_C (str));
   end Trace_Put;

end Terminal_Interface.Curses.Trace;
AdaCurses-20170708/doc/ada/terminal_interface-curses-panels__adb.htm0000644000175100001440000005136412340214310023742 0ustar tomusers terminal_interface-curses-panels.adb

File : terminal_interface-curses-panels.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                      Terminal_Interface.Curses.Panels                    --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2004,2009 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, 1996
--  Version Control:
--  @Revision: 1.14 @
--  @Date: 2009/12/26 17:38:58 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Interfaces.C;

package body Terminal_Interface.Curses.Panels is

   use type Interfaces.C.int;

   function Create (Win : Window) return Panel
   is
      function Newpanel (Win : Window) return Panel;
      pragma Import (C, Newpanel, "new_panel");

      Pan : Panel;
   begin
      Pan := Newpanel (Win);
      if Pan = Null_Panel then
         raise Panel_Exception;
      end if;
      return Pan;
   end Create;

   procedure Bottom (Pan : Panel)
   is
      function Bottompanel (Pan : Panel) return C_Int;
      pragma Import (C, Bottompanel, "bottom_panel");
   begin
      if Bottompanel (Pan) = Curses_Err then
         raise Panel_Exception;
      end if;
   end Bottom;

   procedure Top (Pan : Panel)
   is
      function Toppanel (Pan : Panel) return C_Int;
      pragma Import (C, Toppanel, "top_panel");
   begin
      if Toppanel (Pan) = Curses_Err then
         raise Panel_Exception;
      end if;
   end Top;

   procedure Show (Pan : Panel)
   is
      function Showpanel (Pan : Panel) return C_Int;
      pragma Import (C, Showpanel, "show_panel");
   begin
      if Showpanel (Pan) = Curses_Err then
         raise Panel_Exception;
      end if;
   end Show;

   procedure Hide (Pan : Panel)
   is
      function Hidepanel (Pan : Panel) return C_Int;
      pragma Import (C, Hidepanel, "hide_panel");
   begin
      if Hidepanel (Pan) = Curses_Err then
         raise Panel_Exception;
      end if;
   end Hide;

   function Get_Window (Pan : Panel) return Window
   is
      function Panel_Win (Pan : Panel) return Window;
      pragma Import (C, Panel_Win, "panel_window");

      Win : constant Window := Panel_Win (Pan);
   begin
      if Win = Null_Window then
         raise Panel_Exception;
      end if;
      return Win;
   end Get_Window;

   procedure Replace (Pan : Panel;
                      Win : Window)
   is
      function Replace_Pan (Pan : Panel;
                            Win : Window) return C_Int;
      pragma Import (C, Replace_Pan, "replace_panel");
   begin
      if Replace_Pan (Pan, Win) = Curses_Err then
         raise Panel_Exception;
      end if;
   end Replace;

   procedure Move (Pan    : Panel;
                   Line   : Line_Position;
                   Column : Column_Position)
   is
      function Move (Pan    : Panel;
                     Line   : C_Int;
                     Column : C_Int) return C_Int;
      pragma Import (C, Move, "move_panel");
   begin
      if Move (Pan, C_Int (Line), C_Int (Column)) = Curses_Err then
         raise Panel_Exception;
      end if;
   end Move;

   function Is_Hidden (Pan : Panel) return Boolean
   is
      function Panel_Hidden (Pan : Panel) return C_Int;
      pragma Import (C, Panel_Hidden, "panel_hidden");
   begin
      if Panel_Hidden (Pan) = Curses_False then
         return False;
      else
         return True;
      end if;
   end Is_Hidden;

   procedure Delete (Pan : in out Panel)
   is
      function Del_Panel (Pan : Panel) return C_Int;
      pragma Import (C, Del_Panel, "del_panel");
   begin
      if Del_Panel (Pan) = Curses_Err then
         raise Panel_Exception;
      end if;
      Pan := Null_Panel;
   end Delete;

end Terminal_Interface.Curses.Panels;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_user_data__adb.htm0000644000175100001440000002537012340214310026714 0ustar tomusers terminal_interface-curses-forms-field_user_data.adb

File : terminal_interface-curses-forms-field_user_data.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Forms.Field_User_Data            --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2014 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, 1996
--  Version Control:
--  @Revision: 1.15 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use  Terminal_Interface.Curses.Aux;

--  |
--  |=====================================================================
--  | man page form_field_userptr.3x
--  |=====================================================================
--  |
package body Terminal_Interface.Curses.Forms.Field_User_Data is
   --  |
   --  |
   --  |
   use type Interfaces.C.int;

   procedure Set_User_Data (Fld  : Field;
                            Data : User_Access)
   is
      function Set_Field_Userptr (Fld : Field;
                                  Usr : User_Access) return Eti_Error;
      pragma Import (C, Set_Field_Userptr, "set_field_userptr");

   begin
      Eti_Exception (Set_Field_Userptr (Fld, Data));
   end Set_User_Data;
   --  |
   --  |
   --  |
   function Get_User_Data (Fld  : Field) return User_Access
   is
      function Field_Userptr (Fld : Field) return User_Access;
      pragma Import (C, Field_Userptr, "field_userptr");
   begin
      return Field_Userptr (Fld);
   end Get_User_Data;

   procedure Get_User_Data (Fld  : Field;
                            Data : out User_Access)
   is
   begin
      Data := Get_User_Data (Fld);
   end Get_User_Data;

end Terminal_Interface.Curses.Forms.Field_User_Data;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-aux__ads.htm0000644000175100001440000001625012340214310024742 0ustar tomusers terminal_interface-curses-text_io-aux.ads

File : terminal_interface-curses-text_io-aux.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                   Terminal_Interface.Curses.Text_IO.Aux                  --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2009 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, 1996
--  Version Control:
--  @Revision: 1.14 @
--  @Date: 2009/12/26 17:38:58 @
--  Binding Version 01.00
------------------------------------------------------------------------------
private package Terminal_Interface.Curses.Text_IO.Aux is
   --  pragma Preelaborate (Aux);

   --  This routine is called from the Text_IO output routines for numeric
   --  and enumeration types.
   --
   procedure Put_Buf
     (Win    : Window;               -- The output window
      Buf    : String;               -- The buffer containing the text
      Width  : Field;                -- The width of the output field
      Signal : Boolean := True;      -- If true, we raise Layout_Error
      Ljust  : Boolean := False);    -- The Buf is left justified

end Terminal_Interface.Curses.Text_IO.Aux;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm0000644000175100001440000001642112340214310027723 0ustar tomusers terminal_interface-curses-forms-field_types-intfield.ads

File : terminal_interface-curses-forms-field_types-intfield.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--            Terminal_Interface.Curses.Forms.Field_Types.IntField          --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.IntField is
   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.IntField);

   type Integer_Field is new Field_Type with
      record
         Precision   : Natural;
         Lower_Limit : Integer;
         Upper_Limit : Integer;
      end record;

   procedure Set_Field_Type (Fld : Field;
                             Typ : Integer_Field);
   pragma Inline (Set_Field_Type);

end Terminal_Interface.Curses.Forms.Field_Types.IntField;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm0000644000175100001440000001647012340214310027423 0ustar tomusers terminal_interface-curses-forms-field_types-regexp.ads

File : terminal_interface-curses-forms-field_types-regexp.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--              Terminal_Interface.Curses.Forms.Field_Types.RegExp          --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.RegExp is
   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.RegExp);

   type String_Access is access String;

   type Regular_Expression_Field is new Field_Type with
      record
         Regular_Expression : String_Access;
      end record;

   procedure Set_Field_Type (Fld : Field;
                             Typ : Regular_Expression_Field);
   pragma Inline (Set_Field_Type);

end Terminal_Interface.Curses.Forms.Field_Types.RegExp;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-integer_io__ads.htm0000644000175100001440000002033412340214310026267 0ustar tomusers terminal_interface-curses-text_io-integer_io.ads

File : terminal_interface-curses-text_io-integer_io.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Text_IO.Integer_IO               --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
generic
   type Num is range <>;

package Terminal_Interface.Curses.Text_IO.Integer_IO is

   Default_Width : Field := Num'Width;
   Default_Base  : Number_Base := 10;

   procedure Put
     (Win   : Window;
      Item  : Num;
      Width : Field := Default_Width;
      Base  : Number_Base := Default_Base);

   procedure Put
     (Item  : Num;
      Width : Field := Default_Width;
      Base  : Number_Base := Default_Base);

private
   pragma Inline (Put);

end Terminal_Interface.Curses.Text_IO.Integer_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-panels-user_data__adb.htm0000644000175100001440000002511712340214310025704 0ustar tomusers terminal_interface-curses-panels-user_data.adb

File : terminal_interface-curses-panels-user_data.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                 Terminal_Interface.Curses.Panels.User_Data               --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
with Terminal_Interface.Curses.Aux;
use  Terminal_Interface.Curses.Aux;
with Terminal_Interface.Curses.Panels;
use  Terminal_Interface.Curses.Panels;

package body Terminal_Interface.Curses.Panels.User_Data is

   use type Interfaces.C.int;

   procedure Set_User_Data (Pan  : Panel;
                            Data : User_Access)
   is
      function Set_Panel_Userptr (Pan  : Panel;
                                  Addr : User_Access) return C_Int;
      pragma Import (C, Set_Panel_Userptr, "set_panel_userptr");
   begin
      if Set_Panel_Userptr (Pan, Data) = Curses_Err then
         raise Panel_Exception;
      end if;
   end Set_User_Data;

   function Get_User_Data (Pan  : Panel) return User_Access
   is
      function Panel_Userptr (Pan : Panel) return User_Access;
      pragma Import (C, Panel_Userptr, "panel_userptr");
   begin
      return Panel_Userptr (Pan);
   end Get_User_Data;

   procedure Get_User_Data (Pan  : Panel;
                            Data : out User_Access)
   is
   begin
      Data := Get_User_Data (Pan);
   end Get_User_Data;

end Terminal_Interface.Curses.Panels.User_Data;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms__ads.htm0000644000175100001440000032452212340214310023626 0ustar tomusers terminal_interface-curses-forms.ads

File : terminal_interface-curses-forms.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                      Terminal_Interface.Curses.Form                      --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2014 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, 1996
--  Version Control:
--  @Revision: 1.33 @
--  @Date: 2014/05/24 21:31:57 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with System;
with Ada.Characters.Latin_1;

package Terminal_Interface.Curses.Forms is
   pragma Preelaborate (Terminal_Interface.Curses.Forms);
   pragma Linker_Options ("-lform" & Curses_Constants.DFT_ARG_SUFFIX);

   Space : Character renames Ada.Characters.Latin_1.Space;

   type Field        is private;
   type Form         is private;

   Null_Field        : constant Field;
   Null_Form         : constant Form;

   type Field_Justification is (None,
                                Left,
                                Center,
                                Right);

   type Field_Option_Set is
      record
         Visible   : Boolean;
         Active    : Boolean;
         Public    : Boolean;
         Edit      : Boolean;
         Wrap      : Boolean;
         Blank     : Boolean;
         Auto_Skip : Boolean;
         Null_Ok   : Boolean;
         Pass_Ok   : Boolean;
         Static    : Boolean;
      end record;
   pragma Convention (C_Pass_By_Copy, Field_Option_Set);

   for Field_Option_Set use
      record
         Visible   at 0 range Curses_Constants.O_VISIBLE_First
           .. Curses_Constants.O_VISIBLE_Last;
         Active    at 0 range Curses_Constants.O_ACTIVE_First
           .. Curses_Constants.O_ACTIVE_Last;
         Public    at 0 range Curses_Constants.O_PUBLIC_First
           .. Curses_Constants.O_PUBLIC_Last;
         Edit      at 0 range Curses_Constants.O_EDIT_First
           .. Curses_Constants.O_EDIT_Last;
         Wrap      at 0 range Curses_Constants.O_WRAP_First
           .. Curses_Constants.O_WRAP_Last;
         Blank     at 0 range Curses_Constants.O_BLANK_First
           .. Curses_Constants.O_BLANK_Last;
         Auto_Skip at 0 range Curses_Constants.O_AUTOSKIP_First
           .. Curses_Constants.O_AUTOSKIP_Last;
         Null_Ok   at 0 range Curses_Constants.O_NULLOK_First
           .. Curses_Constants.O_NULLOK_Last;
         Pass_Ok   at 0 range Curses_Constants.O_PASSOK_First
           .. Curses_Constants.O_PASSOK_Last;
         Static    at 0 range Curses_Constants.O_STATIC_First
           .. Curses_Constants.O_STATIC_Last;
      end record;
   pragma Warnings (Off);
   for Field_Option_Set'Size use Curses_Constants.Field_Options_Size;
   pragma Warnings (On);

   function Default_Field_Options return Field_Option_Set;
   --  The initial defaults for the field options.
   pragma Inline (Default_Field_Options);

   type Form_Option_Set is
      record
         NL_Overload : Boolean;
         BS_Overload : Boolean;
      end record;
   pragma Convention (C_Pass_By_Copy, Form_Option_Set);

   for Form_Option_Set use
      record
         NL_Overload at 0 range Curses_Constants.O_NL_OVERLOAD_First
           .. Curses_Constants.O_NL_OVERLOAD_Last;
         BS_Overload at 0 range Curses_Constants.O_BS_OVERLOAD_First
           .. Curses_Constants.O_BS_OVERLOAD_Last;
      end record;
   pragma Warnings (Off);
   for Form_Option_Set'Size use Curses_Constants.Field_Options_Size;
   pragma Warnings (On);

   function Default_Form_Options return Form_Option_Set;
   --  The initial defaults for the form options.
   pragma Inline (Default_Form_Options);

   type Buffer_Number is new Natural;

   type Field_Array is array (Positive range <>) of aliased Field;
   pragma Convention (C, Field_Array);

   type Field_Array_Access is access Field_Array;

   procedure Free (FA          : in out Field_Array_Access;
                   Free_Fields : Boolean := False);
   --  Release the memory for an allocated field array
   --  If Free_Fields is True, call Delete() for all the fields in
   --  the array.

   subtype Form_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 57);

   --  The prefix F_ stands for "Form Request"
   F_Next_Page                : constant Form_Request_Code := Key_Max + 1;
   F_Previous_Page            : constant Form_Request_Code := Key_Max + 2;
   F_First_Page               : constant Form_Request_Code := Key_Max + 3;
   F_Last_Page                : constant Form_Request_Code := Key_Max + 4;

   F_Next_Field               : constant Form_Request_Code := Key_Max + 5;
   F_Previous_Field           : constant Form_Request_Code := Key_Max + 6;
   F_First_Field              : constant Form_Request_Code := Key_Max + 7;
   F_Last_Field               : constant Form_Request_Code := Key_Max + 8;
   F_Sorted_Next_Field        : constant Form_Request_Code := Key_Max + 9;
   F_Sorted_Previous_Field    : constant Form_Request_Code := Key_Max + 10;
   F_Sorted_First_Field       : constant Form_Request_Code := Key_Max + 11;
   F_Sorted_Last_Field        : constant Form_Request_Code := Key_Max + 12;
   F_Left_Field               : constant Form_Request_Code := Key_Max + 13;
   F_Right_Field              : constant Form_Request_Code := Key_Max + 14;
   F_Up_Field                 : constant Form_Request_Code := Key_Max + 15;
   F_Down_Field               : constant Form_Request_Code := Key_Max + 16;

   F_Next_Char                : constant Form_Request_Code := Key_Max + 17;
   F_Previous_Char            : constant Form_Request_Code := Key_Max + 18;
   F_Next_Line                : constant Form_Request_Code := Key_Max + 19;
   F_Previous_Line            : constant Form_Request_Code := Key_Max + 20;
   F_Next_Word                : constant Form_Request_Code := Key_Max + 21;
   F_Previous_Word            : constant Form_Request_Code := Key_Max + 22;
   F_Begin_Field              : constant Form_Request_Code := Key_Max + 23;
   F_End_Field                : constant Form_Request_Code := Key_Max + 24;
   F_Begin_Line               : constant Form_Request_Code := Key_Max + 25;
   F_End_Line                 : constant Form_Request_Code := Key_Max + 26;
   F_Left_Char                : constant Form_Request_Code := Key_Max + 27;
   F_Right_Char               : constant Form_Request_Code := Key_Max + 28;
   F_Up_Char                  : constant Form_Request_Code := Key_Max + 29;
   F_Down_Char                : constant Form_Request_Code := Key_Max + 30;

   F_New_Line                 : constant Form_Request_Code := Key_Max + 31;
   F_Insert_Char              : constant Form_Request_Code := Key_Max + 32;
   F_Insert_Line              : constant Form_Request_Code := Key_Max + 33;
   F_Delete_Char              : constant Form_Request_Code := Key_Max + 34;
   F_Delete_Previous          : constant Form_Request_Code := Key_Max + 35;
   F_Delete_Line              : constant Form_Request_Code := Key_Max + 36;
   F_Delete_Word              : constant Form_Request_Code := Key_Max + 37;
   F_Clear_EOL                : constant Form_Request_Code := Key_Max + 38;
   F_Clear_EOF                : constant Form_Request_Code := Key_Max + 39;
   F_Clear_Field              : constant Form_Request_Code := Key_Max + 40;
   F_Overlay_Mode             : constant Form_Request_Code := Key_Max + 41;
   F_Insert_Mode              : constant Form_Request_Code := Key_Max + 42;

   --  Vertical Scrolling
   F_ScrollForward_Line       : constant Form_Request_Code := Key_Max + 43;
   F_ScrollBackward_Line      : constant Form_Request_Code := Key_Max + 44;
   F_ScrollForward_Page       : constant Form_Request_Code := Key_Max + 45;
   F_ScrollBackward_Page      : constant Form_Request_Code := Key_Max + 46;
   F_ScrollForward_HalfPage   : constant Form_Request_Code := Key_Max + 47;
   F_ScrollBackward_HalfPage  : constant Form_Request_Code := Key_Max + 48;

   --  Horizontal Scrolling
   F_HScrollForward_Char      : constant Form_Request_Code := Key_Max + 49;
   F_HScrollBackward_Char     : constant Form_Request_Code := Key_Max + 50;
   F_HScrollForward_Line      : constant Form_Request_Code := Key_Max + 51;
   F_HScrollBackward_Line     : constant Form_Request_Code := Key_Max + 52;
   F_HScrollForward_HalfLine  : constant Form_Request_Code := Key_Max + 53;
   F_HScrollBackward_HalfLine : constant Form_Request_Code := Key_Max + 54;

   F_Validate_Field           : constant Form_Request_Code := Key_Max + 55;
   F_Next_Choice              : constant Form_Request_Code := Key_Max + 56;
   F_Previous_Choice          : constant Form_Request_Code := Key_Max + 57;

   --  For those who like the old 'C' style request names
   REQ_NEXT_PAGE    : Form_Request_Code renames F_Next_Page;
   REQ_PREV_PAGE    : Form_Request_Code renames F_Previous_Page;
   REQ_FIRST_PAGE   : Form_Request_Code renames F_First_Page;
   REQ_LAST_PAGE    : Form_Request_Code renames F_Last_Page;

   REQ_NEXT_FIELD   : Form_Request_Code renames F_Next_Field;
   REQ_PREV_FIELD   : Form_Request_Code renames F_Previous_Field;
   REQ_FIRST_FIELD  : Form_Request_Code renames F_First_Field;
   REQ_LAST_FIELD   : Form_Request_Code renames F_Last_Field;
   REQ_SNEXT_FIELD  : Form_Request_Code renames F_Sorted_Next_Field;
   REQ_SPREV_FIELD  : Form_Request_Code renames F_Sorted_Previous_Field;
   REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field;
   REQ_SLAST_FIELD  : Form_Request_Code renames F_Sorted_Last_Field;
   REQ_LEFT_FIELD   : Form_Request_Code renames F_Left_Field;
   REQ_RIGHT_FIELD  : Form_Request_Code renames F_Right_Field;
   REQ_UP_FIELD     : Form_Request_Code renames F_Up_Field;
   REQ_DOWN_FIELD   : Form_Request_Code renames F_Down_Field;

   REQ_NEXT_CHAR    : Form_Request_Code renames F_Next_Char;
   REQ_PREV_CHAR    : Form_Request_Code renames F_Previous_Char;
   REQ_NEXT_LINE    : Form_Request_Code renames F_Next_Line;
   REQ_PREV_LINE    : Form_Request_Code renames F_Previous_Line;
   REQ_NEXT_WORD    : Form_Request_Code renames F_Next_Word;
   REQ_PREV_WORD    : Form_Request_Code renames F_Previous_Word;
   REQ_BEG_FIELD    : Form_Request_Code renames F_Begin_Field;
   REQ_END_FIELD    : Form_Request_Code renames F_End_Field;
   REQ_BEG_LINE     : Form_Request_Code renames F_Begin_Line;
   REQ_END_LINE     : Form_Request_Code renames F_End_Line;
   REQ_LEFT_CHAR    : Form_Request_Code renames F_Left_Char;
   REQ_RIGHT_CHAR   : Form_Request_Code renames F_Right_Char;
   REQ_UP_CHAR      : Form_Request_Code renames F_Up_Char;
   REQ_DOWN_CHAR    : Form_Request_Code renames F_Down_Char;

   REQ_NEW_LINE     : Form_Request_Code renames F_New_Line;
   REQ_INS_CHAR     : Form_Request_Code renames F_Insert_Char;
   REQ_INS_LINE     : Form_Request_Code renames F_Insert_Line;
   REQ_DEL_CHAR     : Form_Request_Code renames F_Delete_Char;
   REQ_DEL_PREV     : Form_Request_Code renames F_Delete_Previous;
   REQ_DEL_LINE     : Form_Request_Code renames F_Delete_Line;
   REQ_DEL_WORD     : Form_Request_Code renames F_Delete_Word;
   REQ_CLR_EOL      : Form_Request_Code renames F_Clear_EOL;
   REQ_CLR_EOF      : Form_Request_Code renames F_Clear_EOF;
   REQ_CLR_FIELD    : Form_Request_Code renames F_Clear_Field;
   REQ_OVL_MODE     : Form_Request_Code renames F_Overlay_Mode;
   REQ_INS_MODE     : Form_Request_Code renames F_Insert_Mode;

   REQ_SCR_FLINE    : Form_Request_Code renames F_ScrollForward_Line;
   REQ_SCR_BLINE    : Form_Request_Code renames F_ScrollBackward_Line;
   REQ_SCR_FPAGE    : Form_Request_Code renames F_ScrollForward_Page;
   REQ_SCR_BPAGE    : Form_Request_Code renames F_ScrollBackward_Page;
   REQ_SCR_FHPAGE   : Form_Request_Code renames F_ScrollForward_HalfPage;
   REQ_SCR_BHPAGE   : Form_Request_Code renames F_ScrollBackward_HalfPage;

   REQ_SCR_FCHAR    : Form_Request_Code renames F_HScrollForward_Char;
   REQ_SCR_BCHAR    : Form_Request_Code renames F_HScrollBackward_Char;
   REQ_SCR_HFLINE   : Form_Request_Code renames F_HScrollForward_Line;
   REQ_SCR_HBLINE   : Form_Request_Code renames F_HScrollBackward_Line;
   REQ_SCR_HFHALF   : Form_Request_Code renames F_HScrollForward_HalfLine;
   REQ_SCR_HBHALF   : Form_Request_Code renames F_HScrollBackward_HalfLine;

   REQ_VALIDATION   : Form_Request_Code renames F_Validate_Field;
   REQ_NEXT_CHOICE  : Form_Request_Code renames F_Next_Choice;
   REQ_PREV_CHOICE  : Form_Request_Code renames F_Previous_Choice;

   procedure Request_Name (Key  : Form_Request_Code;
                           Name : out String);

   function  Request_Name (Key : Form_Request_Code) return String;
   --  Same as function
   pragma Inline (Request_Name);

   ------------------
   --  Exceptions  --
   ------------------
   Form_Exception : exception;

   --  |=====================================================================
   --  | Man page form_field_new.3x
   --  |=====================================================================

   --  #1A NAME="AFU_1"#2|
   function Create (Height       : Line_Count;
                    Width        : Column_Count;
                    Top          : Line_Position;
                    Left         : Column_Position;
                    Off_Screen   : Natural := 0;
                    More_Buffers : Buffer_Number := Buffer_Number'First)
                    return Field;
   --  AKA: new_field()
   --  An overloaded Create is defined later. Pragma Inline appears there.

   --  #1A NAME="AFU_2"#2|
   function New_Field (Height       : Line_Count;
                       Width        : Column_Count;
                       Top          : Line_Position;
                       Left         : Column_Position;
                       Off_Screen   : Natural := 0;
                       More_Buffers : Buffer_Number := Buffer_Number'First)
                       return Field renames Create;
   --  AKA: new_field()
   pragma Inline (New_Field);

   --  #1A NAME="AFU_3"#2|
   procedure Delete (Fld : in out Field);
   --  AKA: free_field()
   --  Reset Fld to Null_Field
   --  An overloaded Delete is defined later. Pragma Inline appears there.

   --  #1A NAME="AFU_4"#2|
   function Duplicate (Fld  : Field;
                       Top  : Line_Position;
                       Left : Column_Position) return Field;
   --  AKA: dup_field()
   pragma Inline (Duplicate);

   --  #1A NAME="AFU_5"#2|
   function Link (Fld  : Field;
                  Top  : Line_Position;
                  Left : Column_Position) return Field;
   --  AKA: link_field()
   pragma Inline (Link);

   --  |=====================================================================
   --  | Man page form_field_just.3x
   --  |=====================================================================

   --  #1A NAME="AFU_6"#2|
   procedure Set_Justification (Fld  : Field;
                                Just : Field_Justification := None);
   --  AKA: set_field_just()
   pragma Inline (Set_Justification);

   --  #1A NAME="AFU_7"#2|
   function Get_Justification (Fld : Field) return Field_Justification;
   --  AKA: field_just()
   pragma Inline (Get_Justification);

   --  |=====================================================================
   --  | Man page form_field_buffer.3x
   --  |=====================================================================

   --  #1A NAME="AFU_8"#2|
   procedure Set_Buffer
     (Fld    : Field;
      Buffer : Buffer_Number := Buffer_Number'First;
      Str    : String);
   --  AKA: set_field_buffer()
   --  Not inlined

   --  #1A NAME="AFU_9"#2|
   procedure Get_Buffer
     (Fld    : Field;
      Buffer : Buffer_Number := Buffer_Number'First;
      Str    : out String);
   --  AKA: field_buffer()

   function Get_Buffer
     (Fld    : Field;
      Buffer : Buffer_Number := Buffer_Number'First) return String;
   --  AKA: field_buffer()
   --  Same but as function
   pragma Inline (Get_Buffer);

   --  #1A NAME="AFU_10"#2|
   procedure Set_Status (Fld    : Field;
                         Status : Boolean := True);
   --  AKA: set_field_status()
   pragma Inline (Set_Status);

   --  #1A NAME="AFU_11"#2|
   function Changed (Fld : Field) return Boolean;
   --  AKA: field_status()
   pragma Inline (Changed);

   --  #1A NAME="AFU_12"#2|
   procedure Set_Maximum_Size (Fld : Field;
                               Max : Natural := 0);
   --  AKA: set_field_max()
   pragma Inline (Set_Maximum_Size);

   --  |=====================================================================
   --  | Man page form_field_opts.3x
   --  |=====================================================================

   --  #1A NAME="AFU_13"#2|
   procedure Set_Options (Fld     : Field;
                          Options : Field_Option_Set);
   --  AKA: set_field_opts()
   --  An overloaded version is defined later. Pragma Inline appears there

   --  #1A NAME="AFU_14"#2|
   procedure Switch_Options (Fld     : Field;
                             Options : Field_Option_Set;
                             On      : Boolean := True);
   --  AKA: field_opts_on()
   --  AKA: field_opts_off()
   --  An overloaded version is defined later. Pragma Inline appears there

   --  #1A NAME="AFU_15"#2|
   procedure Get_Options (Fld     : Field;
                          Options : out Field_Option_Set);
   --  AKA: field_opts()

   --  #1A NAME="AFU_16"#2|
   function Get_Options (Fld : Field := Null_Field)
                         return Field_Option_Set;
   --  AKA: field_opts()
   --  An overloaded version is defined later. Pragma Inline appears there

   --  |=====================================================================
   --  | Man page form_field_attributes.3x
   --  |=====================================================================

   --  #1A NAME="AFU_17"#2|
   procedure Set_Foreground
     (Fld   : Field;
      Fore  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First);
   --  AKA: set_field_fore()
   pragma Inline (Set_Foreground);

   --  #1A NAME="AFU_18"#2|
   procedure Foreground (Fld  : Field;
                         Fore : out Character_Attribute_Set);
   --  AKA: field_fore()

   --  #1A NAME="AFU_19"#2|
   procedure Foreground (Fld   : Field;
                         Fore  : out Character_Attribute_Set;
                         Color : out Color_Pair);
   --  AKA: field_fore()
   pragma Inline (Foreground);

   --  #1A NAME="AFU_20"#2|
   procedure Set_Background
     (Fld   : Field;
      Back  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First);
   --  AKA: set_field_back()
   pragma Inline (Set_Background);

   --  #1A NAME="AFU_21"#2|
   procedure Background (Fld  : Field;
                         Back : out Character_Attribute_Set);
   --  AKA: field_back()

   --  #1A NAME="AFU_22"#2|
   procedure Background (Fld   : Field;
                         Back  : out Character_Attribute_Set;
                         Color : out Color_Pair);
   --  AKA: field_back()
   pragma Inline (Background);

   --  #1A NAME="AFU_23"#2|
   procedure Set_Pad_Character (Fld : Field;
                                Pad : Character := Space);
   --  AKA: set_field_pad()
   pragma Inline (Set_Pad_Character);

   --  #1A NAME="AFU_24"#2|
   procedure Pad_Character (Fld : Field;
                            Pad : out Character);
   --  AKA: field_pad()
   pragma Inline (Pad_Character);

   --  |=====================================================================
   --  | Man page form_field_info.3x
   --  |=====================================================================

   --  #1A NAME="AFU_25"#2|
   procedure Info (Fld                : Field;
                   Lines              : out Line_Count;
                   Columns            : out Column_Count;
                   First_Row          : out Line_Position;
                   First_Column       : out Column_Position;
                   Off_Screen         : out Natural;
                   Additional_Buffers : out Buffer_Number);
   --  AKA: field_info()
   pragma Inline (Info);

   --  #1A NAME="AFU_26"#2|
   procedure Dynamic_Info (Fld     : Field;
                           Lines   : out Line_Count;
                           Columns : out Column_Count;
                           Max     : out Natural);
   --  AKA: dynamic_field_info()
   pragma Inline (Dynamic_Info);

   --  |=====================================================================
   --  | Man page form_win.3x
   --  |=====================================================================

   --  #1A NAME="AFU_27"#2|
   procedure Set_Window (Frm : Form;
                         Win : Window);
   --  AKA: set_form_win()
   pragma Inline (Set_Window);

   --  #1A NAME="AFU_28"#2|
   function Get_Window (Frm : Form) return Window;
   --  AKA: form_win()
   pragma Inline (Get_Window);

   --  #1A NAME="AFU_29"#2|
   procedure Set_Sub_Window (Frm : Form;
                             Win : Window);
   --  AKA: set_form_sub()
   pragma Inline (Set_Sub_Window);

   --  #1A NAME="AFU_30"#2|
   function Get_Sub_Window (Frm : Form) return Window;
   --  AKA: form_sub()
   pragma Inline (Get_Sub_Window);

   --  #1A NAME="AFU_31"#2|
   procedure Scale (Frm     : Form;
                    Lines   : out Line_Count;
                    Columns : out Column_Count);
   --  AKA: scale_form()
   pragma Inline (Scale);

   --  |=====================================================================
   --  | Man page form_hook.3x
   --  |=====================================================================

   type Form_Hook_Function is access procedure (Frm : Form);
   pragma Convention (C, Form_Hook_Function);

   --  #1A NAME="AFU_32"#2|
   procedure Set_Field_Init_Hook (Frm  : Form;
                                  Proc : Form_Hook_Function);
   --  AKA: set_field_init()
   pragma Inline (Set_Field_Init_Hook);

   --  #1A NAME="AFU_33"#2|
   procedure Set_Field_Term_Hook (Frm  : Form;
                                  Proc : Form_Hook_Function);
   --  AKA: set_field_term()
   pragma Inline (Set_Field_Term_Hook);

   --  #1A NAME="AFU_34"#2|
   procedure Set_Form_Init_Hook (Frm  : Form;
                                 Proc : Form_Hook_Function);
   --  AKA: set_form_init()
   pragma Inline (Set_Form_Init_Hook);

   --  #1A NAME="AFU_35"#2|
   procedure Set_Form_Term_Hook (Frm  : Form;
                                 Proc : Form_Hook_Function);
   --  AKA: set_form_term()
   pragma Inline (Set_Form_Term_Hook);

   --  #1A NAME="AFU_36"#2|
   function Get_Field_Init_Hook (Frm : Form) return Form_Hook_Function;
   --  AKA: field_init()
   pragma Import (C, Get_Field_Init_Hook, "field_init");

   --  #1A NAME="AFU_37"#2|
   function Get_Field_Term_Hook (Frm : Form) return Form_Hook_Function;
   --  AKA: field_term()
   pragma Import (C, Get_Field_Term_Hook, "field_term");

   --  #1A NAME="AFU_38"#2|
   function Get_Form_Init_Hook (Frm : Form) return Form_Hook_Function;
   --  AKA: form_init()
   pragma Import (C, Get_Form_Init_Hook, "form_init");

   --  #1A NAME="AFU_39"#2|
   function Get_Form_Term_Hook (Frm : Form) return Form_Hook_Function;
   --  AKA: form_term()
   pragma Import (C, Get_Form_Term_Hook, "form_term");

   --  |=====================================================================
   --  | Man page form_field.3x
   --  |=====================================================================

   --  #1A NAME="AFU_40"#2|
   procedure Redefine (Frm  : Form;
                       Flds : Field_Array_Access);
   --  AKA: set_form_fields()
   pragma Inline (Redefine);

   --  #1A NAME="AFU_41"#2|
   procedure Set_Fields (Frm  : Form;
                         Flds : Field_Array_Access) renames Redefine;
   --  AKA: set_form_fields()
   --  pragma Inline (Set_Fields);

   --  #1A NAME="AFU_42"#2|
   function Fields (Frm   : Form;
                    Index : Positive) return Field;
   --  AKA: form_fields()
   pragma Inline (Fields);

   --  #1A NAME="AFU_43"#2|
   function Field_Count (Frm : Form) return Natural;
   --  AKA: field_count()
   pragma Inline (Field_Count);

   --  #1A NAME="AFU_44"#2|
   procedure Move (Fld    : Field;
                   Line   : Line_Position;
                   Column : Column_Position);
   --  AKA: move_field()
   pragma Inline (Move);

   --  |=====================================================================
   --  | Man page form_new.3x
   --  |=====================================================================

   --  #1A NAME="AFU_45"#2|
   function Create (Fields : Field_Array_Access) return Form;
   --  AKA: new_form()
   pragma Inline (Create);

   --  #1A NAME="AFU_46"#2|
   function New_Form (Fields : Field_Array_Access) return Form
     renames Create;
   --  AKA: new_form()
   --  pragma Inline (New_Form);

   --  #1A NAME="AFU_47"#2|
   procedure Delete (Frm : in out Form);
   --  AKA: free_form()
   --  Reset Frm to Null_Form
   pragma Inline (Delete);

   --  |=====================================================================
   --  | Man page form_opts.3x
   --  |=====================================================================

   --  #1A NAME="AFU_48"#2|
   procedure Set_Options (Frm     : Form;
                          Options : Form_Option_Set);
   --  AKA: set_form_opts()
   pragma Inline (Set_Options);

   --  #1A NAME="AFU_49"#2|
   procedure Switch_Options (Frm     : Form;
                             Options : Form_Option_Set;
                             On      : Boolean := True);
   --  AKA: form_opts_on()
   --  AKA: form_opts_off()
   pragma Inline (Switch_Options);

   --  #1A NAME="AFU_50"#2|
   procedure Get_Options (Frm     : Form;
                          Options : out Form_Option_Set);
   --  AKA: form_opts()

   --  #1A NAME="AFU_51"#2|
   function Get_Options (Frm : Form := Null_Form) return Form_Option_Set;
   --  AKA: form_opts()
   pragma Inline (Get_Options);

   --  |=====================================================================
   --  | Man page form_post.3x
   --  |=====================================================================

   --  #1A NAME="AFU_52"#2|
   procedure Post (Frm  : Form;
                   Post : Boolean := True);
   --  AKA: post_form()
   --  AKA: unpost_form()
   pragma Inline (Post);

   --  |=====================================================================
   --  | Man page form_cursor.3x
   --  |=====================================================================

   --  #1A NAME="AFU_53"#2|
   procedure Position_Cursor (Frm : Form);
   --  AKA: pos_form_cursor()
   pragma Inline (Position_Cursor);

   --  |=====================================================================
   --  | Man page form_data.3x
   --  |=====================================================================

   --  #1A NAME="AFU_54"#2|
   function Data_Ahead (Frm : Form) return Boolean;
   --  AKA: data_ahead()
   pragma Inline (Data_Ahead);

   --  #1A NAME="AFU_55"#2|
   function Data_Behind (Frm : Form) return Boolean;
   --  AKA: data_behind()
   pragma Inline (Data_Behind);

   --  |=====================================================================
   --  | Man page form_driver.3x
   --  |=====================================================================

   type Driver_Result is (Form_Ok,
                          Request_Denied,
                          Unknown_Request,
                          Invalid_Field);

   --  #1A NAME="AFU_56"#2|
   function Driver (Frm : Form;
                    Key : Key_Code) return Driver_Result;
   --  AKA: form_driver()
   --  Driver not inlined

   --  |=====================================================================
   --  | Man page form_page.3x
   --  |=====================================================================

   type Page_Number is new Natural;

   --  #1A NAME="AFU_57"#2|
   procedure Set_Current (Frm : Form;
                          Fld : Field);
   --  AKA: set_current_field()
   pragma Inline (Set_Current);

   --  #1A NAME="AFU_58"#2|
   function Current (Frm : Form) return Field;
   --  AKA: current_field()
   pragma Inline (Current);

   --  #1A NAME="AFU_59"#2|
   procedure Set_Page (Frm  : Form;
                       Page : Page_Number := Page_Number'First);
   --  AKA: set_form_page()
   pragma Inline (Set_Page);

   --  #1A NAME="AFU_60"#2|
   function Page (Frm : Form) return Page_Number;
   --  AKA: form_page()
   pragma Inline (Page);

   --  #1A NAME="AFU_61"#2|
   function Get_Index (Fld : Field) return Positive;
   --  AKA: field_index()
   --  Please note that in this binding we start the numbering of fields
   --  with 1. So this is number is one more than you get from the low
   --  level call.
   pragma Inline (Get_Index);

   --  |=====================================================================
   --  | Man page form_new_page.3x
   --  |=====================================================================

   --  #1A NAME="AFU_62"#2|
   procedure Set_New_Page (Fld      : Field;
                           New_Page : Boolean := True);
   --  AKA: set_new_page()
   pragma Inline (Set_New_Page);

   --  #1A NAME="AFU_63"#2|
   function Is_New_Page (Fld : Field) return Boolean;
   --  AKA: new_page()
   pragma Inline (Is_New_Page);

   --  |=====================================================================
   --  | Man page form_requestname.3x
   --  |=====================================================================
   --  Not Implemented: form_request_name, form_request_by_name

------------------------------------------------------------------------------
private
   type Field is new System.Storage_Elements.Integer_Address;
   type Form  is new System.Storage_Elements.Integer_Address;

   Null_Field : constant Field := 0;
   Null_Form  : constant Form  := 0;

end Terminal_Interface.Curses.Forms;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_user_data__ads.htm0000644000175100001440000002211012340214310026722 0ustar tomusers terminal_interface-curses-forms-field_user_data.ads

File : terminal_interface-curses-forms-field_user_data.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Forms.Field_User_Data            --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.16 @
--  Binding Version 01.00
------------------------------------------------------------------------------

generic
   type User is limited private;
   type User_Access is access User;
package Terminal_Interface.Curses.Forms.Field_User_Data is
   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_User_Data);

   --  |=====================================================================
   --  | Man page form_field_userptr.3x
   --  |=====================================================================

   --  #1A NAME="AFU_1"#2|
   procedure Set_User_Data (Fld  : Field;
                            Data : User_Access);
   --  AKA: set_field_userptr
   pragma Inline (Set_User_Data);

   --  #1A NAME="AFU_2"#2|
   procedure Get_User_Data (Fld  : Field;
                            Data : out User_Access);
   --  AKA: field_userptr

   --  #1A NAME="AFU_3"#2|
   function Get_User_Data (Fld  : Field) return User_Access;
   --  AKA: field_userptr
   --  Sama as function
   pragma Inline (Get_User_Data);

end Terminal_Interface.Curses.Forms.Field_User_Data;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm0000644000175100001440000004337412340214310030441 0ustar tomusers terminal_interface-curses-forms-field_types-enumeration.adb

File : terminal_interface-curses-forms-field_types-enumeration.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--          Terminal_Interface.Curses.Forms.Field_Types.Enumeration         --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration is

   function Create (Info               : Enumeration_Info;
                    Auto_Release_Names : Boolean := False)
                    return Enumeration_Field
   is
      procedure Release_String is
        new Ada.Unchecked_Deallocation (String,
                                        String_Access);
      E : Enumeration_Field;
      L : constant size_t := 1 + size_t (Info.C);
      S : String_Access;
   begin
      E.Case_Sensitive       := Info.Case_Sensitive;
      E.Match_Must_Be_Unique := Info.Match_Must_Be_Unique;
      E.Arr := new chars_ptr_array (size_t (1) .. L);
      for I in 1 .. Positive (L - 1) loop
         if Info.Names (I) = null then
            raise Form_Exception;
         end if;
         E.Arr.all (size_t (I)) := New_String (Info.Names (I).all);
         if Auto_Release_Names then
            S := Info.Names (I);
            Release_String (S);
         end if;
      end loop;
      E.Arr.all (L) := Null_Ptr;
      return E;
   end Create;

   procedure Release (Enum : in out Enumeration_Field)
   is
      I : size_t := 0;
      P : chars_ptr;
   begin
      loop
         P := Enum.Arr.all (I);
         exit when P = Null_Ptr;
         Free (P);
         Enum.Arr.all (I) := Null_Ptr;
         I := I + 1;
      end loop;
      Enum.Arr := null;
   end Release;

   procedure Set_Field_Type (Fld : Field;
                             Typ : Enumeration_Field)
   is
      function Set_Fld_Type (F    : Field := Fld;
                             Arg1 : chars_ptr_array;
                             Arg2 : C_Int;
                             Arg3 : C_Int) return Eti_Error;
      pragma Import (C, Set_Fld_Type, "set_field_type_enum");

   begin
      if Typ.Arr = null then
         raise Form_Exception;
      end if;
      Eti_Exception
        (Set_Fld_Type
           (Arg1 => Typ.Arr.all,
            Arg2 => C_Int (Boolean'Pos (Typ.Case_Sensitive)),
            Arg3 => C_Int (Boolean'Pos (Typ.Match_Must_Be_Unique))));
      Wrap_Builtin (Fld, Typ, C_Choice_Router);
   end Set_Field_Type;

end Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types__adb.htm0000644000175100001440000011451012534703456026127 0ustar tomusers terminal_interface-curses-forms-field_types.adb

File : terminal_interface-curses-forms-field_types.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                 Terminal_Interface.Curses.Forms.Field_Types              --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.28 @
--  @Date: 2014/09/13 19:00:47 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Ada.Unchecked_Deallocation;
with System.Address_To_Access_Conversions;

--  |
--  |=====================================================================
--  | man page form_fieldtype.3x
--  |=====================================================================
--  |
package body Terminal_Interface.Curses.Forms.Field_Types is

   use type System.Address;

   package Argument_Conversions is
      new System.Address_To_Access_Conversions (Argument);

   function Get_Fieldtype (F : Field) return C_Field_Type;
   pragma Import (C, Get_Fieldtype, "field_type");

   function Get_Arg (F : Field) return System.Address;
   pragma Import (C, Get_Arg, "field_arg");
   --  |
   --  |=====================================================================
   --  | man page form_field_validation.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   function Get_Type (Fld : Field) return Field_Type_Access
   is
      Low_Level : constant C_Field_Type := Get_Fieldtype (Fld);
      Arg : Argument_Access;
   begin
      if Low_Level = Null_Field_Type then
         return null;
      else
         if Low_Level = M_Builtin_Router or else
            Low_Level = M_Generic_Type or else
            Low_Level = M_Choice_Router or else
            Low_Level = M_Generic_Choice
         then
            Arg := Argument_Access
         (Argument_Conversions.To_Pointer (Get_Arg (Fld)));
            if Arg = null then
               raise Form_Exception;
            else
               return Arg.all.Typ;
            end if;
         else
            raise Form_Exception;
         end if;
      end if;
   end Get_Type;

   function Copy_Arg (Usr : System.Address) return System.Address
   is
   begin
      return Usr;
   end Copy_Arg;

   procedure Free_Arg (Usr : System.Address)
   is
      procedure Free_Type is new Ada.Unchecked_Deallocation
        (Field_Type'Class, Field_Type_Access);
      procedure Freeargs is new Ada.Unchecked_Deallocation
        (Argument, Argument_Access);

      To_Be_Free : Argument_Access
   := Argument_Access (Argument_Conversions.To_Pointer (Usr));
      Low_Level  : C_Field_Type;
   begin
      if To_Be_Free /= null then
         if To_Be_Free.all.Usr /= System.Null_Address then
            Low_Level := To_Be_Free.all.Cft;
            if Low_Level.all.Freearg /= null then
               Low_Level.all.Freearg (To_Be_Free.all.Usr);
            end if;
         end if;
         if To_Be_Free.all.Typ /= null then
            Free_Type (To_Be_Free.all.Typ);
         end if;
         Freeargs (To_Be_Free);
      end if;
   end Free_Arg;

   procedure Wrap_Builtin (Fld : Field;
                           Typ : Field_Type'Class;
                           Cft : C_Field_Type := C_Builtin_Router)
   is
      Usr_Arg   : constant System.Address := Get_Arg (Fld);
      Low_Level : constant C_Field_Type := Get_Fieldtype (Fld);
      Arg : Argument_Access;
      function Set_Fld_Type (F    : Field := Fld;
                             Cf   : C_Field_Type := Cft;
                             Arg1 : Argument_Access) return Eti_Error;
      pragma Import (C, Set_Fld_Type, "set_field_type_user");

   begin
      pragma Assert (Low_Level /= Null_Field_Type);
      if Cft /= C_Builtin_Router and then Cft /= C_Choice_Router then
         raise Form_Exception;
      else
         Arg := new Argument'(Usr => System.Null_Address,
                              Typ => new Field_Type'Class'(Typ),
                              Cft => Get_Fieldtype (Fld));
         if Usr_Arg /= System.Null_Address then
            if Low_Level.all.Copyarg /= null then
               Arg.all.Usr := Low_Level.all.Copyarg (Usr_Arg);
            else
               Arg.all.Usr := Usr_Arg;
            end if;
         end if;

         Eti_Exception (Set_Fld_Type (Arg1 => Arg));
      end if;
   end Wrap_Builtin;

   function Field_Check_Router (Fld : Field;
                                Usr : System.Address) return Curses_Bool
   is
      Arg  : constant Argument_Access
   := Argument_Access (Argument_Conversions.To_Pointer (Usr));
   begin
      pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type
                     and then Arg.all.Typ /= null);
      if Arg.all.Cft.all.Fcheck /= null then
         return Arg.all.Cft.all.Fcheck (Fld, Arg.all.Usr);
      else
         return 1;
      end if;
   end Field_Check_Router;

   function Char_Check_Router (Ch  : C_Int;
                               Usr : System.Address) return Curses_Bool
   is
      Arg  : constant Argument_Access
   := Argument_Access (Argument_Conversions.To_Pointer (Usr));
   begin
      pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type
                     and then Arg.all.Typ /= null);
      if Arg.all.Cft.all.Ccheck /= null then
         return Arg.all.Cft.all.Ccheck (Ch, Arg.all.Usr);
      else
         return 1;
      end if;
   end Char_Check_Router;

   function Next_Router (Fld : Field;
                         Usr : System.Address) return Curses_Bool
   is
      Arg  : constant Argument_Access
   := Argument_Access (Argument_Conversions.To_Pointer (Usr));
   begin
      pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type
                     and then Arg.all.Typ /= null);
      if Arg.all.Cft.all.Next /= null then
         return Arg.all.Cft.all.Next (Fld, Arg.all.Usr);
      else
         return 1;
      end if;
   end Next_Router;

   function Prev_Router (Fld : Field;
                         Usr : System.Address) return Curses_Bool
   is
      Arg  : constant Argument_Access :=
               Argument_Access (Argument_Conversions.To_Pointer (Usr));
   begin
      pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type
                     and then Arg.all.Typ /= null);
      if Arg.all.Cft.all.Prev /= null then
         return Arg.all.Cft.all.Prev (Fld, Arg.all.Usr);
      else
         return 1;
      end if;
   end Prev_Router;

   --  -----------------------------------------------------------------------
   --
   function C_Builtin_Router return C_Field_Type
   is
      T   : C_Field_Type;
   begin
      if M_Builtin_Router = Null_Field_Type then
         T := New_Fieldtype (Field_Check_Router'Access,
                             Char_Check_Router'Access);
         if T = Null_Field_Type then
            raise Form_Exception;
         else
            Eti_Exception (Set_Fieldtype_Arg (T,
                                              Make_Arg'Access,
                                              Copy_Arg'Access,
                                              Free_Arg'Access));
         end if;
         M_Builtin_Router := T;
      end if;
      pragma Assert (M_Builtin_Router /= Null_Field_Type);
      return M_Builtin_Router;
   end C_Builtin_Router;

   --  -----------------------------------------------------------------------
   --
   function C_Choice_Router return C_Field_Type
   is
      T   : C_Field_Type;
   begin
      if M_Choice_Router = Null_Field_Type then
         T := New_Fieldtype (Field_Check_Router'Access,
                             Char_Check_Router'Access);
         if T = Null_Field_Type then
            raise Form_Exception;
         else
            Eti_Exception (Set_Fieldtype_Arg (T,
                                              Make_Arg'Access,
                                              Copy_Arg'Access,
                                              Free_Arg'Access));

            Eti_Exception (Set_Fieldtype_Choice (T,
                                                 Next_Router'Access,
                                                 Prev_Router'Access));
         end if;
         M_Choice_Router := T;
      end if;
      pragma Assert (M_Choice_Router /= Null_Field_Type);
      return M_Choice_Router;
   end C_Choice_Router;

end Terminal_Interface.Curses.Forms.Field_Types;
AdaCurses-20170708/doc/ada/terminal_interface-curses-trace__ads.htm0000644000175100001440000004035012534703456023613 0ustar tomusers terminal_interface-curses-trace.ads

File : terminal_interface-curses-trace.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                      Terminal_Interface.Curses.Trace                     --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 2000,2014 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: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
--  Version Control:
--  @Revision: 1.4 @
--  Binding Version 01.00
------------------------------------------------------------------------------

package Terminal_Interface.Curses.Trace is
   pragma Preelaborate (Terminal_Interface.Curses.Trace);

   type Trace_Attribute_Set is
      record
         Times            : Boolean;
         Tputs            : Boolean;
         Update           : Boolean;
         Cursor_Move      : Boolean;
         Character_Output : Boolean;
         Calls            : Boolean;
         Virtual_Puts     : Boolean;
         Input_Events     : Boolean;
         TTY_State        : Boolean;
         Internal_Calls   : Boolean;
         Character_Calls  : Boolean;
         Termcap_TermInfo : Boolean;
         Attribute_Color  : Boolean;
      end record;
   pragma Convention (C_Pass_By_Copy, Trace_Attribute_Set);

   for Trace_Attribute_Set use
      record
         Times            at 0 range Curses_Constants.TRACE_TIMES_First
           .. Curses_Constants.TRACE_TIMES_Last;
         Tputs            at 0 range Curses_Constants.TRACE_TPUTS_First
           .. Curses_Constants.TRACE_TPUTS_Last;
         Update           at 0 range Curses_Constants.TRACE_UPDATE_First
           .. Curses_Constants.TRACE_UPDATE_Last;
         Cursor_Move      at 0 range Curses_Constants.TRACE_MOVE_First
           .. Curses_Constants.TRACE_MOVE_Last;
         Character_Output at 0 range Curses_Constants.TRACE_CHARPUT_First
           .. Curses_Constants.TRACE_CHARPUT_Last;
         Calls            at 0 range Curses_Constants.TRACE_CALLS_First
           .. Curses_Constants.TRACE_CALLS_Last;
         Virtual_Puts     at 0 range Curses_Constants.TRACE_VIRTPUT_First
           .. Curses_Constants.TRACE_VIRTPUT_Last;
         Input_Events     at 0 range Curses_Constants.TRACE_IEVENT_First
           .. Curses_Constants.TRACE_IEVENT_Last;
         TTY_State        at 0 range Curses_Constants.TRACE_BITS_First
           .. Curses_Constants.TRACE_BITS_Last;
         Internal_Calls   at 0 range Curses_Constants.TRACE_ICALLS_First
           .. Curses_Constants.TRACE_ICALLS_Last;
         Character_Calls  at 0 range Curses_Constants.TRACE_CCALLS_First
           .. Curses_Constants.TRACE_CCALLS_Last;
         Termcap_TermInfo at 0 range Curses_Constants.TRACE_DATABASE_First
           .. Curses_Constants.TRACE_DATABASE_Last;
         Attribute_Color  at 0 range Curses_Constants.TRACE_ATTRS_First
           .. Curses_Constants.TRACE_ATTRS_Last;
      end record;
   pragma Warnings (Off);
   for Trace_Attribute_Set'Size use Curses_Constants.Trace_Size;
   pragma Warnings (On);

   Trace_Disable  : constant Trace_Attribute_Set := (others => False);

   Trace_Ordinary : constant Trace_Attribute_Set :=
     (Times            => True,
      Tputs            => True,
      Update           => True,
      Cursor_Move      => True,
      Character_Output => True,
      others           => False);
   Trace_Maximum : constant Trace_Attribute_Set := (others => True);

------------------------------------------------------------------------------

   --  |=====================================================================
   --  | Man page curs_trace.3x
   --  |=====================================================================

   --  #1A NAME="AFU_1"#2|
   procedure Trace_On (x : Trace_Attribute_Set);
   --  The debugging library has trace.

   --  #1A NAME="AFU_2"#2|
   procedure Trace_Put (str : String);
   --  AKA: _tracef()

   Current_Trace_Setting : Trace_Attribute_Set;
   pragma Import (C, Current_Trace_Setting, "_nc_tracing");

end Terminal_Interface.Curses.Trace;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-aux__adb.htm0000644000175100001440000004060512340214310024722 0ustar tomusers terminal_interface-curses-text_io-aux.adb

File : terminal_interface-curses-text_io-aux.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                   Terminal_Interface.Curses.Text_IO.Aux                  --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2009 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, 1996
--  Version Control:
--  @Revision: 1.13 @
--  @Date: 2009/12/26 17:38:58 @
--  Binding Version 01.00
------------------------------------------------------------------------------
package body Terminal_Interface.Curses.Text_IO.Aux is

   procedure Put_Buf
     (Win    : Window;
      Buf    : String;
      Width  : Field;
      Signal : Boolean := True;
      Ljust  : Boolean := False)
   is
      L   : Field;
      Len : Field;
      W   : Field := Width;
      LC  : Line_Count;
      CC  : Column_Count;
      Y   : Line_Position;
      X   : Column_Position;

      procedure Output (From, To : Field);

      procedure Output (From, To : Field)
      is
      begin
         if Len > 0 then
            if W = 0 then
               W := Len;
            end if;
            if Len > W then
               --  LRM A10.6 (7) says this
               W := Len;
            end if;

            pragma Assert (Len <= W);
            Get_Size (Win, LC, CC);
            if Column_Count (Len) > CC then
               if Signal then
                  raise Layout_Error;
               else
                  return;
               end if;
            else
               if Len < W and then not Ljust then
                  declare
                     Filler : constant String (1 .. (W - Len))
                       := (others => ' ');
                  begin
                     Put (Win, Filler);
                  end;
               end if;
               Get_Cursor_Position (Win, Y, X);
               if (X + Column_Position (Len)) > CC then
                  New_Line (Win);
               end if;
               Put (Win, Buf (From .. To));
               if Len < W and then Ljust then
                  declare
                     Filler : constant String (1 .. (W - Len))
                       := (others => ' ');
                  begin
                     Put (Win, Filler);
                  end;
               end if;
            end if;
         end if;
      end Output;

   begin
      pragma Assert (Win /= Null_Window);
      if Ljust then
         L := 1;
         for I in 1 .. Buf'Length loop
            exit when Buf (L) = ' ';
            L := L + 1;
         end loop;
         Len := L - 1;
         Output (1, Len);
      else  -- input buffer is not left justified
         L := Buf'Length;
         for I in 1 .. Buf'Length loop
            exit when Buf (L) = ' ';
            L := L - 1;
         end loop;
         Len := Buf'Length - L;
         Output (L + 1, Buf'Length);
      end if;
   end Put_Buf;

end Terminal_Interface.Curses.Text_IO.Aux;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-complex_io__ads.htm0000644000175100001440000002133712340214310026305 0ustar tomusers terminal_interface-curses-text_io-complex_io.ads

File : terminal_interface-curses-text_io-complex_io.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Text_IO.Complex_IO               --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.11 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Numerics.Generic_Complex_Types;

generic
   with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (<>);

package Terminal_Interface.Curses.Text_IO.Complex_IO is

   use Complex_Types;

   Default_Fore : Field := 2;
   Default_Aft  : Field := Real'Digits - 1;
   Default_Exp  : Field := 3;

   procedure Put
     (Win  : Window;
      Item : Complex;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp);

   procedure Put
     (Item : Complex;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp);

private
   pragma Inline (Put);

end Terminal_Interface.Curses.Text_IO.Complex_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms__adb.htm0000644000175100001440000041304212340214310023601 0ustar tomusers terminal_interface-curses-forms.adb

File : terminal_interface-curses-forms.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                      Terminal_Interface.Curses.Forms                     --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.32 @
--  @Date: 2014/05/24 21:31:05 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;

with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Interfaces.C.Pointers;

with Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Forms is

   use Terminal_Interface.Curses.Aux;

   type C_Field_Array is array (Natural range <>) of aliased Field;
   package F_Array is new
     Interfaces.C.Pointers (Natural, Field, C_Field_Array, Null_Field);

------------------------------------------------------------------------------
   --  |
   --  |
   --  |
   --  subtype chars_ptr is Interfaces.C.Strings.chars_ptr;

   procedure Request_Name (Key  : Form_Request_Code;
                                Name : out String)
   is
      function Form_Request_Name (Key : C_Int) return chars_ptr;
      pragma Import (C, Form_Request_Name, "form_request_name");
   begin
      Fill_String (Form_Request_Name (C_Int (Key)), Name);
   end Request_Name;

   function Request_Name (Key : Form_Request_Code) return String
   is
      function Form_Request_Name (Key : C_Int) return chars_ptr;
      pragma Import (C, Form_Request_Name, "form_request_name");
   begin
      return Fill_String (Form_Request_Name (C_Int (Key)));
   end Request_Name;
------------------------------------------------------------------------------
   --  |
   --  |
   --  |
   --  |
   --  |=====================================================================
   --  | man page form_field_new.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   function Create (Height       : Line_Count;
                    Width        : Column_Count;
                    Top          : Line_Position;
                    Left         : Column_Position;
                    Off_Screen   : Natural := 0;
                    More_Buffers : Buffer_Number := Buffer_Number'First)
                    return Field
   is
      function Newfield (H, W, T, L, O, M : C_Int) return Field;
      pragma Import (C, Newfield, "new_field");
      Fld : constant Field := Newfield (C_Int (Height), C_Int (Width),
                                        C_Int (Top), C_Int (Left),
                                        C_Int (Off_Screen),
                                        C_Int (More_Buffers));
   begin
      if Fld = Null_Field then
         raise Form_Exception;
      end if;
      return Fld;
   end Create;
--  |
--  |
--  |
   procedure Delete (Fld : in out Field)
   is
      function Free_Field (Fld : Field) return Eti_Error;
      pragma Import (C, Free_Field, "free_field");

   begin
      Eti_Exception (Free_Field (Fld));
      Fld := Null_Field;
   end Delete;
   --  |
   --  |
   --  |
   function Duplicate (Fld  : Field;
                       Top  : Line_Position;
                       Left : Column_Position) return Field
   is
      function Dup_Field (Fld  : Field;
                          Top  : C_Int;
                          Left : C_Int) return Field;
      pragma Import (C, Dup_Field, "dup_field");

      F : constant Field := Dup_Field (Fld,
                                       C_Int (Top),
                                       C_Int (Left));
   begin
      if F = Null_Field then
         raise Form_Exception;
      end if;
      return F;
   end Duplicate;
   --  |
   --  |
   --  |
   function Link (Fld  : Field;
                  Top  : Line_Position;
                  Left : Column_Position) return Field
   is
      function Lnk_Field (Fld  : Field;
                          Top  : C_Int;
                          Left : C_Int) return Field;
      pragma Import (C, Lnk_Field, "link_field");

      F : constant Field := Lnk_Field (Fld,
                                       C_Int (Top),
                                       C_Int (Left));
   begin
      if F = Null_Field then
         raise Form_Exception;
      end if;
      return F;
   end Link;
   --  |
   --  |=====================================================================
   --  | man page form_field_just.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Set_Justification (Fld  : Field;
                                Just : Field_Justification := None)
   is
      function Set_Field_Just (Fld  : Field;
                               Just : C_Int) return Eti_Error;
      pragma Import (C, Set_Field_Just, "set_field_just");

   begin
      Eti_Exception (Set_Field_Just (Fld,
                                     C_Int (Field_Justification'Pos (Just))));
   end Set_Justification;
   --  |
   --  |
   --  |
   function Get_Justification (Fld : Field) return Field_Justification
   is
      function Field_Just (Fld : Field) return C_Int;
      pragma Import (C, Field_Just, "field_just");
   begin
      return Field_Justification'Val (Field_Just (Fld));
   end Get_Justification;
   --  |
   --  |=====================================================================
   --  | man page form_field_buffer.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Set_Buffer
     (Fld    : Field;
      Buffer : Buffer_Number := Buffer_Number'First;
      Str    : String)
   is
      function Set_Fld_Buffer (Fld    : Field;
                                 Bufnum : C_Int;
                                 S      : char_array)
        return Eti_Error;
      pragma Import (C, Set_Fld_Buffer, "set_field_buffer");

   begin
      Eti_Exception (Set_Fld_Buffer (Fld, C_Int (Buffer), To_C (Str)));
   end Set_Buffer;
   --  |
   --  |
   --  |
   procedure Get_Buffer
     (Fld    : Field;
      Buffer : Buffer_Number := Buffer_Number'First;
      Str    : out String)
   is
      function Field_Buffer (Fld : Field;
                             B   : C_Int) return chars_ptr;
      pragma Import (C, Field_Buffer, "field_buffer");
   begin
      Fill_String (Field_Buffer (Fld, C_Int (Buffer)), Str);
   end Get_Buffer;

   function Get_Buffer
     (Fld    : Field;
      Buffer : Buffer_Number := Buffer_Number'First) return String
   is
      function Field_Buffer (Fld : Field;
                             B   : C_Int) return chars_ptr;
      pragma Import (C, Field_Buffer, "field_buffer");
   begin
      return Fill_String (Field_Buffer (Fld, C_Int (Buffer)));
   end Get_Buffer;
   --  |
   --  |
   --  |
   procedure Set_Status (Fld    : Field;
                         Status : Boolean := True)
   is
      function Set_Fld_Status (Fld : Field;
                               St  : C_Int) return Eti_Error;
      pragma Import (C, Set_Fld_Status, "set_field_status");

   begin
      if Set_Fld_Status (Fld, Boolean'Pos (Status)) /= E_Ok then
         raise Form_Exception;
      end if;
   end Set_Status;
   --  |
   --  |
   --  |
   function Changed (Fld : Field) return Boolean
   is
      function Field_Status (Fld : Field) return C_Int;
      pragma Import (C, Field_Status, "field_status");

      Res : constant C_Int := Field_Status (Fld);
   begin
      if Res = Curses_False then
         return False;
      else
         return True;
      end if;
   end Changed;
   --  |
   --  |
   --  |
   procedure Set_Maximum_Size (Fld : Field;
                               Max : Natural := 0)
   is
      function Set_Field_Max (Fld : Field;
                              M   : C_Int) return Eti_Error;
      pragma Import (C, Set_Field_Max, "set_max_field");

   begin
      Eti_Exception (Set_Field_Max (Fld, C_Int (Max)));
   end Set_Maximum_Size;
   --  |
   --  |=====================================================================
   --  | man page form_field_opts.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Set_Options (Fld     : Field;
                          Options : Field_Option_Set)
   is
      function Set_Field_Opts (Fld : Field;
                               Opt : Field_Option_Set) return Eti_Error;
      pragma Import (C, Set_Field_Opts, "set_field_opts");

   begin
      Eti_Exception (Set_Field_Opts (Fld, Options));
   end Set_Options;
   --  |
   --  |
   --  |
   procedure Switch_Options (Fld     : Field;
                             Options : Field_Option_Set;
                             On      : Boolean := True)
   is
      function Field_Opts_On (Fld : Field;
                              Opt : Field_Option_Set) return Eti_Error;
      pragma Import (C, Field_Opts_On, "field_opts_on");
      function Field_Opts_Off (Fld : Field;
                               Opt : Field_Option_Set) return Eti_Error;
      pragma Import (C, Field_Opts_Off, "field_opts_off");

   begin
      if On then
         Eti_Exception (Field_Opts_On (Fld, Options));
      else
         Eti_Exception (Field_Opts_Off (Fld, Options));
      end if;
   end Switch_Options;
   --  |
   --  |
   --  |
   procedure Get_Options (Fld     : Field;
                          Options : out Field_Option_Set)
   is
      function Field_Opts (Fld : Field) return Field_Option_Set;
      pragma Import (C, Field_Opts, "field_opts");

   begin
      Options := Field_Opts (Fld);
   end Get_Options;
   --  |
   --  |
   --  |
   function Get_Options (Fld : Field := Null_Field)
                         return Field_Option_Set
   is
      Fos : Field_Option_Set;
   begin
      Get_Options (Fld, Fos);
      return Fos;
   end Get_Options;
   --  |
   --  |=====================================================================
   --  | man page form_field_attributes.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Set_Foreground
     (Fld   : Field;
      Fore  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First)
   is
      function Set_Field_Fore (Fld  : Field;
                               Attr : Attributed_Character) return Eti_Error;
      pragma Import (C, Set_Field_Fore, "set_field_fore");

   begin
      Eti_Exception (Set_Field_Fore (Fld, (Ch    => Character'First,
                                           Color => Color,
                                           Attr  => Fore)));
   end Set_Foreground;
   --  |
   --  |
   --  |
   procedure Foreground (Fld  : Field;
                         Fore : out Character_Attribute_Set)
   is
      function Field_Fore (Fld : Field) return Attributed_Character;
      pragma Import (C, Field_Fore, "field_fore");
   begin
      Fore := Field_Fore (Fld).Attr;
   end Foreground;

   procedure Foreground (Fld   : Field;
                         Fore  : out Character_Attribute_Set;
                         Color : out Color_Pair)
   is
      function Field_Fore (Fld : Field) return Attributed_Character;
      pragma Import (C, Field_Fore, "field_fore");
   begin
      Fore  := Field_Fore (Fld).Attr;
      Color := Field_Fore (Fld).Color;
   end Foreground;
   --  |
   --  |
   --  |
   procedure Set_Background
     (Fld   : Field;
      Back  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First)
   is
      function Set_Field_Back (Fld  : Field;
                               Attr : Attributed_Character) return Eti_Error;
      pragma Import (C, Set_Field_Back, "set_field_back");

   begin
      Eti_Exception (Set_Field_Back (Fld, (Ch    => Character'First,
                                           Color => Color,
                                           Attr  => Back)));
   end Set_Background;
   --  |
   --  |
   --  |
   procedure Background (Fld  : Field;
                         Back : out Character_Attribute_Set)
   is
      function Field_Back (Fld : Field) return Attributed_Character;
      pragma Import (C, Field_Back, "field_back");
   begin
      Back := Field_Back (Fld).Attr;
   end Background;

   procedure Background (Fld   : Field;
                         Back  : out Character_Attribute_Set;
                         Color : out Color_Pair)
   is
      function Field_Back (Fld : Field) return Attributed_Character;
      pragma Import (C, Field_Back, "field_back");
   begin
      Back  := Field_Back (Fld).Attr;
      Color := Field_Back (Fld).Color;
   end Background;
   --  |
   --  |
   --  |
   procedure Set_Pad_Character (Fld : Field;
                                Pad : Character := Space)
   is
      function Set_Field_Pad (Fld : Field;
                              Ch  : C_Int) return Eti_Error;
      pragma Import (C, Set_Field_Pad, "set_field_pad");

   begin
      Eti_Exception (Set_Field_Pad (Fld,
                                    C_Int (Character'Pos (Pad))));
   end Set_Pad_Character;
   --  |
   --  |
   --  |
   procedure Pad_Character (Fld : Field;
                            Pad : out Character)
   is
      function Field_Pad (Fld : Field) return C_Int;
      pragma Import (C, Field_Pad, "field_pad");
   begin
      Pad := Character'Val (Field_Pad (Fld));
   end Pad_Character;
   --  |
   --  |=====================================================================
   --  | man page form_field_info.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Info (Fld                : Field;
                   Lines              : out Line_Count;
                   Columns            : out Column_Count;
                   First_Row          : out Line_Position;
                   First_Column       : out Column_Position;
                   Off_Screen         : out Natural;
                   Additional_Buffers : out Buffer_Number)
   is
      type C_Int_Access is access all C_Int;
      function Fld_Info (Fld : Field;
                         L, C, Fr, Fc, Os, Ab : C_Int_Access)
                         return Eti_Error;
      pragma Import (C, Fld_Info, "field_info");

      L, C, Fr, Fc, Os, Ab : aliased C_Int;
   begin
      Eti_Exception (Fld_Info (Fld,
                               L'Access, C'Access,
                               Fr'Access, Fc'Access,
                               Os'Access, Ab'Access));
      Lines              := Line_Count (L);
      Columns            := Column_Count (C);
      First_Row          := Line_Position (Fr);
      First_Column       := Column_Position (Fc);
      Off_Screen         := Natural (Os);
      Additional_Buffers := Buffer_Number (Ab);
   end Info;
--  |
--  |
--  |
   procedure Dynamic_Info (Fld     : Field;
                           Lines   : out Line_Count;
                           Columns : out Column_Count;
                           Max     : out Natural)
   is
      type C_Int_Access is access all C_Int;
      function Dyn_Info (Fld : Field; L, C, M : C_Int_Access) return Eti_Error;
      pragma Import (C, Dyn_Info, "dynamic_field_info");

      L, C, M : aliased C_Int;
   begin
      Eti_Exception (Dyn_Info (Fld,
                               L'Access, C'Access,
                               M'Access));
      Lines   := Line_Count (L);
      Columns := Column_Count (C);
      Max     := Natural (M);
   end Dynamic_Info;
   --  |
   --  |=====================================================================
   --  | man page form_win.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Set_Window (Frm : Form;
                         Win : Window)
   is
      function Set_Form_Win (Frm : Form;
                             Win : Window) return Eti_Error;
      pragma Import (C, Set_Form_Win, "set_form_win");

   begin
      Eti_Exception (Set_Form_Win (Frm, Win));
   end Set_Window;
   --  |
   --  |
   --  |
   function Get_Window (Frm : Form) return Window
   is
      function Form_Win (Frm : Form) return Window;
      pragma Import (C, Form_Win, "form_win");

      W : constant Window := Form_Win (Frm);
   begin
      return W;
   end Get_Window;
   --  |
   --  |
   --  |
   procedure Set_Sub_Window (Frm : Form;
                             Win : Window)
   is
      function Set_Form_Sub (Frm : Form;
                             Win : Window) return Eti_Error;
      pragma Import (C, Set_Form_Sub, "set_form_sub");

   begin
      Eti_Exception (Set_Form_Sub (Frm, Win));
   end Set_Sub_Window;
   --  |
   --  |
   --  |
   function Get_Sub_Window (Frm : Form) return Window
   is
      function Form_Sub (Frm : Form) return Window;
      pragma Import (C, Form_Sub, "form_sub");

      W : constant Window := Form_Sub (Frm);
   begin
      return W;
   end Get_Sub_Window;
   --  |
   --  |
   --  |
   procedure Scale (Frm     : Form;
                    Lines   : out Line_Count;
                    Columns : out Column_Count)
   is
      type C_Int_Access is access all C_Int;
      function M_Scale (Frm : Form; Yp, Xp : C_Int_Access) return Eti_Error;
      pragma Import (C, M_Scale, "scale_form");

      X, Y : aliased C_Int;
   begin
      Eti_Exception (M_Scale (Frm, Y'Access, X'Access));
      Lines   := Line_Count (Y);
      Columns := Column_Count (X);
   end Scale;
   --  |
   --  |=====================================================================
   --  | man page menu_hook.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Set_Field_Init_Hook (Frm  : Form;
                                  Proc : Form_Hook_Function)
   is
      function Set_Field_Init (Frm  : Form;
                               Proc : Form_Hook_Function) return Eti_Error;
      pragma Import (C, Set_Field_Init, "set_field_init");

   begin
      Eti_Exception (Set_Field_Init (Frm, Proc));
   end Set_Field_Init_Hook;
   --  |
   --  |
   --  |
   procedure Set_Field_Term_Hook (Frm  : Form;
                                  Proc : Form_Hook_Function)
   is
      function Set_Field_Term (Frm  : Form;
                               Proc : Form_Hook_Function) return Eti_Error;
      pragma Import (C, Set_Field_Term, "set_field_term");

   begin
      Eti_Exception (Set_Field_Term (Frm, Proc));
   end Set_Field_Term_Hook;
   --  |
   --  |
   --  |
   procedure Set_Form_Init_Hook (Frm  : Form;
                                 Proc : Form_Hook_Function)
   is
      function Set_Form_Init (Frm  : Form;
                              Proc : Form_Hook_Function) return Eti_Error;
      pragma Import (C, Set_Form_Init, "set_form_init");

   begin
      Eti_Exception (Set_Form_Init (Frm, Proc));
   end Set_Form_Init_Hook;
   --  |
   --  |
   --  |
   procedure Set_Form_Term_Hook (Frm  : Form;
                                 Proc : Form_Hook_Function)
   is
      function Set_Form_Term (Frm  : Form;
                              Proc : Form_Hook_Function) return Eti_Error;
      pragma Import (C, Set_Form_Term, "set_form_term");

   begin
      Eti_Exception (Set_Form_Term (Frm, Proc));
   end Set_Form_Term_Hook;
   --  |
   --  |=====================================================================
   --  | man page form_fields.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Redefine (Frm  : Form;
                       Flds : Field_Array_Access)
   is
      function Set_Frm_Fields (Frm   : Form;
                               Items : System.Address) return Eti_Error;
      pragma Import (C, Set_Frm_Fields, "set_form_fields");

   begin
      pragma Assert (Flds.all (Flds'Last) = Null_Field);
      if Flds.all (Flds'Last) /= Null_Field then
         raise Form_Exception;
      else
         Eti_Exception (Set_Frm_Fields (Frm, Flds.all (Flds'First)'Address));
      end if;
   end Redefine;
   --  |
   --  |
   --  |
   function Fields (Frm   : Form;
                    Index : Positive) return Field
   is
      use F_Array;

      function C_Fields (Frm : Form) return Pointer;
      pragma Import (C, C_Fields, "form_fields");

      P : Pointer := C_Fields (Frm);
   begin
      if P = null or else Index > Field_Count (Frm) then
         raise Form_Exception;
      else
         P := P + ptrdiff_t (C_Int (Index) - 1);
         return P.all;
      end if;
   end Fields;
   --  |
   --  |
   --  |
   function Field_Count (Frm : Form) return Natural
   is
      function Count (Frm : Form) return C_Int;
      pragma Import (C, Count, "field_count");
   begin
      return Natural (Count (Frm));
   end Field_Count;
   --  |
   --  |
   --  |
   procedure Move (Fld    : Field;
                   Line   : Line_Position;
                   Column : Column_Position)
   is
      function Move (Fld : Field; L, C : C_Int) return Eti_Error;
      pragma Import (C, Move, "move_field");

   begin
      Eti_Exception (Move (Fld, C_Int (Line), C_Int (Column)));
   end Move;
   --  |
   --  |=====================================================================
   --  | man page form_new.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   function Create (Fields : Field_Array_Access) return Form
   is
      function NewForm (Fields : System.Address) return Form;
      pragma Import (C, NewForm, "new_form");

      M   : Form;
   begin
      pragma Assert (Fields.all (Fields'Last) = Null_Field);
      if Fields.all (Fields'Last) /= Null_Field then
         raise Form_Exception;
      else
         M := NewForm (Fields.all (Fields'First)'Address);
         if M = Null_Form then
            raise Form_Exception;
         end if;
         return M;
      end if;
   end Create;
   --  |
   --  |
   --  |
   procedure Delete (Frm : in out Form)
   is
      function Free (Frm : Form) return Eti_Error;
      pragma Import (C, Free, "free_form");

   begin
      Eti_Exception (Free (Frm));
      Frm := Null_Form;
   end Delete;
   --  |
   --  |=====================================================================
   --  | man page form_opts.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Set_Options (Frm     : Form;
                          Options : Form_Option_Set)
   is
      function Set_Form_Opts (Frm : Form;
                              Opt : Form_Option_Set) return Eti_Error;
      pragma Import (C, Set_Form_Opts, "set_form_opts");

   begin
      Eti_Exception (Set_Form_Opts (Frm, Options));
   end Set_Options;
   --  |
   --  |
   --  |
   procedure Switch_Options (Frm     : Form;
                             Options : Form_Option_Set;
                             On      : Boolean := True)
   is
      function Form_Opts_On (Frm : Form;
                             Opt : Form_Option_Set) return Eti_Error;
      pragma Import (C, Form_Opts_On, "form_opts_on");
      function Form_Opts_Off (Frm : Form;
                              Opt : Form_Option_Set) return Eti_Error;
      pragma Import (C, Form_Opts_Off, "form_opts_off");

   begin
      if On then
         Eti_Exception (Form_Opts_On (Frm, Options));
      else
         Eti_Exception (Form_Opts_Off (Frm, Options));
      end if;
   end Switch_Options;
   --  |
   --  |
   --  |
   procedure Get_Options (Frm     : Form;
                          Options : out Form_Option_Set)
   is
      function Form_Opts (Frm : Form) return Form_Option_Set;
      pragma Import (C, Form_Opts, "form_opts");

   begin
      Options := Form_Opts (Frm);
   end Get_Options;
   --  |
   --  |
   --  |
   function Get_Options (Frm : Form := Null_Form) return Form_Option_Set
   is
      Fos : Form_Option_Set;
   begin
      Get_Options (Frm, Fos);
      return Fos;
   end Get_Options;
   --  |
   --  |=====================================================================
   --  | man page form_post.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Post (Frm  : Form;
                   Post : Boolean := True)
   is
      function M_Post (Frm : Form) return Eti_Error;
      pragma Import (C, M_Post, "post_form");
      function M_Unpost (Frm : Form) return Eti_Error;
      pragma Import (C, M_Unpost, "unpost_form");

   begin
      if Post then
         Eti_Exception (M_Post (Frm));
      else
         Eti_Exception (M_Unpost (Frm));
      end if;
   end Post;
   --  |
   --  |=====================================================================
   --  | man page form_cursor.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Position_Cursor (Frm : Form)
   is
      function Pos_Form_Cursor (Frm : Form) return Eti_Error;
      pragma Import (C, Pos_Form_Cursor, "pos_form_cursor");

   begin
      Eti_Exception (Pos_Form_Cursor (Frm));
   end Position_Cursor;
   --  |
   --  |=====================================================================
   --  | man page form_data.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   function Data_Ahead (Frm : Form) return Boolean
   is
      function Ahead (Frm : Form) return C_Int;
      pragma Import (C, Ahead, "data_ahead");

      Res : constant C_Int := Ahead (Frm);
   begin
      if Res = Curses_False then
         return False;
      else
         return True;
      end if;
   end Data_Ahead;
   --  |
   --  |
   --  |
   function Data_Behind (Frm : Form) return Boolean
   is
      function Behind (Frm : Form) return C_Int;
      pragma Import (C, Behind, "data_behind");

      Res : constant C_Int := Behind (Frm);
   begin
      if Res = Curses_False then
         return False;
      else
         return True;
      end if;
   end Data_Behind;
   --  |
   --  |=====================================================================
   --  | man page form_driver.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   function Driver (Frm : Form;
                    Key : Key_Code) return Driver_Result
   is
      function Frm_Driver (Frm : Form; Key : C_Int) return Eti_Error;
      pragma Import (C, Frm_Driver, "form_driver");

      R : constant Eti_Error := Frm_Driver (Frm, C_Int (Key));
   begin
      case R is
         when E_Unknown_Command =>
            return Unknown_Request;
         when E_Invalid_Field =>
            return Invalid_Field;
         when E_Request_Denied =>
            return Request_Denied;
         when others =>
            Eti_Exception (R);
            return Form_Ok;
      end case;
   end Driver;
   --  |
   --  |=====================================================================
   --  | man page form_page.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Set_Current (Frm : Form;
                          Fld : Field)
   is
      function Set_Current_Fld (Frm : Form; Fld : Field) return Eti_Error;
      pragma Import (C, Set_Current_Fld, "set_current_field");

   begin
      Eti_Exception (Set_Current_Fld (Frm, Fld));
   end Set_Current;
   --  |
   --  |
   --  |
   function Current (Frm : Form) return Field
   is
      function Current_Fld (Frm : Form) return Field;
      pragma Import (C, Current_Fld, "current_field");

      Fld : constant Field := Current_Fld (Frm);
   begin
      if Fld = Null_Field then
         raise Form_Exception;
      end if;
      return Fld;
   end Current;
   --  |
   --  |
   --  |
   procedure Set_Page (Frm  : Form;
                       Page : Page_Number := Page_Number'First)
   is
      function Set_Frm_Page (Frm : Form; Pg : C_Int) return Eti_Error;
      pragma Import (C, Set_Frm_Page, "set_form_page");

   begin
      Eti_Exception (Set_Frm_Page (Frm, C_Int (Page)));
   end Set_Page;
   --  |
   --  |
   --  |
   function Page (Frm : Form) return Page_Number
   is
      function Get_Page (Frm : Form) return C_Int;
      pragma Import (C, Get_Page, "form_page");

      P : constant C_Int := Get_Page (Frm);
   begin
      if P < 0 then
         raise Form_Exception;
      else
         return Page_Number (P);
      end if;
   end Page;

   function Get_Index (Fld : Field) return Positive
   is
      function Get_Fieldindex (Fld : Field) return C_Int;
      pragma Import (C, Get_Fieldindex, "field_index");

      Res : constant C_Int := Get_Fieldindex (Fld);
   begin
      if Res = Curses_Err then
         raise Form_Exception;
      end if;
      return Positive (Natural (Res) + Positive'First);
   end Get_Index;

   --  |
   --  |=====================================================================
   --  | man page form_new_page.3x
   --  |=====================================================================
   --  |
   --  |
   --  |
   procedure Set_New_Page (Fld      : Field;
                           New_Page : Boolean := True)
   is
      function Set_Page (Fld : Field; Flg : C_Int) return Eti_Error;
      pragma Import (C, Set_Page, "set_new_page");

   begin
      Eti_Exception (Set_Page (Fld, Boolean'Pos (New_Page)));
   end Set_New_Page;
   --  |
   --  |
   --  |
   function Is_New_Page (Fld : Field) return Boolean
   is
      function Is_New (Fld : Field) return C_Int;
      pragma Import (C, Is_New, "new_page");

      Res : constant C_Int := Is_New (Fld);
   begin
      if Res = Curses_False then
         return False;
      else
         return True;
      end if;
   end Is_New_Page;

   procedure Free (FA          : in out Field_Array_Access;
                   Free_Fields : Boolean := False)
   is
      procedure Release is new Ada.Unchecked_Deallocation
        (Field_Array, Field_Array_Access);
   begin
      if FA /= null and then Free_Fields then
         for I in FA'First .. (FA'Last - 1) loop
            if FA.all (I) /= Null_Field then
               Delete (FA.all (I));
            end if;
         end loop;
      end if;
      Release (FA);
   end Free;

   --  |=====================================================================

   function Default_Field_Options return Field_Option_Set
   is
   begin
      return Get_Options (Null_Field);
   end Default_Field_Options;

   function Default_Form_Options return Form_Option_Set
   is
   begin
      return Get_Options (Null_Form);
   end Default_Form_Options;

end Terminal_Interface.Curses.Forms;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm0000644000175100001440000003001412340214310030445 0ustar tomusers terminal_interface-curses-forms-field_types-enumeration.ads

File : terminal_interface-curses-forms-field_types-enumeration.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--           Terminal_Interface.Curses.Forms.Field_Types.Enumeration        --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C.Strings;

package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is
   pragma Preelaborate
     (Terminal_Interface.Curses.Forms.Field_Types.Enumeration);

   type String_Access is access String;

   --  Type_Set is used by the child package Ada
   type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);

   type Enum_Array is array (Positive range <>)
     of String_Access;

   type Enumeration_Info (C : Positive) is
      record
         Names                : Enum_Array (1 .. C);
         Case_Sensitive       : Boolean := False;
         Match_Must_Be_Unique : Boolean := False;
      end record;

   type Enumeration_Field is new Field_Type with private;

   function Create (Info : Enumeration_Info;
                    Auto_Release_Names : Boolean := False)
                    return Enumeration_Field;
   --  Make an fieldtype from the info. Enumerations are special, because
   --  they normally don't copy the enum values into a private store, so
   --  we have to care for the lifetime of the info we provide.
   --  The Auto_Release_Names flag may be used to automatically releases
   --  the strings in the Names array of the Enumeration_Info.

   function Make_Enumeration_Type (Info : Enumeration_Info;
                                   Auto_Release_Names : Boolean := False)
                                   return Enumeration_Field renames Create;

   procedure Release (Enum : in out Enumeration_Field);
   --  But we may want to release the field to release the memory allocated
   --  by it internally. After that the Enumeration field is no longer usable.

   --  The next type defintions are all ncurses extensions. They are typically
   --  not available in other curses implementations.

   procedure Set_Field_Type (Fld : Field;
                             Typ : Enumeration_Field);
   pragma Inline (Set_Field_Type);

private
   type CPA_Access is access Interfaces.C.Strings.chars_ptr_array;

   type Enumeration_Field is new Field_Type with
      record
         Case_Sensitive       : Boolean := False;
         Match_Must_Be_Unique : Boolean := False;
         Arr                  : CPA_Access := null;
      end record;

end Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-modular_io__ads.htm0000644000175100001440000002033212340214310026273 0ustar tomusers terminal_interface-curses-text_io-modular_io.ads

File : terminal_interface-curses-text_io-modular_io.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Text_IO.Modular_IO               --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
generic
   type Num is mod <>;

package Terminal_Interface.Curses.Text_IO.Modular_IO is

   Default_Width : Field := Num'Width;
   Default_Base  : Number_Base := 10;

   procedure Put
     (Win   : Window;
      Item  : Num;
      Width : Field := Default_Width;
      Base  : Number_Base := Default_Base);

   procedure Put
     (Item  : Num;
      Width : Field := Default_Width;
      Base  : Number_Base := Default_Base);

private
   pragma Inline (Put);

end Terminal_Interface.Curses.Text_IO.Modular_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-menus__adb.htm0000644000175100001440000037736112340214310023617 0ustar tomusers terminal_interface-curses-menus.adb

File : terminal_interface-curses-menus.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                      Terminal_Interface.Curses.Menus                     --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.32 @
--  @Date: 2014/05/24 21:31:05 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Interfaces.C.Pointers;

package body Terminal_Interface.Curses.Menus is

   type C_Item_Array is array (Natural range <>) of aliased Item;
   package I_Array is new
     Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item);

   use type System.Bit_Order;
   subtype chars_ptr is Interfaces.C.Strings.chars_ptr;

------------------------------------------------------------------------------
   procedure Request_Name (Key  : Menu_Request_Code;
                           Name : out String)
   is
      function Request_Name (Key : C_Int) return chars_ptr;
      pragma Import (C, Request_Name, "menu_request_name");
   begin
      Fill_String (Request_Name (C_Int (Key)), Name);
   end Request_Name;

   function Request_Name (Key : Menu_Request_Code) return String
   is
      function Request_Name (Key : C_Int) return chars_ptr;
      pragma Import (C, Request_Name, "menu_request_name");
   begin
      return Fill_String (Request_Name (C_Int (Key)));
   end Request_Name;

   function Create (Name        : String;
                    Description : String := "") return Item
   is
      type Char_Ptr is access all Interfaces.C.char;
      function Newitem (Name, Desc : Char_Ptr) return Item;
      pragma Import (C, Newitem, "new_item");

      type Name_String is new char_array (0 .. Name'Length);
      type Name_String_Ptr is access Name_String;
      pragma Controlled (Name_String_Ptr);

      type Desc_String is new char_array (0 .. Description'Length);
      type Desc_String_Ptr is access Desc_String;
      pragma Controlled (Desc_String_Ptr);

      Name_Str : constant Name_String_Ptr := new Name_String;
      Desc_Str : constant Desc_String_Ptr := new Desc_String;
      Name_Len, Desc_Len : size_t;
      Result : Item;
   begin
      To_C (Name, Name_Str.all, Name_Len);
      To_C (Description, Desc_Str.all, Desc_Len);
      Result := Newitem (Name_Str.all (Name_Str.all'First)'Access,
                         Desc_Str.all (Desc_Str.all'First)'Access);
      if Result = Null_Item then
         raise Eti_System_Error;
      end if;
      return Result;
   end Create;

   procedure Delete (Itm : in out Item)
   is
      function Descname (Itm  : Item) return chars_ptr;
      pragma Import (C, Descname, "item_description");
      function Itemname (Itm  : Item) return chars_ptr;
      pragma Import (C, Itemname, "item_name");

      function Freeitem (Itm : Item) return Eti_Error;
      pragma Import (C, Freeitem, "free_item");

      Ptr : chars_ptr;
   begin
      Ptr := Descname (Itm);
      if Ptr /= Null_Ptr then
         Interfaces.C.Strings.Free (Ptr);
      end if;
      Ptr := Itemname (Itm);
      if Ptr /= Null_Ptr then
         Interfaces.C.Strings.Free (Ptr);
      end if;
      Eti_Exception (Freeitem (Itm));
      Itm := Null_Item;
   end Delete;
-------------------------------------------------------------------------------
   procedure Set_Value (Itm   : Item;
                        Value : Boolean := True)
   is
      function Set_Item_Val (Itm : Item;
                             Val : C_Int) return Eti_Error;
      pragma Import (C, Set_Item_Val, "set_item_value");

   begin
      Eti_Exception (Set_Item_Val (Itm, Boolean'Pos (Value)));
   end Set_Value;

   function Value (Itm : Item) return Boolean
   is
      function Item_Val (Itm : Item) return C_Int;
      pragma Import (C, Item_Val, "item_value");
   begin
      if Item_Val (Itm) = Curses_False then
         return False;
      else
         return True;
      end if;
   end Value;

-------------------------------------------------------------------------------
   function Visible (Itm : Item) return Boolean
   is
      function Item_Vis (Itm : Item) return C_Int;
      pragma Import (C, Item_Vis, "item_visible");
   begin
      if Item_Vis (Itm) = Curses_False then
         return False;
      else
         return True;
      end if;
   end Visible;
-------------------------------------------------------------------------------
   procedure Set_Options (Itm     : Item;
                          Options : Item_Option_Set)
   is
      function Set_Item_Opts (Itm : Item;
                              Opt : Item_Option_Set) return Eti_Error;
      pragma Import (C, Set_Item_Opts, "set_item_opts");

   begin
      Eti_Exception (Set_Item_Opts (Itm, Options));
   end Set_Options;

   procedure Switch_Options (Itm     : Item;
                             Options : Item_Option_Set;
                             On      : Boolean := True)
   is
      function Item_Opts_On (Itm : Item;
                             Opt : Item_Option_Set) return Eti_Error;
      pragma Import (C, Item_Opts_On, "item_opts_on");
      function Item_Opts_Off (Itm : Item;
                              Opt : Item_Option_Set) return Eti_Error;
      pragma Import (C, Item_Opts_Off, "item_opts_off");

   begin
      if On then
         Eti_Exception (Item_Opts_On (Itm, Options));
      else
         Eti_Exception (Item_Opts_Off (Itm, Options));
      end if;
   end Switch_Options;

   procedure Get_Options (Itm     : Item;
                          Options : out Item_Option_Set)
   is
      function Item_Opts (Itm : Item) return Item_Option_Set;
      pragma Import (C, Item_Opts, "item_opts");

   begin
      Options := Item_Opts (Itm);
   end Get_Options;

   function Get_Options (Itm : Item := Null_Item) return Item_Option_Set
   is
      Ios : Item_Option_Set;
   begin
      Get_Options (Itm, Ios);
      return Ios;
   end Get_Options;
-------------------------------------------------------------------------------
   procedure Name (Itm  : Item;
                   Name : out String)
   is
      function Itemname (Itm : Item) return chars_ptr;
      pragma Import (C, Itemname, "item_name");
   begin
      Fill_String (Itemname (Itm), Name);
   end Name;

   function Name (Itm : Item) return String
   is
      function Itemname (Itm : Item) return chars_ptr;
      pragma Import (C, Itemname, "item_name");
   begin
      return Fill_String (Itemname (Itm));
   end Name;

   procedure Description (Itm         : Item;
                          Description : out String)
   is
      function Descname (Itm  : Item) return chars_ptr;
      pragma Import (C, Descname, "item_description");
   begin
      Fill_String (Descname (Itm), Description);
   end Description;

   function Description (Itm : Item) return String
   is
      function Descname (Itm  : Item) return chars_ptr;
      pragma Import (C, Descname, "item_description");
   begin
      return Fill_String (Descname (Itm));
   end Description;
-------------------------------------------------------------------------------
   procedure Set_Current (Men : Menu;
                          Itm : Item)
   is
      function Set_Curr_Item (Men : Menu;
                              Itm : Item) return Eti_Error;
      pragma Import (C, Set_Curr_Item, "set_current_item");

   begin
      Eti_Exception (Set_Curr_Item (Men, Itm));
   end Set_Current;

   function Current (Men : Menu) return Item
   is
      function Curr_Item (Men : Menu) return Item;
      pragma Import (C, Curr_Item, "current_item");

      Res : constant Item := Curr_Item (Men);
   begin
      if Res = Null_Item then
         raise Menu_Exception;
      end if;
      return Res;
   end Current;

   procedure Set_Top_Row (Men  : Menu;
                          Line : Line_Position)
   is
      function Set_Toprow (Men  : Menu;
                           Line : C_Int) return Eti_Error;
      pragma Import (C, Set_Toprow, "set_top_row");

   begin
      Eti_Exception (Set_Toprow (Men, C_Int (Line)));
   end Set_Top_Row;

   function Top_Row (Men : Menu) return Line_Position
   is
      function Toprow (Men : Menu) return C_Int;
      pragma Import (C, Toprow, "top_row");

      Res : constant C_Int := Toprow (Men);
   begin
      if Res = Curses_Err then
         raise Menu_Exception;
      end if;
      return Line_Position (Res);
   end Top_Row;

   function Get_Index (Itm : Item) return Positive
   is
      function Get_Itemindex (Itm : Item) return C_Int;
      pragma Import (C, Get_Itemindex, "item_index");

      Res : constant C_Int := Get_Itemindex (Itm);
   begin
      if Res = Curses_Err then
         raise Menu_Exception;
      end if;
      return Positive (Natural (Res) + Positive'First);
   end Get_Index;
-------------------------------------------------------------------------------
   procedure Post (Men  : Menu;
                   Post : Boolean := True)
   is
      function M_Post (Men : Menu) return Eti_Error;
      pragma Import (C, M_Post, "post_menu");
      function M_Unpost (Men : Menu) return Eti_Error;
      pragma Import (C, M_Unpost, "unpost_menu");

   begin
      if Post then
         Eti_Exception (M_Post (Men));
      else
         Eti_Exception (M_Unpost (Men));
      end if;
   end Post;
-------------------------------------------------------------------------------
   procedure Set_Options (Men     : Menu;
                          Options : Menu_Option_Set)
   is
      function Set_Menu_Opts (Men : Menu;
                              Opt : Menu_Option_Set) return Eti_Error;
      pragma Import (C, Set_Menu_Opts, "set_menu_opts");

   begin
      Eti_Exception (Set_Menu_Opts (Men, Options));
   end Set_Options;

   procedure Switch_Options (Men     : Menu;
                             Options : Menu_Option_Set;
                             On      : Boolean := True)
   is
      function Menu_Opts_On (Men : Menu;
                             Opt : Menu_Option_Set) return Eti_Error;
      pragma Import (C, Menu_Opts_On, "menu_opts_on");
      function Menu_Opts_Off (Men : Menu;
                              Opt : Menu_Option_Set) return Eti_Error;
      pragma Import (C, Menu_Opts_Off, "menu_opts_off");

   begin
      if On then
         Eti_Exception (Menu_Opts_On  (Men, Options));
      else
         Eti_Exception (Menu_Opts_Off (Men, Options));
      end if;
   end Switch_Options;

   procedure Get_Options (Men     : Menu;
                          Options : out Menu_Option_Set)
   is
      function Menu_Opts (Men : Menu) return Menu_Option_Set;
      pragma Import (C, Menu_Opts, "menu_opts");

   begin
      Options := Menu_Opts (Men);
   end Get_Options;

   function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set
   is
      Mos : Menu_Option_Set;
   begin
      Get_Options (Men, Mos);
      return Mos;
   end Get_Options;
-------------------------------------------------------------------------------
   procedure Set_Window (Men : Menu;
                         Win : Window)
   is
      function Set_Menu_Win (Men : Menu;
                             Win : Window) return Eti_Error;
      pragma Import (C, Set_Menu_Win, "set_menu_win");

   begin
      Eti_Exception (Set_Menu_Win (Men, Win));
   end Set_Window;

   function Get_Window (Men : Menu) return Window
   is
      function Menu_Win (Men : Menu) return Window;
      pragma Import (C, Menu_Win, "menu_win");

      W : constant Window := Menu_Win (Men);
   begin
      return W;
   end Get_Window;

   procedure Set_Sub_Window (Men : Menu;
                             Win : Window)
   is
      function Set_Menu_Sub (Men : Menu;
                             Win : Window) return Eti_Error;
      pragma Import (C, Set_Menu_Sub, "set_menu_sub");

   begin
      Eti_Exception (Set_Menu_Sub (Men, Win));
   end Set_Sub_Window;

   function Get_Sub_Window (Men : Menu) return Window
   is
      function Menu_Sub (Men : Menu) return Window;
      pragma Import (C, Menu_Sub, "menu_sub");

      W : constant Window := Menu_Sub (Men);
   begin
      return W;
   end Get_Sub_Window;

   procedure Scale (Men     : Menu;
                    Lines   : out Line_Count;
                    Columns : out Column_Count)
   is
      type C_Int_Access is access all C_Int;
      function M_Scale (Men    : Menu;
                        Yp, Xp : C_Int_Access) return Eti_Error;
      pragma Import (C, M_Scale, "scale_menu");

      X, Y : aliased C_Int;
   begin
      Eti_Exception (M_Scale (Men, Y'Access, X'Access));
      Lines := Line_Count (Y);
      Columns := Column_Count (X);
   end Scale;
-------------------------------------------------------------------------------
   procedure Position_Cursor (Men : Menu)
   is
      function Pos_Menu_Cursor (Men : Menu) return Eti_Error;
      pragma Import (C, Pos_Menu_Cursor, "pos_menu_cursor");

   begin
      Eti_Exception (Pos_Menu_Cursor (Men));
   end Position_Cursor;

-------------------------------------------------------------------------------
   procedure Set_Mark (Men  : Menu;
                       Mark : String)
   is
      type Char_Ptr is access all Interfaces.C.char;
      function Set_Mark (Men  : Menu;
                         Mark : Char_Ptr) return Eti_Error;
      pragma Import (C, Set_Mark, "set_menu_mark");

      Txt : char_array (0 .. Mark'Length);
      Len : size_t;
   begin
      To_C (Mark, Txt, Len);
      Eti_Exception (Set_Mark (Men, Txt (Txt'First)'Access));
   end Set_Mark;

   procedure Mark (Men  : Menu;
                   Mark : out String)
   is
      function Get_Menu_Mark (Men : Menu) return chars_ptr;
      pragma Import (C, Get_Menu_Mark, "menu_mark");
   begin
      Fill_String (Get_Menu_Mark (Men), Mark);
   end Mark;

   function Mark (Men : Menu) return String
   is
      function Get_Menu_Mark (Men : Menu) return chars_ptr;
      pragma Import (C, Get_Menu_Mark, "menu_mark");
   begin
      return Fill_String (Get_Menu_Mark (Men));
   end Mark;

-------------------------------------------------------------------------------
   procedure Set_Foreground
     (Men   : Menu;
      Fore  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First)
   is
      function Set_Menu_Fore (Men  : Menu;
                              Attr : Attributed_Character) return Eti_Error;
      pragma Import (C, Set_Menu_Fore, "set_menu_fore");

      Ch : constant Attributed_Character := (Ch    => Character'First,
                                             Color => Color,
                                             Attr  => Fore);
   begin
      Eti_Exception (Set_Menu_Fore (Men, Ch));
   end Set_Foreground;

   procedure Foreground (Men  : Menu;
                         Fore : out Character_Attribute_Set)
   is
      function Menu_Fore (Men : Menu) return Attributed_Character;
      pragma Import (C, Menu_Fore, "menu_fore");
   begin
      Fore := Menu_Fore (Men).Attr;
   end Foreground;

   procedure Foreground (Men   : Menu;
                         Fore  : out Character_Attribute_Set;
                         Color : out Color_Pair)
   is
      function Menu_Fore (Men : Menu) return Attributed_Character;
      pragma Import (C, Menu_Fore, "menu_fore");
   begin
      Fore  := Menu_Fore (Men).Attr;
      Color := Menu_Fore (Men).Color;
   end Foreground;

   procedure Set_Background
     (Men   : Menu;
      Back  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First)
   is
      function Set_Menu_Back (Men  : Menu;
                              Attr : Attributed_Character) return Eti_Error;
      pragma Import (C, Set_Menu_Back, "set_menu_back");

      Ch : constant Attributed_Character := (Ch    => Character'First,
                                             Color => Color,
                                             Attr  => Back);
   begin
      Eti_Exception (Set_Menu_Back (Men, Ch));
   end Set_Background;

   procedure Background (Men  : Menu;
                         Back : out Character_Attribute_Set)
   is
      function Menu_Back (Men : Menu) return Attributed_Character;
      pragma Import (C, Menu_Back, "menu_back");
   begin
      Back := Menu_Back (Men).Attr;
   end Background;

   procedure Background (Men   : Menu;
                         Back  : out Character_Attribute_Set;
                         Color : out Color_Pair)
   is
      function Menu_Back (Men : Menu) return Attributed_Character;
      pragma Import (C, Menu_Back, "menu_back");
   begin
      Back  := Menu_Back (Men).Attr;
      Color := Menu_Back (Men).Color;
   end Background;

   procedure Set_Grey (Men   : Menu;
                       Grey  : Character_Attribute_Set := Normal_Video;
                       Color : Color_Pair := Color_Pair'First)
   is
      function Set_Menu_Grey (Men  : Menu;
                              Attr : Attributed_Character) return Eti_Error;
      pragma Import (C, Set_Menu_Grey, "set_menu_grey");

      Ch : constant Attributed_Character := (Ch    => Character'First,
                                             Color => Color,
                                             Attr  => Grey);

   begin
      Eti_Exception (Set_Menu_Grey (Men, Ch));
   end Set_Grey;

   procedure Grey (Men  : Menu;
                   Grey : out Character_Attribute_Set)
   is
      function Menu_Grey (Men : Menu) return Attributed_Character;
      pragma Import (C, Menu_Grey, "menu_grey");
   begin
      Grey := Menu_Grey (Men).Attr;
   end Grey;

   procedure Grey (Men  : Menu;
                   Grey : out Character_Attribute_Set;
                   Color : out Color_Pair)
   is
      function Menu_Grey (Men : Menu) return Attributed_Character;
      pragma Import (C, Menu_Grey, "menu_grey");
   begin
      Grey  := Menu_Grey (Men).Attr;
      Color := Menu_Grey (Men).Color;
   end Grey;

   procedure Set_Pad_Character (Men : Menu;
                                Pad : Character := Space)
   is
      function Set_Menu_Pad (Men : Menu;
                             Ch  : C_Int) return Eti_Error;
      pragma Import (C, Set_Menu_Pad, "set_menu_pad");

   begin
      Eti_Exception (Set_Menu_Pad (Men, C_Int (Character'Pos (Pad))));
   end Set_Pad_Character;

   procedure Pad_Character (Men : Menu;
                            Pad : out Character)
   is
      function Menu_Pad (Men : Menu) return C_Int;
      pragma Import (C, Menu_Pad, "menu_pad");
   begin
      Pad := Character'Val (Menu_Pad (Men));
   end Pad_Character;
-------------------------------------------------------------------------------
   procedure Set_Spacing (Men   : Menu;
                          Descr : Column_Position := 0;
                          Row   : Line_Position   := 0;
                          Col   : Column_Position := 0)
   is
      function Set_Spacing (Men     : Menu;
                            D, R, C : C_Int) return Eti_Error;
      pragma Import (C, Set_Spacing, "set_menu_spacing");

   begin
      Eti_Exception (Set_Spacing (Men,
                                  C_Int (Descr),
                                  C_Int (Row),
                                  C_Int (Col)));
   end Set_Spacing;

   procedure Spacing (Men   : Menu;
                      Descr : out Column_Position;
                      Row   : out Line_Position;
                      Col   : out Column_Position)
   is
      type C_Int_Access is access all C_Int;
      function Get_Spacing (Men     : Menu;
                            D, R, C : C_Int_Access) return Eti_Error;
      pragma Import (C, Get_Spacing, "menu_spacing");

      D, R, C : aliased C_Int;
   begin
      Eti_Exception (Get_Spacing (Men,
                                  D'Access,
                                  R'Access,
                                  C'Access));
      Descr := Column_Position (D);
      Row   := Line_Position (R);
      Col   := Column_Position (C);
   end Spacing;
-------------------------------------------------------------------------------
   function Set_Pattern (Men  : Menu;
                         Text : String) return Boolean
   is
      type Char_Ptr is access all Interfaces.C.char;
      function Set_Pattern (Men     : Menu;
                            Pattern : Char_Ptr) return Eti_Error;
      pragma Import (C, Set_Pattern, "set_menu_pattern");

      S   : char_array (0 .. Text'Length);
      L   : size_t;
      Res : Eti_Error;
   begin
      To_C (Text, S, L);
      Res := Set_Pattern (Men, S (S'First)'Access);
      case Res is
         when E_No_Match =>
            return False;
         when others =>
            Eti_Exception (Res);
            return True;
      end case;
   end Set_Pattern;

   procedure Pattern (Men  : Menu;
                      Text : out String)
   is
      function Get_Pattern (Men : Menu) return chars_ptr;
      pragma Import (C, Get_Pattern, "menu_pattern");
   begin
      Fill_String (Get_Pattern (Men), Text);
   end Pattern;
-------------------------------------------------------------------------------
   procedure Set_Format (Men     : Menu;
                         Lines   : Line_Count;
                         Columns : Column_Count)
   is
      function Set_Menu_Fmt (Men : Menu;
                             Lin : C_Int;
                             Col : C_Int) return Eti_Error;
      pragma Import (C, Set_Menu_Fmt, "set_menu_format");

   begin
      Eti_Exception (Set_Menu_Fmt (Men,
                                   C_Int (Lines),
                                   C_Int (Columns)));

   end Set_Format;

   procedure Format (Men     : Menu;
                     Lines   : out Line_Count;
                     Columns : out Column_Count)
   is
      type C_Int_Access is access all C_Int;
      function Menu_Fmt (Men  : Menu;
                         Y, X : C_Int_Access) return Eti_Error;
      pragma Import (C, Menu_Fmt, "menu_format");

      L, C : aliased C_Int;
   begin
      Eti_Exception (Menu_Fmt (Men, L'Access, C'Access));
      Lines   := Line_Count (L);
      Columns := Column_Count (C);
   end Format;
-------------------------------------------------------------------------------
   procedure Set_Item_Init_Hook (Men  : Menu;
                                 Proc : Menu_Hook_Function)
   is
      function Set_Item_Init (Men  : Menu;
                              Proc : Menu_Hook_Function) return Eti_Error;
      pragma Import (C, Set_Item_Init, "set_item_init");

   begin
      Eti_Exception (Set_Item_Init (Men, Proc));
   end Set_Item_Init_Hook;

   procedure Set_Item_Term_Hook (Men  : Menu;
                                 Proc : Menu_Hook_Function)
   is
      function Set_Item_Term (Men  : Menu;
                              Proc : Menu_Hook_Function) return Eti_Error;
      pragma Import (C, Set_Item_Term, "set_item_term");

   begin
      Eti_Exception (Set_Item_Term (Men, Proc));
   end Set_Item_Term_Hook;

   procedure Set_Menu_Init_Hook (Men  : Menu;
                                 Proc : Menu_Hook_Function)
   is
      function Set_Menu_Init (Men  : Menu;
                              Proc : Menu_Hook_Function) return Eti_Error;
      pragma Import (C, Set_Menu_Init, "set_menu_init");

   begin
      Eti_Exception (Set_Menu_Init (Men, Proc));
   end Set_Menu_Init_Hook;

   procedure Set_Menu_Term_Hook (Men  : Menu;
                                 Proc : Menu_Hook_Function)
   is
      function Set_Menu_Term (Men  : Menu;
                              Proc : Menu_Hook_Function) return Eti_Error;
      pragma Import (C, Set_Menu_Term, "set_menu_term");

   begin
      Eti_Exception (Set_Menu_Term (Men, Proc));
   end Set_Menu_Term_Hook;

   function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function
   is
      function Item_Init (Men : Menu) return Menu_Hook_Function;
      pragma Import (C, Item_Init, "item_init");
   begin
      return Item_Init (Men);
   end Get_Item_Init_Hook;

   function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function
   is
      function Item_Term (Men : Menu) return Menu_Hook_Function;
      pragma Import (C, Item_Term, "item_term");
   begin
      return Item_Term (Men);
   end Get_Item_Term_Hook;

   function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function
   is
      function Menu_Init (Men : Menu) return Menu_Hook_Function;
      pragma Import (C, Menu_Init, "menu_init");
   begin
      return Menu_Init (Men);
   end Get_Menu_Init_Hook;

   function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function
   is
      function Menu_Term (Men : Menu) return Menu_Hook_Function;
      pragma Import (C, Menu_Term, "menu_term");
   begin
      return Menu_Term (Men);
   end Get_Menu_Term_Hook;
-------------------------------------------------------------------------------
   procedure Redefine (Men   : Menu;
                       Items : Item_Array_Access)
   is
      function Set_Items (Men   : Menu;
                          Items : System.Address) return Eti_Error;
      pragma Import (C, Set_Items, "set_menu_items");

   begin
      pragma Assert (Items.all (Items'Last) = Null_Item);
      if Items.all (Items'Last) /= Null_Item then
         raise Menu_Exception;
      else
         Eti_Exception (Set_Items (Men, Items.all'Address));
      end if;
   end Redefine;

   function Item_Count (Men : Menu) return Natural
   is
      function Count (Men : Menu) return C_Int;
      pragma Import (C, Count, "item_count");
   begin
      return Natural (Count (Men));
   end Item_Count;

   function Items (Men   : Menu;
                   Index : Positive) return Item
   is
      use I_Array;

      function C_Mitems (Men : Menu) return Pointer;
      pragma Import (C, C_Mitems, "menu_items");

      P : Pointer := C_Mitems (Men);
   begin
      if P = null or else Index > Item_Count (Men) then
         raise Menu_Exception;
      else
         P := P + ptrdiff_t (C_Int (Index) - 1);
         return P.all;
      end if;
   end Items;

-------------------------------------------------------------------------------
   function Create (Items : Item_Array_Access) return Menu
   is
      function Newmenu (Items : System.Address) return Menu;
      pragma Import (C, Newmenu, "new_menu");

      M   : Menu;
   begin
      pragma Assert (Items.all (Items'Last) = Null_Item);
      if Items.all (Items'Last) /= Null_Item then
         raise Menu_Exception;
      else
         M := Newmenu (Items.all'Address);
         if M = Null_Menu then
            raise Menu_Exception;
         end if;
         return M;
      end if;
   end Create;

   procedure Delete (Men : in out Menu)
   is
      function Free (Men : Menu) return Eti_Error;
      pragma Import (C, Free, "free_menu");

   begin
      Eti_Exception (Free (Men));
      Men := Null_Menu;
   end Delete;

------------------------------------------------------------------------------
   function Driver (Men : Menu;
                    Key : Key_Code) return Driver_Result
   is
      function Driver (Men : Menu;
                       Key : C_Int) return Eti_Error;
      pragma Import (C, Driver, "menu_driver");

      R : constant Eti_Error := Driver (Men, C_Int (Key));
   begin
      case R is
         when E_Unknown_Command =>
            return Unknown_Request;
         when E_No_Match =>
            return No_Match;
         when E_Request_Denied | E_Not_Selectable =>
            return Request_Denied;
         when others =>
            Eti_Exception (R);
            return Menu_Ok;
      end case;
   end Driver;

   procedure Free (IA         : in out Item_Array_Access;
                   Free_Items : Boolean := False)
   is
      procedure Release is new Ada.Unchecked_Deallocation
        (Item_Array, Item_Array_Access);
   begin
      if IA /= null and then Free_Items then
         for I in IA'First .. (IA'Last - 1) loop
            if IA.all (I) /= Null_Item then
               Delete (IA.all (I));
            end if;
         end loop;
      end if;
      Release (IA);
   end Free;

-------------------------------------------------------------------------------
   function Default_Menu_Options return Menu_Option_Set
   is
   begin
      return Get_Options (Null_Menu);
   end Default_Menu_Options;

   function Default_Item_Options return Item_Option_Set
   is
   begin
      return Get_Options (Null_Item);
   end Default_Item_Options;
-------------------------------------------------------------------------------

end Terminal_Interface.Curses.Menus;
AdaCurses-20170708/doc/ada/terminal_interface-curses-termcap__ads.htm0000644000175100001440000002253113076721162024145 0ustar tomusers terminal_interface-curses-termcap.ads

File : terminal_interface-curses-termcap.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                     Terminal_Interface.Curses.Termcap                    --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 2000,2003 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, 1996
--  Version Control:
--  @Revision: 1.4 @
--  Binding Version 01.00
------------------------------------------------------------------------------

package Terminal_Interface.Curses.Termcap is
   pragma Preelaborate (Terminal_Interface.Curses.Termcap);

   --  |=====================================================================
   --  | Man page curs_termcap.3x
   --  |=====================================================================
   --  Not implemented:  tputs (see curs_terminfo)

   type Termcap_String is new String;

   --  |
   function TGoto (Cap : String;
                   Col : Column_Position;
                   Row : Line_Position) return Termcap_String;
   --  AKA: tgoto()

   --  |
   function Get_Entry (Name : String) return Boolean;
   --  AKA: tgetent()

   --  |
   function Get_Flag (Name : String) return Boolean;
   --  AKA: tgetflag()

   --  |
   procedure Get_Number (Name   : String;
                         Value  : out Integer;
                         Result : out Boolean);
   --  AKA: tgetnum()

   --  |
   procedure Get_String (Name   : String;
                         Value  : out String;
                         Result : out Boolean);
   function Get_String (Name : String) return Boolean;
   --  Returns True if the string is found.
   --  AKA: tgetstr()

end Terminal_Interface.Curses.Termcap;
AdaCurses-20170708/doc/ada/terminal_interface__ads.htm0000644000175100001440000001242212145772563021217 0ustar tomusers terminal_interface.ads

File : terminal_interface.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                            Terminal_Interface                            --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998,2006 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, 1996
--  Version Control:
--  @Revision: 1.14 @
--  @Date: 2006/06/25 14:30:22 @
--  Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface is
   pragma Pure (Terminal_Interface);
--
--  Everything is in the child units
--
end Terminal_Interface;
AdaCurses-20170708/doc/ada/terminal_interface-curses-putwin__ads.htm0000644000175100001440000001411613076721162024040 0ustar tomusers terminal_interface-curses-putwin.ads

File : terminal_interface-curses-putwin.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                    Terminal_Interface.Curses.PutWin                      --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 2000,2003 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, 1996
--  Version Control:
--  @Revision: 1.4 @
--  Binding Version 01.00

with Ada.Streams.Stream_IO;

package Terminal_Interface.Curses.PutWin is

   procedure Put_Window (Win  : Window;
                         File : Ada.Streams.Stream_IO.File_Type);

   function Get_Window (File  : Ada.Streams.Stream_IO.File_Type) return Window;

end Terminal_Interface.Curses.PutWin;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-decimal_io__ads.htm0000644000175100001440000002202112340214310026223 0ustar tomusers terminal_interface-curses-text_io-decimal_io.ads

File : terminal_interface-curses-text_io-decimal_io.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Text_IO.Decimal_IO               --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
generic
   type Num is delta <> digits <>;

package Terminal_Interface.Curses.Text_IO.Decimal_IO is

   Default_Fore : Field := Num'Fore;
   Default_Aft  : Field := Num'Aft;
   Default_Exp  : Field := 0;

   procedure Put
     (Win  : Window;
      Item : Num;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp);

   procedure Put
     (Item : Num;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp);

private
   pragma Inline (Put);

end Terminal_Interface.Curses.Text_IO.Decimal_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-fixed_io__ads.htm0000644000175100001440000002170212340214310025731 0ustar tomusers terminal_interface-curses-text_io-fixed_io.ads

File : terminal_interface-curses-text_io-fixed_io.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                Terminal_Interface.Curses.Text_IO.Fixed_IO                --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
generic
   type Num is delta <>;

package Terminal_Interface.Curses.Text_IO.Fixed_IO is

   Default_Fore : Field := Num'Fore;
   Default_Aft  : Field := Num'Aft;
   Default_Exp  : Field := 0;

   procedure Put
     (Win  : Window;
      Item : Num;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp);

   procedure Put
     (Item : Num;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp);

private
   pragma Inline (Put);

end Terminal_Interface.Curses.Text_IO.Fixed_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-fixed_io__adb.htm0000644000175100001440000002637512340214310025723 0ustar tomusers terminal_interface-curses-text_io-fixed_io.adb

File : terminal_interface-curses-text_io-fixed_io.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                Terminal_Interface.Curses.Text_IO.Fixed_IO                --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.11 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Terminal_Interface.Curses.Text_IO.Aux;

package body Terminal_Interface.Curses.Text_IO.Fixed_IO is

   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
   package FIXIO is new Ada.Text_IO.Fixed_IO (Num);

   procedure Put
     (Win  : Window;
      Item : Num;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp)
   is
      Buf : String (1 .. Field'Last);
      Len : Field := Fore + 1 + Aft;
   begin
      if Exp > 0 then
         Len := Len + 1 + Exp;
      end if;
      FIXIO.Put (Buf, Item, Aft, Exp);
      Aux.Put_Buf (Win, Buf, Len, False);
   end Put;

   procedure Put
     (Item : Num;
      Fore : Field := Default_Fore;
      Aft  : Field := Default_Aft;
      Exp  : Field := Default_Exp) is
   begin
      Put (Get_Window, Item, Fore, Aft, Exp);
   end Put;

end Terminal_Interface.Curses.Text_IO.Fixed_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm0000644000175100001440000002043612340214310027163 0ustar tomusers terminal_interface-curses-text_io-enumeration_io.ads

File : terminal_interface-curses-text_io-enumeration_io.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--             Terminal_Interface.Curses.Text_IO.Enumeration_IO             --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
generic
   type Enum is (<>);

package Terminal_Interface.Curses.Text_IO.Enumeration_IO is

   Default_Width : Field := 0;
   Default_Setting : Type_Set := Mixed_Case;

   procedure Put
     (Win   : Window;
      Item  : Enum;
      Width : Field := Default_Width;
      Set   : Type_Set := Default_Setting);

   procedure Put
     (Item  : Enum;
      Width : Field := Default_Width;
      Set   : Type_Set := Default_Setting);

private
   pragma Inline (Put);

end Terminal_Interface.Curses.Text_IO.Enumeration_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm0000644000175100001440000001611212340214310027207 0ustar tomusers terminal_interface-curses-forms-field_types-alpha.ads

File : terminal_interface-curses-forms-field_types-alpha.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--              Terminal_Interface.Curses.Forms.Field_Types.Alpha           --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.Alpha is
   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Alpha);

   type Alpha_Field is new Field_Type
     with record
        Minimum_Field_Width : Natural := 0;
     end record;

   procedure Set_Field_Type (Fld : Field;
                             Typ : Alpha_Field);
   pragma Inline (Set_Field_Type);

end Terminal_Interface.Curses.Forms.Field_Types.Alpha;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm0000644000175100001440000002100712340214310027165 0ustar tomusers terminal_interface-curses-forms-field_types-alpha.adb

File : terminal_interface-curses-forms-field_types-alpha.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--              Terminal_Interface.Curses.Forms.Field_Types.Alpha           --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.13 @
--  @Date: 2014/05/24 21:31:05 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Forms.Field_Types.Alpha is

   procedure Set_Field_Type (Fld : Field;
                             Typ : Alpha_Field)
   is
      function Set_Fld_Type (F    : Field := Fld;
                             Arg1 : C_Int) return Eti_Error;
      pragma Import (C, Set_Fld_Type, "set_field_type_alpha");

   begin
      Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width)));
      Wrap_Builtin (Fld, Typ);
   end Set_Field_Type;

end Terminal_Interface.Curses.Forms.Field_Types.Alpha;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm0000644000175100001440000001626112340214310030577 0ustar tomusers terminal_interface-curses-forms-field_types-alphanumeric.ads

File : terminal_interface-curses-forms-field_types-alphanumeric.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--          Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric        --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is
   pragma Preelaborate
     (Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric);

   type AlphaNumeric_Field is new Field_Type
     with record
        Minimum_Field_Width : Natural := 0;
     end record;

   procedure Set_Field_Type (Fld : Field;
                             Typ : AlphaNumeric_Field);
   pragma Inline (Set_Field_Type);

end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric;
AdaCurses-20170708/doc/ada/terminal_interface-curses__adb.htm0000644000175100001440000121721412340214310022461 0ustar tomusers terminal_interface-curses.adb

File : terminal_interface-curses.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                        Terminal_Interface.Curses                         --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.14 @
--  @Date: 2014/05/24 21:31:05 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with System;

with Terminal_Interface.Curses.Aux;
with Interfaces.C;                  use Interfaces.C;
with Interfaces.C.Strings;          use Interfaces.C.Strings;
with Ada.Characters.Handling;       use Ada.Characters.Handling;
with Ada.Strings.Fixed;

package body Terminal_Interface.Curses is

   use Aux;
   use type System.Bit_Order;

   package ASF renames Ada.Strings.Fixed;

   type chtype_array is array (size_t range <>)
      of aliased Attributed_Character;
   pragma Convention (C, chtype_array);

------------------------------------------------------------------------------
   function Key_Name (Key : Real_Key_Code) return String
   is
      function Keyname (K : C_Int) return chars_ptr;
      pragma Import (C, Keyname, "keyname");

      Ch : Character;
   begin
      if Key <= Character'Pos (Character'Last) then
         Ch := Character'Val (Key);
         if Is_Control (Ch) then
            return Un_Control (Attributed_Character'(Ch    => Ch,
                                                     Color => Color_Pair'First,
                                                     Attr  => Normal_Video));
         elsif Is_Graphic (Ch) then
            declare
               S : String (1 .. 1);
            begin
               S (1) := Ch;
               return S;
            end;
         else
            return "";
         end if;
      else
         return Fill_String (Keyname (C_Int (Key)));
      end if;
   end Key_Name;

   procedure Key_Name (Key  :  Real_Key_Code;
                       Name : out String)
   is
   begin
      ASF.Move (Key_Name (Key), Name);
   end Key_Name;

------------------------------------------------------------------------------
   procedure Init_Screen
   is
      function Initscr return Window;
      pragma Import (C, Initscr, "initscr");

      W : Window;
   begin
      W := Initscr;
      if W = Null_Window then
         raise Curses_Exception;
      end if;
   end Init_Screen;

   procedure End_Windows
   is
      function Endwin return C_Int;
      pragma Import (C, Endwin, "endwin");
   begin
      if Endwin = Curses_Err then
         raise Curses_Exception;
      end if;
   end End_Windows;

   function Is_End_Window return Boolean
   is
      function Isendwin return Curses_Bool;
      pragma Import (C, Isendwin, "isendwin");
   begin
      if Isendwin = Curses_Bool_False then
         return False;
      else
         return True;
      end if;
   end Is_End_Window;
------------------------------------------------------------------------------
   procedure Move_Cursor (Win    : Window := Standard_Window;
                          Line   : Line_Position;
                          Column : Column_Position)
   is
      function Wmove (Win    : Window;
                      Line   : C_Int;
                      Column : C_Int
                     ) return C_Int;
      pragma Import (C, Wmove, "wmove");
   begin
      if Wmove (Win, C_Int (Line), C_Int (Column)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Move_Cursor;
------------------------------------------------------------------------------
   procedure Add (Win : Window := Standard_Window;
                  Ch  : Attributed_Character)
   is
      function Waddch (W  : Window;
                       Ch : Attributed_Character) return C_Int;
      pragma Import (C, Waddch, "waddch");
   begin
      if Waddch (Win, Ch) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Add;

   procedure Add (Win : Window := Standard_Window;
                  Ch  : Character)
   is
   begin
      Add (Win,
           Attributed_Character'(Ch    => Ch,
                                 Color => Color_Pair'First,
                                 Attr  => Normal_Video));
   end Add;

   procedure Add
     (Win    : Window := Standard_Window;
      Line   : Line_Position;
      Column : Column_Position;
      Ch     : Attributed_Character)
   is
      function mvwaddch (W  : Window;
                         Y  : C_Int;
                         X  : C_Int;
                         Ch : Attributed_Character) return C_Int;
      pragma Import (C, mvwaddch, "mvwaddch");
   begin
      if mvwaddch (Win, C_Int (Line),
                   C_Int (Column),
                   Ch) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Add;

   procedure Add
     (Win    : Window := Standard_Window;
      Line   : Line_Position;
      Column : Column_Position;
      Ch     : Character)
   is
   begin
      Add (Win,
           Line,
           Column,
           Attributed_Character'(Ch    => Ch,
                                 Color => Color_Pair'First,
                                 Attr  => Normal_Video));
   end Add;

   procedure Add_With_Immediate_Echo
     (Win : Window := Standard_Window;
      Ch  : Attributed_Character)
   is
      function Wechochar (W  : Window;
                          Ch : Attributed_Character) return C_Int;
      pragma Import (C, Wechochar, "wechochar");
   begin
      if Wechochar (Win, Ch) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Add_With_Immediate_Echo;

   procedure Add_With_Immediate_Echo
     (Win : Window := Standard_Window;
      Ch  : Character)
   is
   begin
      Add_With_Immediate_Echo
        (Win,
         Attributed_Character'(Ch    => Ch,
                               Color => Color_Pair'First,
                               Attr  => Normal_Video));
   end Add_With_Immediate_Echo;
------------------------------------------------------------------------------
   function Create (Number_Of_Lines       : Line_Count;
                    Number_Of_Columns     : Column_Count;
                    First_Line_Position   : Line_Position;
                    First_Column_Position : Column_Position) return Window
   is
      function Newwin (Number_Of_Lines       : C_Int;
                       Number_Of_Columns     : C_Int;
                       First_Line_Position   : C_Int;
                       First_Column_Position : C_Int) return Window;
      pragma Import (C, Newwin, "newwin");

      W : Window;
   begin
      W := Newwin (C_Int (Number_Of_Lines),
                   C_Int (Number_Of_Columns),
                   C_Int (First_Line_Position),
                   C_Int (First_Column_Position));
      if W = Null_Window then
         raise Curses_Exception;
      end if;
      return W;
   end Create;

   procedure Delete (Win : in out Window)
   is
      function Wdelwin (W : Window) return C_Int;
      pragma Import (C, Wdelwin, "delwin");
   begin
      if Wdelwin (Win) = Curses_Err then
         raise Curses_Exception;
      end if;
      Win := Null_Window;
   end Delete;

   function Sub_Window
     (Win                   : Window := Standard_Window;
      Number_Of_Lines       : Line_Count;
      Number_Of_Columns     : Column_Count;
      First_Line_Position   : Line_Position;
      First_Column_Position : Column_Position) return Window
   is
      function Subwin
        (Win                   : Window;
         Number_Of_Lines       : C_Int;
         Number_Of_Columns     : C_Int;
         First_Line_Position   : C_Int;
         First_Column_Position : C_Int) return Window;
      pragma Import (C, Subwin, "subwin");

      W : Window;
   begin
      W := Subwin (Win,
                   C_Int (Number_Of_Lines),
                   C_Int (Number_Of_Columns),
                   C_Int (First_Line_Position),
                   C_Int (First_Column_Position));
      if W = Null_Window then
         raise Curses_Exception;
      end if;
      return W;
   end Sub_Window;

   function Derived_Window
     (Win                   : Window := Standard_Window;
      Number_Of_Lines       : Line_Count;
      Number_Of_Columns     : Column_Count;
      First_Line_Position   : Line_Position;
      First_Column_Position : Column_Position) return Window
   is
      function Derwin
        (Win                   : Window;
         Number_Of_Lines       : C_Int;
         Number_Of_Columns     : C_Int;
         First_Line_Position   : C_Int;
         First_Column_Position : C_Int) return Window;
      pragma Import (C, Derwin, "derwin");

      W : Window;
   begin
      W := Derwin (Win,
                   C_Int (Number_Of_Lines),
                   C_Int (Number_Of_Columns),
                   C_Int (First_Line_Position),
                   C_Int (First_Column_Position));
      if W = Null_Window then
         raise Curses_Exception;
      end if;
      return W;
   end Derived_Window;

   function Duplicate (Win : Window) return Window
   is
      function Dupwin (Win : Window) return Window;
      pragma Import (C, Dupwin, "dupwin");

      W : constant Window := Dupwin (Win);
   begin
      if W = Null_Window then
         raise Curses_Exception;
      end if;
      return W;
   end Duplicate;

   procedure Move_Window (Win    : Window;
                          Line   : Line_Position;
                          Column : Column_Position)
   is
      function Mvwin (Win    : Window;
                      Line   : C_Int;
                      Column : C_Int) return C_Int;
      pragma Import (C, Mvwin, "mvwin");
   begin
      if Mvwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Move_Window;

   procedure Move_Derived_Window (Win    : Window;
                                  Line   : Line_Position;
                                  Column : Column_Position)
   is
      function Mvderwin (Win    : Window;
                         Line   : C_Int;
                         Column : C_Int) return C_Int;
      pragma Import (C, Mvderwin, "mvderwin");
   begin
      if Mvderwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Move_Derived_Window;

   procedure Set_Synch_Mode (Win  : Window  := Standard_Window;
                             Mode : Boolean := False)
   is
      function Syncok (Win  : Window;
                       Mode : Curses_Bool) return C_Int;
      pragma Import (C, Syncok, "syncok");
   begin
      if Syncok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Set_Synch_Mode;
------------------------------------------------------------------------------
   procedure Add (Win : Window := Standard_Window;
                  Str : String;
                  Len : Integer := -1)
   is
      function Waddnstr (Win : Window;
                         Str : char_array;
                         Len : C_Int := -1) return C_Int;
      pragma Import (C, Waddnstr, "waddnstr");

      Txt    : char_array (0 .. Str'Length);
      Length : size_t;
   begin
      To_C (Str, Txt, Length);
      if Waddnstr (Win, Txt, C_Int (Len)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Add;

   procedure Add
     (Win    : Window := Standard_Window;
      Line   : Line_Position;
      Column : Column_Position;
      Str    : String;
      Len    : Integer := -1)
   is
   begin
      Move_Cursor (Win, Line, Column);
      Add (Win, Str, Len);
   end Add;
------------------------------------------------------------------------------
   procedure Add
     (Win : Window := Standard_Window;
      Str : Attributed_String;
      Len : Integer := -1)
   is
      function Waddchnstr (Win : Window;
                           Str : chtype_array;
                           Len : C_Int := -1) return C_Int;
      pragma Import (C, Waddchnstr, "waddchnstr");

      Txt : chtype_array (0 .. Str'Length);
   begin
      for Length in 1 .. size_t (Str'Length) loop
         Txt (Length - 1) := Str (Natural (Length));
      end loop;
      Txt (Str'Length) := Default_Character;
      if Waddchnstr (Win,
                     Txt,
                     C_Int (Len)) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Add;

   procedure Add
     (Win    : Window := Standard_Window;
      Line   : Line_Position;
      Column : Column_Position;
      Str    : Attributed_String;
      Len    : Integer := -1)
   is
   begin
      Move_Cursor (Win, Line, Column);
      Add (Win, Str, Len);
   end Add;
------------------------------------------------------------------------------
   procedure Border
     (Win                       : Window := Standard_Window;
      Left_Side_Symbol          : Attributed_Character := Default_Character;
      Right_Side_Symbol         : Attributed_Character := Default_Character;
      Top_Side_Symbol           : Attributed_Character := Default_Character;
      Bottom_Side_Symbol        : Attributed_Character := Default_Character;
      Upper_Left_Corner_Symbol  : Attributed_Character := Default_Character;
      Upper_Right_Corner_Symbol : Attributed_Character := Default_Character;
      Lower_Left_Corner_Symbol  : Attributed_Character := Default_Character;
      Lower_Right_Corner_Symbol : Attributed_Character := Default_Character)
   is
      function Wborder (W   : Window;
                        LS  : Attributed_Character;
                        RS  : Attributed_Character;
                        TS  : Attributed_Character;
                        BS  : Attributed_Character;
                        ULC : Attributed_Character;
                        URC : Attributed_Character;
                        LLC : Attributed_Character;
                        LRC : Attributed_Character) return C_Int;
      pragma Import (C, Wborder, "wborder");
   begin
      if Wborder (Win,
                  Left_Side_Symbol,
                  Right_Side_Symbol,
                  Top_Side_Symbol,
                  Bottom_Side_Symbol,
                  Upper_Left_Corner_Symbol,
                  Upper_Right_Corner_Symbol,
                  Lower_Left_Corner_Symbol,
                  Lower_Right_Corner_Symbol) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Border;

   procedure Box
     (Win               : Window := Standard_Window;
      Vertical_Symbol   : Attributed_Character := Default_Character;
      Horizontal_Symbol : Attributed_Character := Default_Character)
   is
   begin
      Border (Win,
              Vertical_Symbol, Vertical_Symbol,
              Horizontal_Symbol, Horizontal_Symbol);
   end Box;

   procedure Horizontal_Line
     (Win         : Window := Standard_Window;
      Line_Size   : Natural;
      Line_Symbol : Attributed_Character := Default_Character)
   is
      function Whline (W   : Window;
                       Ch  : Attributed_Character;
                       Len : C_Int) return C_Int;
      pragma Import (C, Whline, "whline");
   begin
      if Whline (Win,
                 Line_Symbol,
                 C_Int (Line_Size)) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Horizontal_Line;

   procedure Vertical_Line
     (Win         : Window := Standard_Window;
      Line_Size   : Natural;
      Line_Symbol : Attributed_Character := Default_Character)
   is
      function Wvline (W   : Window;
                       Ch  : Attributed_Character;
                       Len : C_Int) return C_Int;
      pragma Import (C, Wvline, "wvline");
   begin
      if Wvline (Win,
                 Line_Symbol,
                 C_Int (Line_Size)) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Vertical_Line;

------------------------------------------------------------------------------
   function Get_Keystroke (Win : Window := Standard_Window)
     return Real_Key_Code
   is
      function Wgetch (W : Window) return C_Int;
      pragma Import (C, Wgetch, "wgetch");

      C : constant C_Int := Wgetch (Win);
   begin
      if C = Curses_Err then
         return Key_None;
      else
         return Real_Key_Code (C);
      end if;
   end Get_Keystroke;

   procedure Undo_Keystroke (Key : Real_Key_Code)
   is
      function Ungetch (Ch : C_Int) return C_Int;
      pragma Import (C, Ungetch, "ungetch");
   begin
      if Ungetch (C_Int (Key)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Undo_Keystroke;

   function Has_Key (Key : Special_Key_Code) return Boolean
   is
      function Haskey (Key : C_Int) return C_Int;
      pragma Import (C, Haskey, "has_key");
   begin
      if Haskey (C_Int (Key)) = Curses_False then
         return False;
      else
         return True;
      end if;
   end Has_Key;

   function Is_Function_Key (Key : Special_Key_Code) return Boolean
   is
      L : constant Special_Key_Code  := Special_Key_Code (Natural (Key_F0) +
        Natural (Function_Key_Number'Last));
   begin
      if (Key >= Key_F0) and then (Key <= L) then
         return True;
      else
         return False;
      end if;
   end Is_Function_Key;

   function Function_Key (Key : Real_Key_Code)
                          return Function_Key_Number
   is
   begin
      if Is_Function_Key (Key) then
         return Function_Key_Number (Key - Key_F0);
      else
         raise Constraint_Error;
      end if;
   end Function_Key;

   function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code
   is
   begin
      return Real_Key_Code (Natural (Key_F0) + Natural (Key));
   end Function_Key_Code;
------------------------------------------------------------------------------
   procedure Standout (Win : Window  := Standard_Window;
                       On  : Boolean := True)
   is
      function wstandout (Win : Window) return C_Int;
      pragma Import (C, wstandout, "wstandout");
      function wstandend (Win : Window) return C_Int;
      pragma Import (C, wstandend, "wstandend");

      Err : C_Int;
   begin
      if On then
         Err := wstandout (Win);
      else
         Err := wstandend (Win);
      end if;
      if Err = Curses_Err then
         raise Curses_Exception;
      end if;
   end Standout;

   procedure Switch_Character_Attribute
     (Win  : Window := Standard_Window;
      Attr : Character_Attribute_Set := Normal_Video;
      On   : Boolean := True)
   is
      function Wattron (Win    : Window;
                        C_Attr : Attributed_Character) return C_Int;
      pragma Import (C, Wattron, "wattr_on");
      function Wattroff (Win    : Window;
                         C_Attr : Attributed_Character) return C_Int;
      pragma Import (C, Wattroff, "wattr_off");
      --  In Ada we use the On Boolean to control whether or not we want to
      --  switch on or off the attributes in the set.
      Err : C_Int;
      AC  : constant Attributed_Character := (Ch    => Character'First,
                                              Color => Color_Pair'First,
                                              Attr  => Attr);
   begin
      if On then
         Err := Wattron  (Win, AC);
      else
         Err := Wattroff (Win, AC);
      end if;
      if Err = Curses_Err then
         raise Curses_Exception;
      end if;
   end Switch_Character_Attribute;

   procedure Set_Character_Attributes
     (Win   : Window := Standard_Window;
      Attr  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First)
   is
      function Wattrset (Win    : Window;
                         C_Attr : Attributed_Character) return C_Int;
      pragma Import (C, Wattrset, "wattrset"); -- ??? wattr_set
   begin
      if Wattrset (Win, (Ch => Character'First,
                         Color => Color,
                         Attr => Attr)) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Set_Character_Attributes;

   function Get_Character_Attribute (Win : Window := Standard_Window)
                                     return Character_Attribute_Set
   is
      function Wattrget (Win : Window;
                         Atr : access Attributed_Character;
                         Col : access C_Short;
                         Opt : System.Address) return C_Int;
      pragma Import (C, Wattrget, "wattr_get");

      Attr : aliased Attributed_Character;
      Col  : aliased C_Short;
      Res  : constant C_Int := Wattrget (Win, Attr'Access, Col'Access,
                                         System.Null_Address);
   begin
      if Res = Curses_Ok then
         return Attr.Attr;
      else
         raise Curses_Exception;
      end if;
   end Get_Character_Attribute;

   function Get_Character_Attribute (Win : Window := Standard_Window)
                                     return Color_Pair
   is
      function Wattrget (Win : Window;
                         Atr : access Attributed_Character;
                         Col : access C_Short;
                         Opt : System.Address) return C_Int;
      pragma Import (C, Wattrget, "wattr_get");

      Attr : aliased Attributed_Character;
      Col  : aliased C_Short;
      Res  : constant C_Int := Wattrget (Win, Attr'Access, Col'Access,
                                         System.Null_Address);
   begin
      if Res = Curses_Ok then
         return Attr.Color;
      else
         raise Curses_Exception;
      end if;
   end Get_Character_Attribute;

   procedure Set_Color (Win  : Window := Standard_Window;
                        Pair : Color_Pair)
   is
      function Wset_Color (Win   : Window;
                           Color : C_Short;
                           Opts  : C_Void_Ptr) return C_Int;
      pragma Import (C, Wset_Color, "wcolor_set");
   begin
      if Wset_Color (Win,
                     C_Short (Pair),
                     C_Void_Ptr (System.Null_Address)) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Set_Color;

   procedure Change_Attributes
     (Win   : Window := Standard_Window;
      Count : Integer := -1;
      Attr  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First)
   is
      function Wchgat (Win   : Window;
                       Cnt   : C_Int;
                       Attr  : Attributed_Character;
                       Color : C_Short;
                       Opts  : System.Address := System.Null_Address)
                       return C_Int;
      pragma Import (C, Wchgat, "wchgat");
   begin
      if Wchgat (Win,
                 C_Int (Count),
                 (Ch => Character'First,
                  Color => Color_Pair'First,
                  Attr => Attr),
                 C_Short (Color)) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Change_Attributes;

   procedure Change_Attributes
     (Win    : Window := Standard_Window;
      Line   : Line_Position := Line_Position'First;
      Column : Column_Position := Column_Position'First;
      Count  : Integer := -1;
      Attr   : Character_Attribute_Set := Normal_Video;
      Color  : Color_Pair := Color_Pair'First)
   is
   begin
      Move_Cursor (Win, Line, Column);
      Change_Attributes (Win, Count, Attr, Color);
   end Change_Attributes;
------------------------------------------------------------------------------
   procedure Beep
   is
      function Beeper return C_Int;
      pragma Import (C, Beeper, "beep");
   begin
      if Beeper = Curses_Err then
         raise Curses_Exception;
      end if;
   end Beep;

   procedure Flash_Screen
   is
      function Flash return C_Int;
      pragma Import (C, Flash, "flash");
   begin
      if Flash = Curses_Err then
         raise Curses_Exception;
      end if;
   end Flash_Screen;
------------------------------------------------------------------------------
   procedure Set_Cbreak_Mode (SwitchOn : Boolean := True)
   is
      function Cbreak return C_Int;
      pragma Import (C, Cbreak, "cbreak");
      function NoCbreak return C_Int;
      pragma Import (C, NoCbreak, "nocbreak");

      Err : C_Int;
   begin
      if SwitchOn then
         Err := Cbreak;
      else
         Err := NoCbreak;
      end if;
      if Err = Curses_Err then
         raise Curses_Exception;
      end if;
   end Set_Cbreak_Mode;

   procedure Set_Raw_Mode (SwitchOn : Boolean := True)
   is
      function Raw return C_Int;
      pragma Import (C, Raw, "raw");
      function NoRaw return C_Int;
      pragma Import (C, NoRaw, "noraw");

      Err : C_Int;
   begin
      if SwitchOn then
         Err := Raw;
      else
         Err := NoRaw;
      end if;
      if Err = Curses_Err then
         raise Curses_Exception;
      end if;
   end Set_Raw_Mode;

   procedure Set_Echo_Mode (SwitchOn : Boolean := True)
   is
      function Echo return C_Int;
      pragma Import (C, Echo, "echo");
      function NoEcho return C_Int;
      pragma Import (C, NoEcho, "noecho");

      Err : C_Int;
   begin
      if SwitchOn then
         Err := Echo;
      else
         Err := NoEcho;
      end if;
      if Err = Curses_Err then
         raise Curses_Exception;
      end if;
   end Set_Echo_Mode;

   procedure Set_Meta_Mode (Win      : Window := Standard_Window;
                            SwitchOn : Boolean := True)
   is
      function Meta (W : Window; Mode : Curses_Bool) return C_Int;
      pragma Import (C, Meta, "meta");
   begin
      if Meta (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Set_Meta_Mode;

   procedure Set_KeyPad_Mode (Win      : Window := Standard_Window;
                              SwitchOn : Boolean := True)
   is
      function Keypad (W : Window; Mode : Curses_Bool) return C_Int;
      pragma Import (C, Keypad, "keypad");
   begin
      if Keypad (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Set_KeyPad_Mode;

   function Get_KeyPad_Mode (Win : Window := Standard_Window)
                             return Boolean
   is
      function Is_Keypad (W : Window) return Curses_Bool;
      pragma Import (C, Is_Keypad, "is_keypad");
   begin
      return (Is_Keypad (Win) /= Curses_Bool_False);
   end Get_KeyPad_Mode;

   procedure Half_Delay (Amount : Half_Delay_Amount)
   is
      function Halfdelay (Amount : C_Int) return C_Int;
      pragma Import (C, Halfdelay, "halfdelay");
   begin
      if Halfdelay (C_Int (Amount)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Half_Delay;

   procedure Set_Flush_On_Interrupt_Mode
     (Win  : Window := Standard_Window;
      Mode : Boolean := True)
   is
      function Intrflush (Win : Window; Mode : Curses_Bool) return C_Int;
      pragma Import (C, Intrflush, "intrflush");
   begin
      if Intrflush (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Set_Flush_On_Interrupt_Mode;

   procedure Set_Queue_Interrupt_Mode
     (Win   : Window := Standard_Window;
      Flush : Boolean := True)
   is
      procedure Qiflush;
      pragma Import (C, Qiflush, "qiflush");
      procedure No_Qiflush;
      pragma Import (C, No_Qiflush, "noqiflush");
   begin
      if Win = Null_Window then
         raise Curses_Exception;
      end if;
      if Flush then
         Qiflush;
      else
         No_Qiflush;
      end if;
   end Set_Queue_Interrupt_Mode;

   procedure Set_NoDelay_Mode
     (Win  : Window := Standard_Window;
      Mode : Boolean := False)
   is
      function Nodelay (Win : Window; Mode : Curses_Bool) return C_Int;
      pragma Import (C, Nodelay, "nodelay");
   begin
      if Nodelay (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Set_NoDelay_Mode;

   procedure Set_Timeout_Mode (Win    : Window := Standard_Window;
                               Mode   : Timeout_Mode;
                               Amount : Natural)
   is
      procedure Wtimeout (Win : Window; Amount : C_Int);
      pragma Import (C, Wtimeout, "wtimeout");

      Time : C_Int;
   begin
      case Mode is
         when Blocking     => Time := -1;
         when Non_Blocking => Time := 0;
         when Delayed      =>
            if Amount = 0 then
               raise Constraint_Error;
            end if;
            Time := C_Int (Amount);
      end case;
      Wtimeout (Win, Time);
   end Set_Timeout_Mode;

   procedure Set_Escape_Timer_Mode
     (Win       : Window := Standard_Window;
      Timer_Off : Boolean := False)
   is
      function Notimeout (Win : Window; Mode : Curses_Bool) return C_Int;
      pragma Import (C, Notimeout, "notimeout");
   begin
      if Notimeout (Win, Curses_Bool (Boolean'Pos (Timer_Off)))
        = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Set_Escape_Timer_Mode;

------------------------------------------------------------------------------
   procedure Set_NL_Mode (SwitchOn : Boolean := True)
   is
      function NL return C_Int;
      pragma Import (C, NL, "nl");
      function NoNL return C_Int;
      pragma Import (C, NoNL, "nonl");

      Err : C_Int;
   begin
      if SwitchOn then
         Err := NL;
      else
         Err := NoNL;
      end if;
      if Err = Curses_Err then
         raise Curses_Exception;
      end if;
   end Set_NL_Mode;

   procedure Clear_On_Next_Update
     (Win      : Window := Standard_Window;
      Do_Clear : Boolean := True)
   is
      function Clear_Ok (W : Window; Flag : Curses_Bool) return C_Int;
      pragma Import (C, Clear_Ok, "clearok");
   begin
      if Clear_Ok (Win, Curses_Bool (Boolean'Pos (Do_Clear))) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Clear_On_Next_Update;

   procedure Use_Insert_Delete_Line
     (Win    : Window := Standard_Window;
      Do_Idl : Boolean := True)
   is
      function IDL_Ok (W : Window; Flag : Curses_Bool) return C_Int;
      pragma Import (C, IDL_Ok, "idlok");
   begin
      if IDL_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idl))) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Use_Insert_Delete_Line;

   procedure Use_Insert_Delete_Character
     (Win    : Window := Standard_Window;
      Do_Idc : Boolean := True)
   is
      procedure IDC_Ok (W : Window; Flag : Curses_Bool);
      pragma Import (C, IDC_Ok, "idcok");
   begin
      IDC_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idc)));
   end Use_Insert_Delete_Character;

   procedure Leave_Cursor_After_Update
     (Win      : Window := Standard_Window;
      Do_Leave : Boolean := True)
   is
      function Leave_Ok (W : Window; Flag : Curses_Bool) return C_Int;
      pragma Import (C, Leave_Ok, "leaveok");
   begin
      if Leave_Ok (Win, Curses_Bool (Boolean'Pos (Do_Leave))) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Leave_Cursor_After_Update;

   procedure Immediate_Update_Mode
     (Win  : Window := Standard_Window;
      Mode : Boolean := False)
   is
      procedure Immedok (Win : Window; Mode : Curses_Bool);
      pragma Import (C, Immedok, "immedok");
   begin
      Immedok (Win, Curses_Bool (Boolean'Pos (Mode)));
   end Immediate_Update_Mode;

   procedure Allow_Scrolling
     (Win  : Window  := Standard_Window;
      Mode : Boolean := False)
   is
      function Scrollok (Win : Window; Mode : Curses_Bool) return C_Int;
      pragma Import (C, Scrollok, "scrollok");
   begin
      if Scrollok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Allow_Scrolling;

   function Scrolling_Allowed (Win : Window := Standard_Window)
                               return Boolean
   is
      function Is_Scroll_Ok (W : Window) return Curses_Bool;
      pragma Import (C, Is_Scroll_Ok, "is_scrollok");
   begin
      return (Is_Scroll_Ok (Win) /= Curses_Bool_False);
   end Scrolling_Allowed;

   procedure Set_Scroll_Region
     (Win         : Window := Standard_Window;
      Top_Line    : Line_Position;
      Bottom_Line : Line_Position)
   is
      function Wsetscrreg (Win : Window;
                           Lin : C_Int;
                           Col : C_Int) return C_Int;
      pragma Import (C, Wsetscrreg, "wsetscrreg");
   begin
      if Wsetscrreg (Win, C_Int (Top_Line), C_Int (Bottom_Line))
        = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Set_Scroll_Region;
------------------------------------------------------------------------------
   procedure Update_Screen
   is
      function Do_Update return C_Int;
      pragma Import (C, Do_Update, "doupdate");
   begin
      if Do_Update = Curses_Err then
         raise Curses_Exception;
      end if;
   end Update_Screen;

   procedure Refresh (Win : Window := Standard_Window)
   is
      function Wrefresh (W : Window) return C_Int;
      pragma Import (C, Wrefresh, "wrefresh");
   begin
      if Wrefresh (Win) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Refresh;

   procedure Refresh_Without_Update
     (Win : Window := Standard_Window)
   is
      function Wnoutrefresh (W : Window) return C_Int;
      pragma Import (C, Wnoutrefresh, "wnoutrefresh");
   begin
      if Wnoutrefresh (Win) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Refresh_Without_Update;

   procedure Redraw (Win : Window := Standard_Window)
   is
      function Redrawwin (Win : Window) return C_Int;
      pragma Import (C, Redrawwin, "redrawwin");
   begin
      if Redrawwin (Win) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Redraw;

   procedure Redraw
     (Win        : Window := Standard_Window;
      Begin_Line : Line_Position;
      Line_Count : Positive)
   is
      function Wredrawln (Win : Window; First : C_Int; Cnt : C_Int)
                          return C_Int;
      pragma Import (C, Wredrawln, "wredrawln");
   begin
      if Wredrawln (Win,
                    C_Int (Begin_Line),
                    C_Int (Line_Count)) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Redraw;

------------------------------------------------------------------------------
   procedure Erase (Win : Window := Standard_Window)
   is
      function Werase (W : Window) return C_Int;
      pragma Import (C, Werase, "werase");
   begin
      if Werase (Win) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Erase;

   procedure Clear (Win : Window := Standard_Window)
   is
      function Wclear (W : Window) return C_Int;
      pragma Import (C, Wclear, "wclear");
   begin
      if Wclear (Win) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Clear;

   procedure Clear_To_End_Of_Screen (Win : Window := Standard_Window)
   is
      function Wclearbot (W : Window) return C_Int;
      pragma Import (C, Wclearbot, "wclrtobot");
   begin
      if Wclearbot (Win) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Clear_To_End_Of_Screen;

   procedure Clear_To_End_Of_Line (Win : Window := Standard_Window)
   is
      function Wcleareol (W : Window) return C_Int;
      pragma Import (C, Wcleareol, "wclrtoeol");
   begin
      if Wcleareol (Win) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Clear_To_End_Of_Line;
------------------------------------------------------------------------------
   procedure Set_Background
     (Win : Window := Standard_Window;
      Ch  : Attributed_Character)
   is
      procedure WBackground (W : Window; Ch : Attributed_Character);
      pragma Import (C, WBackground, "wbkgdset");
   begin
      WBackground (Win, Ch);
   end Set_Background;

   procedure Change_Background
     (Win : Window := Standard_Window;
      Ch  : Attributed_Character)
   is
      function WChangeBkgd (W : Window; Ch : Attributed_Character)
         return C_Int;
      pragma Import (C, WChangeBkgd, "wbkgd");
   begin
      if WChangeBkgd (Win, Ch) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Change_Background;

   function Get_Background (Win : Window := Standard_Window)
     return Attributed_Character
   is
      function Wgetbkgd (Win : Window) return Attributed_Character;
      pragma Import (C, Wgetbkgd, "getbkgd");
   begin
      return Wgetbkgd (Win);
   end Get_Background;
------------------------------------------------------------------------------
   procedure Change_Lines_Status (Win   : Window := Standard_Window;
                                  Start : Line_Position;
                                  Count : Positive;
                                  State : Boolean)
   is
      function Wtouchln (Win : Window;
                         Sta : C_Int;
                         Cnt : C_Int;
                         Chg : C_Int) return C_Int;
      pragma Import (C, Wtouchln, "wtouchln");
   begin
      if Wtouchln (Win, C_Int (Start), C_Int (Count),
                   C_Int (Boolean'Pos (State))) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Change_Lines_Status;

   procedure Touch (Win : Window := Standard_Window)
   is
      Y : Line_Position;
      X : Column_Position;
   begin
      Get_Size (Win, Y, X);
      pragma Warnings (Off, X);         --  unreferenced
      Change_Lines_Status (Win, 0, Positive (Y), True);
   end Touch;

   procedure Untouch (Win : Window := Standard_Window)
   is
      Y : Line_Position;
      X : Column_Position;
   begin
      Get_Size (Win, Y, X);
      pragma Warnings (Off, X);         --  unreferenced
      Change_Lines_Status (Win, 0, Positive (Y), False);
   end Untouch;

   procedure Touch (Win   : Window := Standard_Window;
                    Start : Line_Position;
                    Count : Positive)
   is
   begin
      Change_Lines_Status (Win, Start, Count, True);
   end Touch;

   function Is_Touched
     (Win  : Window := Standard_Window;
      Line : Line_Position) return Boolean
   is
      function WLineTouched (W : Window; L : C_Int) return Curses_Bool;
      pragma Import (C, WLineTouched, "is_linetouched");
   begin
      if WLineTouched (Win, C_Int (Line)) = Curses_Bool_False then
         return False;
      else
         return True;
      end if;
   end Is_Touched;

   function Is_Touched
     (Win : Window := Standard_Window) return Boolean
   is
      function WWinTouched (W : Window) return Curses_Bool;
      pragma Import (C, WWinTouched, "is_wintouched");
   begin
      if WWinTouched (Win) = Curses_Bool_False then
         return False;
      else
         return True;
      end if;
   end Is_Touched;
------------------------------------------------------------------------------
   procedure Copy
     (Source_Window            : Window;
      Destination_Window       : Window;
      Source_Top_Row           : Line_Position;
      Source_Left_Column       : Column_Position;
      Destination_Top_Row      : Line_Position;
      Destination_Left_Column  : Column_Position;
      Destination_Bottom_Row   : Line_Position;
      Destination_Right_Column : Column_Position;
      Non_Destructive_Mode     : Boolean := True)
   is
      function Copywin (Src : Window;
                        Dst : Window;
                        Str : C_Int;
                        Slc : C_Int;
                        Dtr : C_Int;
                        Dlc : C_Int;
                        Dbr : C_Int;
                        Drc : C_Int;
                        Ndm : C_Int) return C_Int;
      pragma Import (C, Copywin, "copywin");
   begin
      if Copywin (Source_Window,
                  Destination_Window,
                  C_Int (Source_Top_Row),
                  C_Int (Source_Left_Column),
                  C_Int (Destination_Top_Row),
                  C_Int (Destination_Left_Column),
                  C_Int (Destination_Bottom_Row),
                  C_Int (Destination_Right_Column),
                  Boolean'Pos (Non_Destructive_Mode)
                 ) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Copy;

   procedure Overwrite
     (Source_Window      : Window;
      Destination_Window : Window)
   is
      function Overwrite (Src : Window; Dst : Window) return C_Int;
      pragma Import (C, Overwrite, "overwrite");
   begin
      if Overwrite (Source_Window, Destination_Window) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Overwrite;

   procedure Overlay
     (Source_Window      : Window;
      Destination_Window : Window)
   is
      function Overlay (Src : Window; Dst : Window) return C_Int;
      pragma Import (C, Overlay, "overlay");
   begin
      if Overlay (Source_Window, Destination_Window) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Overlay;

------------------------------------------------------------------------------
   procedure Insert_Delete_Lines
     (Win   : Window := Standard_Window;
      Lines : Integer       := 1) -- default is to insert one line above
   is
      function Winsdelln (W : Window; N : C_Int) return C_Int;
      pragma Import (C, Winsdelln, "winsdelln");
   begin
      if Winsdelln (Win, C_Int (Lines)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Insert_Delete_Lines;

   procedure Delete_Line (Win : Window := Standard_Window)
   is
   begin
      Insert_Delete_Lines (Win, -1);
   end Delete_Line;

   procedure Insert_Line (Win : Window := Standard_Window)
   is
   begin
      Insert_Delete_Lines (Win, 1);
   end Insert_Line;
------------------------------------------------------------------------------

   procedure Get_Size
     (Win               : Window := Standard_Window;
      Number_Of_Lines   : out Line_Count;
      Number_Of_Columns : out Column_Count)
   is
      function GetMaxY (W : Window) return C_Int;
      pragma Import (C, GetMaxY, "getmaxy");

      function GetMaxX (W : Window) return C_Int;
      pragma Import (C, GetMaxX, "getmaxx");

      Y : constant C_Int := GetMaxY (Win);
      X : constant C_Int := GetMaxX (Win);
   begin
      Number_Of_Lines   := Line_Count (Y);
      Number_Of_Columns := Column_Count (X);
   end Get_Size;

   procedure Get_Window_Position
     (Win             : Window := Standard_Window;
      Top_Left_Line   : out Line_Position;
      Top_Left_Column : out Column_Position)
   is
      function GetBegY (W : Window) return C_Int;
      pragma Import (C, GetBegY, "getbegy");

      function GetBegX (W : Window) return C_Int;
      pragma Import (C, GetBegX, "getbegx");

      Y : constant C_Short := C_Short (GetBegY (Win));
      X : constant C_Short := C_Short (GetBegX (Win));
   begin
      Top_Left_Line   := Line_Position (Y);
      Top_Left_Column := Column_Position (X);
   end Get_Window_Position;

   procedure Get_Cursor_Position
     (Win    :  Window := Standard_Window;
      Line   : out Line_Position;
      Column : out Column_Position)
   is
      function GetCurY (W : Window) return C_Int;
      pragma Import (C, GetCurY, "getcury");

      function GetCurX (W : Window) return C_Int;
      pragma Import (C, GetCurX, "getcurx");

      Y : constant C_Short := C_Short (GetCurY (Win));
      X : constant C_Short := C_Short (GetCurX (Win));
   begin
      Line   := Line_Position (Y);
      Column := Column_Position (X);
   end Get_Cursor_Position;

   procedure Get_Origin_Relative_To_Parent
     (Win                :  Window;
      Top_Left_Line      : out Line_Position;
      Top_Left_Column    : out Column_Position;
      Is_Not_A_Subwindow : out Boolean)
   is
      function GetParY (W : Window) return C_Int;
      pragma Import (C, GetParY, "getpary");

      function GetParX (W : Window) return C_Int;
      pragma Import (C, GetParX, "getparx");

      Y : constant C_Int := GetParY (Win);
      X : constant C_Int := GetParX (Win);
   begin
      if Y = -1 then
         Top_Left_Line   := Line_Position'Last;
         Top_Left_Column := Column_Position'Last;
         Is_Not_A_Subwindow := True;
      else
         Top_Left_Line   := Line_Position (Y);
         Top_Left_Column := Column_Position (X);
         Is_Not_A_Subwindow := False;
      end if;
   end Get_Origin_Relative_To_Parent;
------------------------------------------------------------------------------
   function New_Pad (Lines   : Line_Count;
                     Columns : Column_Count) return Window
   is
      function Newpad (Lines : C_Int; Columns : C_Int) return Window;
      pragma Import (C, Newpad, "newpad");

      W : Window;
   begin
      W := Newpad (C_Int (Lines), C_Int (Columns));
      if W = Null_Window then
         raise Curses_Exception;
      end if;
      return W;
   end New_Pad;

   function Sub_Pad
     (Pad                   : Window;
      Number_Of_Lines       : Line_Count;
      Number_Of_Columns     : Column_Count;
      First_Line_Position   : Line_Position;
      First_Column_Position : Column_Position) return Window
   is
      function Subpad
        (Pad                   : Window;
         Number_Of_Lines       : C_Int;
         Number_Of_Columns     : C_Int;
         First_Line_Position   : C_Int;
         First_Column_Position : C_Int) return Window;
      pragma Import (C, Subpad, "subpad");

      W : Window;
   begin
      W := Subpad (Pad,
                   C_Int (Number_Of_Lines),
                   C_Int (Number_Of_Columns),
                   C_Int (First_Line_Position),
                   C_Int (First_Column_Position));
      if W = Null_Window then
         raise Curses_Exception;
      end if;
      return W;
   end Sub_Pad;

   procedure Refresh
     (Pad                      : Window;
      Source_Top_Row           : Line_Position;
      Source_Left_Column       : Column_Position;
      Destination_Top_Row      : Line_Position;
      Destination_Left_Column  : Column_Position;
      Destination_Bottom_Row   : Line_Position;
      Destination_Right_Column : Column_Position)
   is
      function Prefresh
        (Pad                      : Window;
         Source_Top_Row           : C_Int;
         Source_Left_Column       : C_Int;
         Destination_Top_Row      : C_Int;
         Destination_Left_Column  : C_Int;
         Destination_Bottom_Row   : C_Int;
         Destination_Right_Column : C_Int) return C_Int;
      pragma Import (C, Prefresh, "prefresh");
   begin
      if Prefresh (Pad,
                   C_Int (Source_Top_Row),
                   C_Int (Source_Left_Column),
                   C_Int (Destination_Top_Row),
                   C_Int (Destination_Left_Column),
                   C_Int (Destination_Bottom_Row),
                   C_Int (Destination_Right_Column)) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Refresh;

   procedure Refresh_Without_Update
     (Pad                      : Window;
      Source_Top_Row           : Line_Position;
      Source_Left_Column       : Column_Position;
      Destination_Top_Row      : Line_Position;
      Destination_Left_Column  : Column_Position;
      Destination_Bottom_Row   : Line_Position;
      Destination_Right_Column : Column_Position)
   is
      function Pnoutrefresh
        (Pad                      : Window;
         Source_Top_Row           : C_Int;
         Source_Left_Column       : C_Int;
         Destination_Top_Row      : C_Int;
         Destination_Left_Column  : C_Int;
         Destination_Bottom_Row   : C_Int;
         Destination_Right_Column : C_Int) return C_Int;
      pragma Import (C, Pnoutrefresh, "pnoutrefresh");
   begin
      if Pnoutrefresh (Pad,
                       C_Int (Source_Top_Row),
                       C_Int (Source_Left_Column),
                       C_Int (Destination_Top_Row),
                       C_Int (Destination_Left_Column),
                       C_Int (Destination_Bottom_Row),
                       C_Int (Destination_Right_Column)) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Refresh_Without_Update;

   procedure Add_Character_To_Pad_And_Echo_It
     (Pad : Window;
      Ch  : Attributed_Character)
   is
      function Pechochar (Pad : Window; Ch : Attributed_Character)
                          return C_Int;
      pragma Import (C, Pechochar, "pechochar");
   begin
      if Pechochar (Pad, Ch) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Add_Character_To_Pad_And_Echo_It;

   procedure Add_Character_To_Pad_And_Echo_It
     (Pad : Window;
      Ch  : Character)
   is
   begin
      Add_Character_To_Pad_And_Echo_It
        (Pad,
         Attributed_Character'(Ch    => Ch,
                               Color => Color_Pair'First,
                               Attr  => Normal_Video));
   end Add_Character_To_Pad_And_Echo_It;
------------------------------------------------------------------------------
   procedure Scroll (Win    : Window := Standard_Window;
                     Amount : Integer := 1)
   is
      function Wscrl (Win : Window; N : C_Int) return C_Int;
      pragma Import (C, Wscrl, "wscrl");

   begin
      if Wscrl (Win, C_Int (Amount)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Scroll;

------------------------------------------------------------------------------
   procedure Delete_Character (Win : Window := Standard_Window)
   is
      function Wdelch (Win : Window) return C_Int;
      pragma Import (C, Wdelch, "wdelch");
   begin
      if Wdelch (Win) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Delete_Character;

   procedure Delete_Character
     (Win    : Window := Standard_Window;
      Line   : Line_Position;
      Column : Column_Position)
   is
      function Mvwdelch (Win : Window;
                         Lin : C_Int;
                         Col : C_Int) return C_Int;
      pragma Import (C, Mvwdelch, "mvwdelch");
   begin
      if Mvwdelch (Win, C_Int (Line), C_Int (Column)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Delete_Character;
------------------------------------------------------------------------------
   function Peek (Win : Window := Standard_Window)
     return Attributed_Character
   is
      function Winch (Win : Window) return Attributed_Character;
      pragma Import (C, Winch, "winch");
   begin
      return Winch (Win);
   end Peek;

   function Peek
     (Win    : Window := Standard_Window;
      Line   : Line_Position;
      Column : Column_Position) return Attributed_Character
   is
      function Mvwinch (Win : Window;
                        Lin : C_Int;
                        Col : C_Int) return Attributed_Character;
      pragma Import (C, Mvwinch, "mvwinch");
   begin
      return Mvwinch (Win, C_Int (Line), C_Int (Column));
   end Peek;
------------------------------------------------------------------------------
   procedure Insert (Win : Window := Standard_Window;
                     Ch  : Attributed_Character)
   is
      function Winsch (Win : Window; Ch : Attributed_Character) return C_Int;
      pragma Import (C, Winsch, "winsch");
   begin
      if Winsch (Win, Ch) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Insert;

   procedure Insert
     (Win    : Window := Standard_Window;
      Line   : Line_Position;
      Column : Column_Position;
      Ch     : Attributed_Character)
   is
      function Mvwinsch (Win : Window;
                         Lin : C_Int;
                         Col : C_Int;
                         Ch  : Attributed_Character) return C_Int;
      pragma Import (C, Mvwinsch, "mvwinsch");
   begin
      if Mvwinsch (Win,
                   C_Int (Line),
                   C_Int (Column),
                   Ch) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Insert;
------------------------------------------------------------------------------
   procedure Insert (Win : Window := Standard_Window;
                     Str : String;
                     Len : Integer := -1)
   is
      function Winsnstr (Win : Window;
                         Str : char_array;
                         Len : Integer := -1) return C_Int;
      pragma Import (C, Winsnstr, "winsnstr");

      Txt    : char_array (0 .. Str'Length);
      Length : size_t;
   begin
      To_C (Str, Txt, Length);
      if Winsnstr (Win, Txt, Len) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Insert;

   procedure Insert
     (Win    : Window := Standard_Window;
      Line   : Line_Position;
      Column : Column_Position;
      Str    : String;
      Len    : Integer := -1)
   is
      function Mvwinsnstr (Win    : Window;
                           Line   : C_Int;
                           Column : C_Int;
                           Str    : char_array;
                           Len    : C_Int) return C_Int;
      pragma Import (C, Mvwinsnstr, "mvwinsnstr");

      Txt    : char_array (0 .. Str'Length);
      Length : size_t;
   begin
      To_C (Str, Txt, Length);
      if Mvwinsnstr (Win, C_Int (Line), C_Int (Column), Txt, C_Int (Len))
        = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Insert;
------------------------------------------------------------------------------
   procedure Peek (Win :  Window := Standard_Window;
                   Str : out String;
                   Len :  Integer := -1)
   is
      function Winnstr (Win : Window;
                        Str : char_array;
                        Len : C_Int) return C_Int;
      pragma Import (C, Winnstr, "winnstr");

      N   : Integer := Len;
      Txt : char_array (0 .. Str'Length);
      Cnt : Natural;
   begin
      if N < 0 then
         N := Str'Length;
      end if;
      if N > Str'Length then
         raise Constraint_Error;
      end if;
      Txt (0) := Interfaces.C.char'First;
      if Winnstr (Win, Txt, C_Int (N)) = Curses_Err then
         raise Curses_Exception;
      end if;
      To_Ada (Txt, Str, Cnt, True);
      if Cnt < Str'Length then
         Str ((Str'First + Cnt) .. Str'Last) := (others => ' ');
      end if;
   end Peek;

   procedure Peek
     (Win    :  Window := Standard_Window;
      Line   :  Line_Position;
      Column :  Column_Position;
      Str    : out String;
      Len    :  Integer := -1)
   is
   begin
      Move_Cursor (Win, Line, Column);
      Peek (Win, Str, Len);
   end Peek;
------------------------------------------------------------------------------
   procedure Peek
     (Win :  Window := Standard_Window;
      Str : out Attributed_String;
      Len :  Integer := -1)
   is
      function Winchnstr (Win : Window;
                          Str : chtype_array;             -- out
                          Len : C_Int) return C_Int;
      pragma Import (C, Winchnstr, "winchnstr");

      N   : Integer := Len;
      Txt : constant chtype_array (0 .. Str'Length)
          := (0 => Default_Character);
      Cnt : Natural := 0;
   begin
      if N < 0 then
         N := Str'Length;
      end if;
      if N > Str'Length then
         raise Constraint_Error;
      end if;
      if Winchnstr (Win, Txt, C_Int (N)) = Curses_Err then
         raise Curses_Exception;
      end if;
      for To in Str'Range loop
         exit when Txt (size_t (Cnt)) = Default_Character;
         Str (To) := Txt (size_t (Cnt));
         Cnt := Cnt + 1;
      end loop;
      if Cnt < Str'Length then
         Str ((Str'First + Cnt) .. Str'Last) :=
           (others => (Ch => ' ',
                       Color => Color_Pair'First,
                       Attr => Normal_Video));
      end if;
   end Peek;

   procedure Peek
     (Win    :  Window := Standard_Window;
      Line   :  Line_Position;
      Column :  Column_Position;
      Str    : out Attributed_String;
      Len    : Integer := -1)
   is
   begin
      Move_Cursor (Win, Line, Column);
      Peek (Win, Str, Len);
   end Peek;
------------------------------------------------------------------------------
   procedure Get (Win :  Window := Standard_Window;
                  Str : out String;
                  Len :  Integer := -1)
   is
      function Wgetnstr (Win : Window;
                         Str : char_array;
                         Len : C_Int) return C_Int;
      pragma Import (C, Wgetnstr, "wgetnstr");

      N   : Integer := Len;
      Txt : char_array (0 .. Str'Length);
      Cnt : Natural;
   begin
      if N < 0 then
         N := Str'Length;
      end if;
      if N > Str'Length then
         raise Constraint_Error;
      end if;
      Txt (0) := Interfaces.C.char'First;
      if Wgetnstr (Win, Txt, C_Int (N)) = Curses_Err then
         raise Curses_Exception;
      end if;
      To_Ada (Txt, Str, Cnt, True);
      if Cnt < Str'Length then
         Str ((Str'First + Cnt) .. Str'Last) := (others => ' ');
      end if;
   end Get;

   procedure Get
     (Win    :  Window := Standard_Window;
      Line   :  Line_Position;
      Column :  Column_Position;
      Str    : out String;
      Len    :  Integer := -1)
   is
   begin
      Move_Cursor (Win, Line, Column);
      Get (Win, Str, Len);
   end Get;
------------------------------------------------------------------------------
   procedure Init_Soft_Label_Keys
     (Format : Soft_Label_Key_Format := Three_Two_Three)
   is
      function Slk_Init (Fmt : C_Int) return C_Int;
      pragma Import (C, Slk_Init, "slk_init");
   begin
      if Slk_Init (Soft_Label_Key_Format'Pos (Format)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Init_Soft_Label_Keys;

   procedure Set_Soft_Label_Key (Label : Label_Number;
                                 Text  : String;
                                 Fmt   : Label_Justification := Left)
   is
      function Slk_Set (Label : C_Int;
                        Txt   : char_array;
                        Fmt   : C_Int) return C_Int;
      pragma Import (C, Slk_Set, "slk_set");

      Txt : char_array (0 .. Text'Length);
      Len : size_t;
   begin
      To_C (Text, Txt, Len);
      if Slk_Set (C_Int (Label), Txt,
                  C_Int (Label_Justification'Pos (Fmt))) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Set_Soft_Label_Key;

   procedure Refresh_Soft_Label_Keys
   is
      function Slk_Refresh return C_Int;
      pragma Import (C, Slk_Refresh, "slk_refresh");
   begin
      if Slk_Refresh = Curses_Err then
         raise Curses_Exception;
      end if;
   end Refresh_Soft_Label_Keys;

   procedure Refresh_Soft_Label_Keys_Without_Update
   is
      function Slk_Noutrefresh return C_Int;
      pragma Import (C, Slk_Noutrefresh, "slk_noutrefresh");
   begin
      if Slk_Noutrefresh = Curses_Err then
         raise Curses_Exception;
      end if;
   end Refresh_Soft_Label_Keys_Without_Update;

   procedure Get_Soft_Label_Key (Label : Label_Number;
                                 Text  : out String)
   is
      function Slk_Label (Label : C_Int) return chars_ptr;
      pragma Import (C, Slk_Label, "slk_label");
   begin
      Fill_String (Slk_Label (C_Int (Label)), Text);
   end Get_Soft_Label_Key;

   function Get_Soft_Label_Key (Label : Label_Number) return String
   is
      function Slk_Label (Label : C_Int) return chars_ptr;
      pragma Import (C, Slk_Label, "slk_label");
   begin
      return Fill_String (Slk_Label (C_Int (Label)));
   end Get_Soft_Label_Key;

   procedure Clear_Soft_Label_Keys
   is
      function Slk_Clear return C_Int;
      pragma Import (C, Slk_Clear, "slk_clear");
   begin
      if Slk_Clear = Curses_Err then
         raise Curses_Exception;
      end if;
   end Clear_Soft_Label_Keys;

   procedure Restore_Soft_Label_Keys
   is
      function Slk_Restore return C_Int;
      pragma Import (C, Slk_Restore, "slk_restore");
   begin
      if Slk_Restore = Curses_Err then
         raise Curses_Exception;
      end if;
   end Restore_Soft_Label_Keys;

   procedure Touch_Soft_Label_Keys
   is
      function Slk_Touch return C_Int;
      pragma Import (C, Slk_Touch, "slk_touch");
   begin
      if Slk_Touch = Curses_Err then
         raise Curses_Exception;
      end if;
   end Touch_Soft_Label_Keys;

   procedure Switch_Soft_Label_Key_Attributes
     (Attr : Character_Attribute_Set;
      On   : Boolean := True)
   is
      function Slk_Attron (Ch : Attributed_Character) return C_Int;
      pragma Import (C, Slk_Attron, "slk_attron");
      function Slk_Attroff (Ch : Attributed_Character) return C_Int;
      pragma Import (C, Slk_Attroff, "slk_attroff");

      Err : C_Int;
      Ch  : constant Attributed_Character := (Ch    => Character'First,
                                              Attr  => Attr,
                                              Color => Color_Pair'First);
   begin
      if On then
         Err := Slk_Attron  (Ch);
      else
         Err := Slk_Attroff (Ch);
      end if;
      if Err = Curses_Err then
         raise Curses_Exception;
      end if;
   end Switch_Soft_Label_Key_Attributes;

   procedure Set_Soft_Label_Key_Attributes
     (Attr  : Character_Attribute_Set := Normal_Video;
      Color : Color_Pair := Color_Pair'First)
   is
      function Slk_Attrset (Ch : Attributed_Character) return C_Int;
      pragma Import (C, Slk_Attrset, "slk_attrset");

      Ch : constant Attributed_Character := (Ch    => Character'First,
                                             Attr  => Attr,
                                             Color => Color);
   begin
      if Slk_Attrset (Ch) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Set_Soft_Label_Key_Attributes;

   function Get_Soft_Label_Key_Attributes return Character_Attribute_Set
   is
      function Slk_Attr return Attributed_Character;
      pragma Import (C, Slk_Attr, "slk_attr");

      Attr : constant Attributed_Character := Slk_Attr;
   begin
      return Attr.Attr;
   end Get_Soft_Label_Key_Attributes;

   function Get_Soft_Label_Key_Attributes return Color_Pair
   is
      function Slk_Attr return Attributed_Character;
      pragma Import (C, Slk_Attr, "slk_attr");

      Attr : constant Attributed_Character := Slk_Attr;
   begin
      return Attr.Color;
   end Get_Soft_Label_Key_Attributes;

   procedure Set_Soft_Label_Key_Color (Pair : Color_Pair)
   is
      function Slk_Color (Color : C_Short) return C_Int;
      pragma Import (C, Slk_Color, "slk_color");
   begin
      if Slk_Color (C_Short (Pair)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Set_Soft_Label_Key_Color;

------------------------------------------------------------------------------
   procedure Enable_Key (Key    : Special_Key_Code;
                         Enable : Boolean := True)
   is
      function Keyok (Keycode : C_Int;
                      On_Off  : Curses_Bool) return C_Int;
      pragma Import (C, Keyok, "keyok");
   begin
      if Keyok (C_Int (Key), Curses_Bool (Boolean'Pos (Enable)))
        = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Enable_Key;
------------------------------------------------------------------------------
   procedure Define_Key (Definition : String;
                         Key        : Special_Key_Code)
   is
      function Defkey (Def : char_array;
                       Key : C_Int) return C_Int;
      pragma Import (C, Defkey, "define_key");

      Txt    : char_array (0 .. Definition'Length);
      Length : size_t;
   begin
      To_C (Definition, Txt, Length);
      if Defkey (Txt, C_Int (Key)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Define_Key;
------------------------------------------------------------------------------
   procedure Un_Control (Ch  : Attributed_Character;
                         Str : out String)
   is
      function Unctrl (Ch : Attributed_Character) return chars_ptr;
      pragma Import (C, Unctrl, "unctrl");
   begin
      Fill_String (Unctrl (Ch), Str);
   end Un_Control;

   function Un_Control (Ch : Attributed_Character) return String
   is
      function Unctrl (Ch : Attributed_Character) return chars_ptr;
      pragma Import (C, Unctrl, "unctrl");
   begin
      return Fill_String (Unctrl (Ch));
   end Un_Control;

   procedure Delay_Output (Msecs : Natural)
   is
      function Delayoutput (Msecs : C_Int) return C_Int;
      pragma Import (C, Delayoutput, "delay_output");
   begin
      if Delayoutput (C_Int (Msecs)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Delay_Output;

   procedure Flush_Input
   is
      function Flushinp return C_Int;
      pragma Import (C, Flushinp, "flushinp");
   begin
      if Flushinp = Curses_Err then  -- docu says that never happens, but...
         raise Curses_Exception;
      end if;
   end Flush_Input;
------------------------------------------------------------------------------
   function Baudrate return Natural
   is
      function Baud return C_Int;
      pragma Import (C, Baud, "baudrate");
   begin
      return Natural (Baud);
   end Baudrate;

   function Erase_Character return Character
   is
      function Erasechar return C_Int;
      pragma Import (C, Erasechar, "erasechar");
   begin
      return Character'Val (Erasechar);
   end Erase_Character;

   function Kill_Character return Character
   is
      function Killchar return C_Int;
      pragma Import (C, Killchar, "killchar");
   begin
      return Character'Val (Killchar);
   end Kill_Character;

   function Has_Insert_Character return Boolean
   is
      function Has_Ic return Curses_Bool;
      pragma Import (C, Has_Ic, "has_ic");
   begin
      if Has_Ic = Curses_Bool_False then
         return False;
      else
         return True;
      end if;
   end Has_Insert_Character;

   function Has_Insert_Line return Boolean
   is
      function Has_Il return Curses_Bool;
      pragma Import (C, Has_Il, "has_il");
   begin
      if Has_Il = Curses_Bool_False then
         return False;
      else
         return True;
      end if;
   end Has_Insert_Line;

   function Supported_Attributes return Character_Attribute_Set
   is
      function Termattrs return Attributed_Character;
      pragma Import (C, Termattrs, "termattrs");

      Ch : constant Attributed_Character := Termattrs;
   begin
      return Ch.Attr;
   end Supported_Attributes;

   procedure Long_Name (Name : out String)
   is
      function Longname return chars_ptr;
      pragma Import (C, Longname, "longname");
   begin
      Fill_String (Longname, Name);
   end Long_Name;

   function Long_Name return String
   is
      function Longname return chars_ptr;
      pragma Import (C, Longname, "longname");
   begin
      return Fill_String (Longname);
   end Long_Name;

   procedure Terminal_Name (Name : out String)
   is
      function Termname return chars_ptr;
      pragma Import (C, Termname, "termname");
   begin
      Fill_String (Termname, Name);
   end Terminal_Name;

   function Terminal_Name return String
   is
      function Termname return chars_ptr;
      pragma Import (C, Termname, "termname");
   begin
      return Fill_String (Termname);
   end Terminal_Name;
------------------------------------------------------------------------------
   procedure Init_Pair (Pair : Redefinable_Color_Pair;
                        Fore : Color_Number;
                        Back : Color_Number)
   is
      function Initpair (Pair : C_Short;
                         Fore : C_Short;
                         Back : C_Short) return C_Int;
      pragma Import (C, Initpair, "init_pair");
   begin
      if Integer (Pair) >= Number_Of_Color_Pairs then
         raise Constraint_Error;
      end if;
      if Integer (Fore) >= Number_Of_Colors or else
         Integer (Back) >= Number_Of_Colors
      then
         raise Constraint_Error;
      end if;
      if Initpair (C_Short (Pair), C_Short (Fore), C_Short (Back))
        = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Init_Pair;

   procedure Pair_Content (Pair : Color_Pair;
                           Fore : out Color_Number;
                           Back : out Color_Number)
   is
      type C_Short_Access is access all C_Short;
      function Paircontent (Pair : C_Short;
                            Fp   : C_Short_Access;
                            Bp   : C_Short_Access) return C_Int;
      pragma Import (C, Paircontent, "pair_content");

      F, B : aliased C_Short;
   begin
      if Paircontent (C_Short (Pair), F'Access, B'Access) = Curses_Err then
         raise Curses_Exception;
      else
         Fore := Color_Number (F);
         Back := Color_Number (B);
      end if;
   end Pair_Content;

   function Has_Colors return Boolean
   is
      function Hascolors return Curses_Bool;
      pragma Import (C, Hascolors, "has_colors");
   begin
      if Hascolors = Curses_Bool_False then
         return False;
      else
         return True;
      end if;
   end Has_Colors;

   procedure Init_Color (Color : Color_Number;
                         Red   : RGB_Value;
                         Green : RGB_Value;
                         Blue  : RGB_Value)
   is
      function Initcolor (Col   : C_Short;
                          Red   : C_Short;
                          Green : C_Short;
                          Blue  : C_Short) return C_Int;
      pragma Import (C, Initcolor, "init_color");
   begin
      if Initcolor (C_Short (Color), C_Short (Red), C_Short (Green),
                    C_Short (Blue)) = Curses_Err
      then
            raise Curses_Exception;
      end if;
   end Init_Color;

   function Can_Change_Color return Boolean
   is
      function Canchangecolor return Curses_Bool;
      pragma Import (C, Canchangecolor, "can_change_color");
   begin
      if Canchangecolor = Curses_Bool_False then
         return False;
      else
         return True;
      end if;
   end Can_Change_Color;

   procedure Color_Content (Color :  Color_Number;
                            Red   : out RGB_Value;
                            Green : out RGB_Value;
                            Blue  : out RGB_Value)
   is
      type C_Short_Access is access all C_Short;

      function Colorcontent (Color : C_Short; R, G, B : C_Short_Access)
                             return C_Int;
      pragma Import (C, Colorcontent, "color_content");

      R, G, B : aliased C_Short;
   begin
      if Colorcontent (C_Short (Color), R'Access, G'Access, B'Access) =
        Curses_Err
      then
         raise Curses_Exception;
      else
         Red   := RGB_Value (R);
         Green := RGB_Value (G);
         Blue  := RGB_Value (B);
      end if;
   end Color_Content;

------------------------------------------------------------------------------
   procedure Save_Curses_Mode (Mode : Curses_Mode)
   is
      function Def_Prog_Mode return C_Int;
      pragma Import (C, Def_Prog_Mode, "def_prog_mode");
      function Def_Shell_Mode return C_Int;
      pragma Import (C, Def_Shell_Mode, "def_shell_mode");

      Err : C_Int;
   begin
      case Mode is
         when Curses => Err := Def_Prog_Mode;
         when Shell  => Err := Def_Shell_Mode;
      end case;
      if Err = Curses_Err then
         raise Curses_Exception;
      end if;
   end Save_Curses_Mode;

   procedure Reset_Curses_Mode (Mode : Curses_Mode)
   is
      function Reset_Prog_Mode return C_Int;
      pragma Import (C, Reset_Prog_Mode, "reset_prog_mode");
      function Reset_Shell_Mode return C_Int;
      pragma Import (C, Reset_Shell_Mode, "reset_shell_mode");

      Err : C_Int;
   begin
      case Mode is
         when Curses => Err := Reset_Prog_Mode;
         when Shell  => Err := Reset_Shell_Mode;
      end case;
      if Err = Curses_Err then
         raise Curses_Exception;
      end if;
   end Reset_Curses_Mode;

   procedure Save_Terminal_State
   is
      function Savetty return C_Int;
      pragma Import (C, Savetty, "savetty");
   begin
      if Savetty = Curses_Err then
         raise Curses_Exception;
      end if;
   end Save_Terminal_State;

   procedure Reset_Terminal_State
   is
      function Resetty return C_Int;
      pragma Import (C, Resetty, "resetty");
   begin
      if Resetty = Curses_Err then
         raise Curses_Exception;
      end if;
   end Reset_Terminal_State;

   procedure Rip_Off_Lines (Lines : Integer;
                            Proc  : Stdscr_Init_Proc)
   is
      function Ripoffline (Lines : C_Int;
                           Proc  : Stdscr_Init_Proc) return C_Int;
      pragma Import (C, Ripoffline, "_nc_ripoffline");
   begin
      if Ripoffline (C_Int (Lines), Proc) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Rip_Off_Lines;

   procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility)
   is
      function Curs_Set (Curs : C_Int) return C_Int;
      pragma Import (C, Curs_Set, "curs_set");

      Res : C_Int;
   begin
      Res := Curs_Set (Cursor_Visibility'Pos (Visibility));
      if Res /= Curses_Err then
         Visibility := Cursor_Visibility'Val (Res);
      end if;
   end Set_Cursor_Visibility;

   procedure Nap_Milli_Seconds (Ms : Natural)
   is
      function Napms (Ms : C_Int) return C_Int;
      pragma Import (C, Napms, "napms");
   begin
      if Napms (C_Int (Ms)) = Curses_Err then
         raise Curses_Exception;
      end if;
   end Nap_Milli_Seconds;
------------------------------------------------------------------------------
   function Lines return Line_Count
   is
      function LINES_As_Function return Interfaces.C.int;
      pragma Import (C, LINES_As_Function, "LINES_as_function");
   begin
      return Line_Count (LINES_As_Function);
   end Lines;

   function Columns return Column_Count
   is
      function COLS_As_Function return Interfaces.C.int;
      pragma Import (C, COLS_As_Function, "COLS_as_function");
   begin
      return Column_Count (COLS_As_Function);
   end Columns;

   function Tab_Size return Natural
   is
      function TABSIZE_As_Function return Interfaces.C.int;
      pragma Import (C, TABSIZE_As_Function, "TABSIZE_as_function");

   begin
      return Natural (TABSIZE_As_Function);
   end Tab_Size;

   function Number_Of_Colors return Natural
   is
      function COLORS_As_Function return Interfaces.C.int;
      pragma Import (C, COLORS_As_Function, "COLORS_as_function");
   begin
      return Natural (COLORS_As_Function);
   end Number_Of_Colors;

   function Number_Of_Color_Pairs return Natural
   is
      function COLOR_PAIRS_As_Function return Interfaces.C.int;
      pragma Import (C, COLOR_PAIRS_As_Function, "COLOR_PAIRS_as_function");
   begin
      return Natural (COLOR_PAIRS_As_Function);
   end Number_Of_Color_Pairs;
------------------------------------------------------------------------------
   procedure Transform_Coordinates
     (W      : Window := Standard_Window;
      Line   : in out Line_Position;
      Column : in out Column_Position;
      Dir    : Transform_Direction := From_Screen)
   is
      type Int_Access is access all C_Int;
      function Transform (W    : Window;
                          Y, X : Int_Access;
                          Dir  : Curses_Bool) return C_Int;
      pragma Import (C, Transform, "wmouse_trafo");

      X : aliased C_Int := C_Int (Column);
      Y : aliased C_Int := C_Int (Line);
      D : Curses_Bool := Curses_Bool_False;
      R : C_Int;
   begin
      if Dir = To_Screen then
         D := 1;
      end if;
      R := Transform (W, Y'Access, X'Access, D);
      if R = Curses_False then
         raise Curses_Exception;
      else
         Line   := Line_Position (Y);
         Column := Column_Position (X);
      end if;
   end Transform_Coordinates;
------------------------------------------------------------------------------
   procedure Use_Default_Colors is
      function C_Use_Default_Colors return C_Int;
      pragma Import (C, C_Use_Default_Colors, "use_default_colors");
      Err : constant C_Int := C_Use_Default_Colors;
   begin
      if Err = Curses_Err then
         raise Curses_Exception;
      end if;
   end Use_Default_Colors;

   procedure Assume_Default_Colors (Fore : Color_Number := Default_Color;
                                    Back : Color_Number := Default_Color)
   is
      function C_Assume_Default_Colors (Fore : C_Int;
                                        Back : C_Int) return C_Int;
      pragma Import (C, C_Assume_Default_Colors, "assume_default_colors");

      Err : constant C_Int := C_Assume_Default_Colors (C_Int (Fore),
                                                       C_Int (Back));
   begin
      if Err = Curses_Err then
         raise Curses_Exception;
      end if;
   end Assume_Default_Colors;
------------------------------------------------------------------------------
   function Curses_Version return String
   is
      function curses_versionC return chars_ptr;
      pragma Import (C, curses_versionC, "curses_version");
      Result : constant chars_ptr := curses_versionC;
   begin
      return Fill_String (Result);
   end Curses_Version;
------------------------------------------------------------------------------
   procedure Curses_Free_All is
      procedure curses_freeall;
      pragma Import (C, curses_freeall, "_nc_freeall");
   begin
      --  Use this only for testing: you cannot use curses after calling it,
      --  so it has to be the "last" thing done before exiting the program.
      --  This will not really free ALL of memory used by curses.  That is
      --  because it cannot free the memory used for stdout's setbuf.  The
      --  _nc_free_and_exit() procedure can do that, but it can be invoked
      --  safely only from C - and again, that only as the "last" thing done
      --  before exiting the program.
      curses_freeall;
   end Curses_Free_All;
------------------------------------------------------------------------------
   function Use_Extended_Names (Enable : Boolean) return Boolean
   is
      function use_extended_namesC (e : Curses_Bool) return C_Int;
      pragma Import (C, use_extended_namesC, "use_extended_names");

      Res : constant C_Int :=
         use_extended_namesC (Curses_Bool (Boolean'Pos (Enable)));
   begin
      if Res = C_Int (Curses_Bool_False) then
         return False;
      else
         return True;
      end if;
   end Use_Extended_Names;
------------------------------------------------------------------------------
   procedure Screen_Dump_To_File (Filename : String)
   is
      function scr_dump (f : char_array) return C_Int;
      pragma Import (C, scr_dump, "scr_dump");
      Txt    : char_array (0 .. Filename'Length);
      Length : size_t;
   begin
      To_C (Filename, Txt, Length);
      if Curses_Err = scr_dump (Txt) then
         raise Curses_Exception;
      end if;
   end Screen_Dump_To_File;

   procedure Screen_Restore_From_File (Filename : String)
   is
      function scr_restore (f : char_array) return C_Int;
      pragma Import (C, scr_restore, "scr_restore");
      Txt    : char_array (0 .. Filename'Length);
      Length : size_t;
   begin
      To_C (Filename, Txt, Length);
      if Curses_Err = scr_restore (Txt)  then
         raise Curses_Exception;
      end if;
   end Screen_Restore_From_File;

   procedure Screen_Init_From_File (Filename : String)
   is
      function scr_init (f : char_array) return C_Int;
      pragma Import (C, scr_init, "scr_init");
      Txt    : char_array (0 .. Filename'Length);
      Length : size_t;
   begin
      To_C (Filename, Txt, Length);
      if Curses_Err = scr_init (Txt) then
         raise Curses_Exception;
      end if;
   end Screen_Init_From_File;

   procedure Screen_Set_File (Filename : String)
   is
      function scr_set (f : char_array) return C_Int;
      pragma Import (C, scr_set, "scr_set");
      Txt    : char_array (0 .. Filename'Length);
      Length : size_t;
   begin
      To_C (Filename, Txt, Length);
      if Curses_Err = scr_set (Txt) then
         raise Curses_Exception;
      end if;
   end Screen_Set_File;
------------------------------------------------------------------------------
   procedure Resize (Win               : Window := Standard_Window;
                     Number_Of_Lines   : Line_Count;
                     Number_Of_Columns : Column_Count) is
      function wresize (win     : Window;
                        lines   : C_Int;
                        columns : C_Int) return C_Int;
      pragma Import (C, wresize);
   begin
      if wresize (Win,
                  C_Int (Number_Of_Lines),
                  C_Int (Number_Of_Columns)) = Curses_Err
      then
         raise Curses_Exception;
      end if;
   end Resize;
------------------------------------------------------------------------------

end Terminal_Interface.Curses;
AdaCurses-20170708/doc/ada/terminal_interface-curses-text_io-modular_io__adb.htm0000644000175100001440000002365212340214310026262 0ustar tomusers terminal_interface-curses-text_io-modular_io.adb

File : terminal_interface-curses-text_io-modular_io.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--               Terminal_Interface.Curses.Text_IO.Modular_IO               --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.11 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Terminal_Interface.Curses.Text_IO.Aux;

package body Terminal_Interface.Curses.Text_IO.Modular_IO is

   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
   package MIO is new Ada.Text_IO.Modular_IO (Num);

   procedure Put
     (Win   : Window;
      Item  : Num;
      Width : Field := Default_Width;
      Base  : Number_Base := Default_Base)
   is
      Buf : String (1 .. Field'Last);
   begin
      MIO.Put (Buf, Item, Base);
      Aux.Put_Buf (Win, Buf, Width);
   end Put;

   procedure Put
     (Item  : Num;
      Width : Field := Default_Width;
      Base  : Number_Base := Default_Base)
   is
   begin
      Put (Get_Window, Item, Width, Base);
   end Put;

end Terminal_Interface.Curses.Text_IO.Modular_IO;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm0000644000175100001440000002071412340214310027376 0ustar tomusers terminal_interface-curses-forms-field_types-regexp.adb

File : terminal_interface-curses-forms-field_types-regexp.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--             Terminal_Interface.Curses.Forms.Field_Types.RegExp           --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C; use Interfaces.C;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Forms.Field_Types.RegExp is

   procedure Set_Field_Type (Fld : Field;
                             Typ : Regular_Expression_Field)
   is
      function Set_Ftyp (F    : Field := Fld;
                         Arg1 : char_array) return Eti_Error;
      pragma Import (C, Set_Ftyp, "set_field_type_regexp");

   begin
      Eti_Exception (Set_Ftyp (Arg1 => To_C (Typ.Regular_Expression.all)));
      Wrap_Builtin (Fld, Typ);
   end Set_Field_Type;

end Terminal_Interface.Curses.Forms.Field_Types.RegExp;
AdaCurses-20170708/doc/ada/terminal_interface-curses-aux__adb.htm0000644000175100001440000003202412340214307023253 0ustar tomusers terminal_interface-curses-aux.adb

File : terminal_interface-curses-aux.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                      Terminal_Interface.Curses.Aux                       --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.11 @
--  Binding Version 01.00
------------------------------------------------------------------------------
package body Terminal_Interface.Curses.Aux is
   --
   --  Some helpers
   procedure Fill_String (Cp  : chars_ptr;
                          Str : out String)
   is
      --  Fill the string with the characters referenced by the
      --  chars_ptr.
      --
      Len : Natural;
   begin
      if Cp /= Null_Ptr then
         Len := Natural (Strlen (Cp));
         if Str'Length < Len then
            raise Constraint_Error;
         end if;
         declare
            S : String (1 .. Len);
         begin
            S := Value (Cp);
            Str (Str'First .. (Str'First + Len - 1)) := S (S'Range);
         end;
      else
         Len := 0;
      end if;

      if Len < Str'Length then
         Str ((Str'First + Len) .. Str'Last) := (others => ' ');
      end if;

   end Fill_String;

   function Fill_String (Cp : chars_ptr) return String
   is
      Len : Natural;
   begin
      if Cp /= Null_Ptr then
         Len := Natural (Strlen (Cp));
         if Len = 0 then
            return "";
         else
            declare
               S : String (1 .. Len);
            begin
               Fill_String (Cp, S);
               return S;
            end;
         end if;
      else
         return "";
      end if;
   end Fill_String;

   procedure Eti_Exception (Code : Eti_Error)
   is
   begin
      case Code is
         when E_Ok              => null;
         when E_System_Error    => raise Eti_System_Error;
         when E_Bad_Argument    => raise Eti_Bad_Argument;
         when E_Posted          => raise Eti_Posted;
         when E_Connected       => raise Eti_Connected;
         when E_Bad_State       => raise Eti_Bad_State;
         when E_No_Room         => raise Eti_No_Room;
         when E_Not_Posted      => raise Eti_Not_Posted;
         when E_Unknown_Command => raise Eti_Unknown_Command;
         when E_No_Match        => raise Eti_No_Match;
         when E_Not_Selectable  => raise Eti_Not_Selectable;
         when E_Not_Connected   => raise Eti_Not_Connected;
         when E_Request_Denied  => raise Eti_Request_Denied;
         when E_Invalid_Field   => raise Eti_Invalid_Field;
         when E_Current         => raise Eti_Current;
      end case;
   end Eti_Exception;

end Terminal_Interface.Curses.Aux;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm0000644000175100001440000002347412340214310027710 0ustar tomusers terminal_interface-curses-forms-field_types-intfield.adb

File : terminal_interface-curses-forms-field_types-intfield.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--            Terminal_Interface.Curses.Forms.Field_Types.IntField          --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,2014 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, 1996
--  Version Control:
--  @Revision: 1.13 @
--  @Date: 2014/05/24 21:31:05 @
--  Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;

package body Terminal_Interface.Curses.Forms.Field_Types.IntField is

   procedure Set_Field_Type (Fld : Field;
                             Typ : Integer_Field)
   is
      function Set_Fld_Type (F    : Field := Fld;
                             Arg1 : C_Int;
                             Arg2 : C_Long_Int;
                             Arg3 : C_Long_Int) return Eti_Error;
      pragma Import (C, Set_Fld_Type, "set_field_type_integer");

   begin
      Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
                                   Arg2 => C_Long_Int (Typ.Lower_Limit),
                                   Arg3 => C_Long_Int (Typ.Upper_Limit)));
      Wrap_Builtin (Fld, Typ);
   end Set_Field_Type;

end Terminal_Interface.Curses.Forms.Field_Types.IntField;
AdaCurses-20170708/doc/ada/terminal_interface-curses-terminfo__adb.htm0000644000175100001440000004710612340214310024302 0ustar tomusers terminal_interface-curses-terminfo.adb

File : terminal_interface-curses-terminfo.adb


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--                    Terminal_Interface.Curses.Terminfo                    --
--                                                                          --
--                                 B O D Y                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2009 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, 1996
--  Version Control:
--  @Revision: 1.6 @
--  @Date: 2009/12/26 17:38:58 @
--  Binding Version 01.00
------------------------------------------------------------------------------

with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Ada.Unchecked_Conversion;

package body Terminal_Interface.Curses.Terminfo is

   function Is_MinusOne_Pointer (P : chars_ptr) return Boolean;

   function Is_MinusOne_Pointer (P : chars_ptr) return Boolean is
      type Weird_Address is new System.Storage_Elements.Integer_Address;
      Invalid_Pointer : constant Weird_Address := -1;
      function To_Weird is new Ada.Unchecked_Conversion
        (Source => chars_ptr, Target => Weird_Address);
   begin
      if To_Weird (P) = Invalid_Pointer then
         return True;
      else
         return False;
      end if;
   end Is_MinusOne_Pointer;
   pragma Inline (Is_MinusOne_Pointer);

------------------------------------------------------------------------------
   function Get_Flag (Name : String) return Boolean
   is
      function tigetflag (id : char_array) return Curses_Bool;
      pragma Import (C, tigetflag);
      Txt    : char_array (0 .. Name'Length);
      Length : size_t;
   begin
      To_C (Name, Txt, Length);
      if tigetflag (Txt) = Curses_Bool (Curses_True) then
         return True;
      else
         return False;
      end if;
   end Get_Flag;

------------------------------------------------------------------------------
   procedure Get_String (Name   : String;
                         Value  : out Terminfo_String;
                         Result : out Boolean)
   is
      function tigetstr (id : char_array) return chars_ptr;
      pragma Import (C, tigetstr, "tigetstr");
      Txt    : char_array (0 .. Name'Length);
      Length : size_t;
      Txt2 : chars_ptr;
   begin
      To_C (Name, Txt, Length);
      Txt2 := tigetstr (Txt);
      if Txt2 = Null_Ptr then
         Result := False;
      elsif Is_MinusOne_Pointer (Txt2) then
         raise Curses_Exception;
      else
         Value  := Terminfo_String (Fill_String (Txt2));
         Result := True;
      end if;
   end Get_String;

------------------------------------------------------------------------------
   function Has_String (Name : String) return Boolean
   is
      function tigetstr (id : char_array) return chars_ptr;
      pragma Import (C, tigetstr, "tigetstr");
      Txt    : char_array (0 .. Name'Length);
      Length : size_t;
      Txt2 : chars_ptr;
   begin
      To_C (Name, Txt, Length);
      Txt2 := tigetstr (Txt);
      if Txt2 = Null_Ptr then
         return False;
      elsif Is_MinusOne_Pointer (Txt2) then
         raise Curses_Exception;
      else
         return True;
      end if;
   end Has_String;

------------------------------------------------------------------------------
   function Get_Number (Name : String) return Integer is
      function tigetstr (s : char_array) return C_Int;
      pragma Import (C, tigetstr);
      Txt    : char_array (0 .. Name'Length);
      Length : size_t;
   begin
      To_C (Name, Txt, Length);
      return Integer (tigetstr (Txt));
   end Get_Number;

------------------------------------------------------------------------------
   procedure Put_String (Str    : Terminfo_String;
                         affcnt : Natural := 1;
                         putc   : putctype := null) is
      function tputs (str    : char_array;
                      affcnt : C_Int;
                      putc   : putctype) return C_Int;
      function putp (str : char_array) return C_Int;
      pragma Import (C, tputs);
      pragma Import (C, putp);
      Txt    : char_array (0 .. Str'Length);
      Length : size_t;
      Err : C_Int;
   begin
      To_C (String (Str), Txt, Length);
      if putc = null then
         Err := putp (Txt);
      else
         Err := tputs (Txt, C_Int (affcnt), putc);
      end if;
      if Err = Curses_Err then
         raise Curses_Exception;
      end if;
   end Put_String;

end Terminal_Interface.Curses.Terminfo;
AdaCurses-20170708/doc/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm0000644000175100001440000001640112340214310027565 0ustar tomusers terminal_interface-curses-forms-field_types-numeric.ads

File : terminal_interface-curses-forms-field_types-numeric.ads


------------------------------------------------------------------------------
--                                                                          --
--                           GNAT ncurses Binding                           --
--                                                                          --
--             Terminal_Interface.Curses.Forms.Field_Types.Numeric          --
--                                                                          --
--                                 S P E C                                  --
--                                                                          --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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, 1996
--  Version Control:
--  @Revision: 1.12 @
--  Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.Numeric is
   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Numeric);

   type Numeric_Field is new Field_Type with
      record
         Precision   : Natural;
         Lower_Limit : Float;
         Upper_Limit : Float;
      end record;

   procedure Set_Field_Type (Fld : Field;
                             Typ : Numeric_Field);
   pragma Inline (Set_Field_Type);

end Terminal_Interface.Curses.Forms.Field_Types.Numeric;
AdaCurses-20170708/doc/Ada95.html0000644000175100001440000003153112145771752014671 0ustar tomusers Ada95 Binding for ncurses

Ada95 Binding for ncurses

by Jürgen Pfeifer.


General Remarks

  • This document describes Version 01.00 of the binding.
  • The functionality is modeled to be compatible with the ncurses package, a clone of the SVr4 curses model.
    I did the development on an Intel box running the latest stable release of Linux, ncurses and the most recent released GNU Ada Translator gnat versions. For any older versions of ncurses and gnat it is not guaranteed to work.
  • You must have the m4 macroprocessor to build this package. If you don't have this program, you can get the FSF version here.
  • Ada programs are supposed to be readable. One of my favorite methods to make code readable is to use expressive names for the identifiers. You can find a list of a mapping of the cryptic curses names to the Ada names in this table.
  • This is not a typical one-to-one interface mapping. It is close to one-to-one on the functional level. Each (n)curses function has it's counterpart with a more or less similar formal parameter list in the binding. It is not one-to-one with respect to the datatypes. I tried to make records out of the flat chtype and similar structures, so you don't have to do bit operations to mark an attributed character as bold. Just make the boolean member bold of the record true. The binding also hides the structures like WINDOW, PANEL, MENU, FORM etc. ! It's a pure functional API.
  • I try to do as much error checking as possible and feasible in the binding. I will raise an Ada exception when something went wrong in the low-level curses. This has the effect that - at least first time in my life - (n)curses programs have now a very rigid error checking, but - thanks to Ada - you don't have to code the orgiastic error checking style of C.
  • Support for wide characters is currently not in the binding, as it is not really in ncurses at this point in time.

Limitations

  • I provide no SCREEN datatype and functions to set a new screen. If you need this (mostly for debugging I guess), write a small C routine doing all this and import it into your Ada program.
  • I provide no functions to switch on/off curses tracing options. Same suggestion as above.
  • Although Ada95 is an OO Language, this binding doesn't provide an OO abstraction of the (n)curses functionality. As mentioned above it's a thin binding for the (n)curses functions. But without any doubt it would be nice to build on top of this an OO abstraction of (n)curses functionality.
    The only exception is the method how fieldtypes are represented in this Binding. We provide an abstract tagged type Field_Type from which the various fieldtypes are derived.
  • I currently do not support the link_fieldtype functionality of the forms subsystem.
  • The *_IO packages are currently output only.

Hierarchy of packages

If you want to navigate through the html pages of the package specs, click here.

Implementation Details

Behind the abstraction

All the new types like Window, Panel, Menu, Form etc. are just opaque representations of the pointers to the corresponding low level (n)curses structures like WINDOW *, PANEL *, MENU * or FORM *. So you can safely pass them to C routines that expect a pointer to one of those structures.

Extended ripoffline() usage

The official documentation of (n)curses says, that the line parameter determines only whether or not exactly one line is stolen from the top or bottom of the screen. So essentially only the sign of the parameter is evaluated. ncurses has internally implemented it in a way, that uses the line parameter also to control the amount of lines to steal. This mechanism is used in the Rip_Off_Lines routine of the binding.

How user defined field types work

TBD

Enumeration fields handling

The (n)curses documentation says, that the String arrays to be passed to an TYPE_ENUM fieldtype must not be automatic variables. This is not true in this binding, because it is internally arranged to safely copy these values.

Using other Ada compilers

This should basically not be a problem.

Port to other curses implementations

Basically it should not be too hard to make all this run on a regular SVr4 implementation of curses. The problems are probably these:

  • ncurses has some additional features which are presented in this binding. You have two choices to deal with this:
    • Emulate the feature in this binding
    • Raise an exception for non implemented features

    Most likely you will follow a mixed approach. Some features are easy to simulate, others will be hard if not impossible.

I'm quite sure I forgot something.

AdaCurses-20170708/doc/Makefile.in0000644000175100001440000000621612560514435015201 0ustar tomusers# $Id: Makefile.in,v 1.4 2015/08/05 23:15:41 tom Exp $ ############################################################################## # Copyright (c) 2011-2012,2015 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 E. Dickey # # Makefile for AdaCurses manual pages. SHELL = @SHELL@ VPATH = @srcdir@ DESTDIR = @DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ mandir = @mandir@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ DFT_ARG_SUFFIX = @DFT_ARG_SUFFIX@ THIS = AdaCurses DOCDIR = $(DESTDIR)$(datadir)/doc/$(THIS) MANDIR = $(DESTDIR)$(mandir)/man1 all \ sources \ depend \ tags : $(DOCDIR) \ $(MANDIR) : mkdir -p $@ install install.man : $(MANDIR) $(INSTALL_DATA) adacurses${DFT_ARG_SUFFIX}-config.1 $(MANDIR) uninstall uninstall.man : -rm -f $(MANDIR)/adacurses${DFT_ARG_SUFFIX}-config.1 # HTML documentation is optional, usually in a separate package. install.html : $(DOCDIR) cd $(srcdir) && tar -cf - *.htm* ada | tar -C $(DOCDIR) -xf - uninstall.html : -rm -rf $(DOCDIR) mostlyclean : -rm -f core tags TAGS *~ *.bak *.ln *.atac trace clean: mostlyclean distclean realclean: clean -rm -f Makefile *-config.1 AdaCurses-20170708/TODO0000644000175100001440000000600710422526331013046 0ustar tomusers------------------------------------------------------------------------------- -- Copyright (c) 1998-1999,2006 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. -- ------------------------------------------------------------------------------- -- $Id: TODO,v 1.5 2006/04/22 22:23:21 tom Exp $ ------------------------------------------------------------------------------- -- Intensive testing Perhaps the delivery of the Beta will help a bit. -- Documentation Like most WEB pages: under continuous construction -- Style cleanup -- Alternate functions for procedures with out params Comfort purpose -- Sample program Under continuous construction (and it's not a WEB page!!!) -- Make the binding objects a shared library They are rather large, so it would make sense, otherwise Ada95 would look too large, although the generated code is as compact as C or C++. I'll wait a bit until the GNAT people provide some better support to construct shared libraries. -- Think about more inlining -- Check for memory leaks. Oh I would like it so much if the GNAT guys would put an optional GC into their system. AdaCurses-20170708/config.sub0000755000175100001440000010724313101212370014335 0ustar tomusers#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2017 Free Software Foundation, Inc. timestamp='2017-04-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; wasm32) basic_machine=wasm32-unknown ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: AdaCurses-20170708/configure.in0000644000175100001440000004650012720160077014675 0ustar tomusersdnl*************************************************************************** dnl Copyright (c) 2010-2015,2016 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * dnl "Software"), to deal in the Software without restriction, including * dnl without limitation the rights to use, copy, modify, merge, publish, * dnl distribute, distribute with modifications, sublicense, and/or sell * dnl copies of the Software, and to permit persons to whom the Software is * dnl furnished to do so, subject to the following conditions: * dnl * dnl The above copyright notice and this permission notice shall be included * dnl in all copies or substantial portions of the Software. * dnl * dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * dnl * dnl Except as contained in this notice, the name(s) of the above copyright * dnl holders shall not be used in advertising or otherwise to promote the * dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl dnl $Id: configure.in,v 1.62 2016/05/21 22:25:03 tom Exp $ dnl Process this file with autoconf to produce a configure script. dnl dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- AC_PREREQ(2.52.20030208) AC_REVISION($Revision: 1.62 $) AC_INIT(gen/gen.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) CF_TOP_BUILDDIR CF_WITH_SYSTYPE ### Save the given $CFLAGS to allow user-override. cf_user_CFLAGS="$CFLAGS" ### Default install-location CF_CFG_DEFAULTS ### Checks for programs. CF_PROG_CC(gnatgcc gcc cc) AC_PROG_CPP AC_PROG_GCC_TRADITIONAL CF_PROG_CC_C_O(CC,[$CFLAGS $CPPFLAGS]) AC_ARG_PROGRAM CF_PROG_AWK CF_PROG_EGREP AC_PROG_INSTALL CF_PROG_LN_S AC_SYS_LONG_FILE_NAMES # if we find pkg-config, check if we should install the ".pc" files. CF_PKG_CONFIG CF_WITH_PKG_CONFIG_LIBDIR AC_MSG_CHECKING(if you want to build test-programs) AC_ARG_WITH(tests, [ --without-tests suppress build with test-programs], [cf_with_tests=$withval], [cf_with_tests=yes]) AC_MSG_RESULT($cf_with_tests) AC_MSG_CHECKING(if we should assume mixed-case filenames) AC_ARG_ENABLE(mixed-case, [ --enable-mixed-case tic should assume mixed-case filenames], [enable_mixedcase=$enableval], [enable_mixedcase=auto]) AC_MSG_RESULT($enable_mixedcase) if test "$enable_mixedcase" = "auto" ; then CF_MIXEDCASE_FILENAMES else cf_cv_mixedcase=$enable_mixedcase if test "$enable_mixedcase" = "yes" ; then AC_DEFINE(MIXEDCASE_FILENAMES) fi fi # do this after mixed-case option (tags/TAGS is not as important as tic). AC_PROG_MAKE_SET CF_MAKE_TAGS CF_MAKEFLAGS dnl These are standard among *NIX systems, but not when cross-compiling AC_CHECK_TOOL(RANLIB, ranlib, ':') AC_CHECK_TOOL(LD, ld, ld) AC_CHECK_TOOL(AR, ar, ar) CF_AR_FLAGS CF_PATHSEP dnl Special option for use by system-builders: the install-prefix is used to dnl adjust the location into which the actual install is done, so that an dnl archive can be built without modifying the host system's configuration. AC_MSG_CHECKING(if you have specified an install-prefix) AC_ARG_WITH(install-prefix, [ --with-install-prefix prefixes actual install-location ($DESTDIR)], [case "$withval" in (yes|no) ;; (*) DESTDIR="$withval" ;; esac]) AC_MSG_RESULT($DESTDIR) AC_SUBST(DESTDIR) ############################################################################### CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:) # If we're cross-compiling, allow the user to override the tools and their # options. The configure script is oriented toward identifying the host # compiler, etc., but we need a build compiler to generate parts of the source. CF_BUILD_CC ############################################################################### CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:) ### Options to allow the user to specify the set of libraries which are used. ### Use "--without-normal --with-shared" to allow the default model to be ### shared, for example. cf_list_models="" AC_MSG_CHECKING(if you want to build shared C-objects) AC_ARG_WITH(shared, [ --with-shared generate shared C-objects (needed for --with-ada-sharedlib)], [with_shared=$withval], [with_shared=no]) AC_MSG_RESULT($with_shared) test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" AC_MSG_CHECKING(for specified models) test -z "$cf_list_models" && cf_list_models=normal AC_MSG_RESULT($cf_list_models) ### Use the first model as the default, and save its suffix for use in building ### up test-applications. AC_MSG_CHECKING(for default model) DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'` AC_MSG_RESULT($DFT_LWR_MODEL) CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal") AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL") CF_NCURSES_ADDON CF_WITH_LIB_PREFIX(cf_prefix) LIB_SUFFIX= AC_SUBST(LIB_SUFFIX) ############################################################################### dnl Not all ports of gcc support the -g option if test X"$CC_G_OPT" = X"" ; then CC_G_OPT='-g' test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT='' fi AC_SUBST(CC_G_OPT) AC_MSG_CHECKING(for default loader flags) case $DFT_LWR_MODEL in (normal) LD_MODEL='' ;; (debug) LD_MODEL=$CC_G_OPT ;; (profile) LD_MODEL='-pg';; (shared) LD_MODEL='' ;; esac AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg) AC_MSG_RESULT($LD_MODEL) CF_SHARED_OPTS # The test/sample programs in the original tree link using rpath option. # Make it optional for packagers. if test -n "$LOCAL_LDFLAGS" then AC_MSG_CHECKING(if you want to link sample programs with rpath option) AC_ARG_ENABLE(rpath-link, [ --enable-rpath-link link sample programs with rpath option], [with_rpath_link=$enableval], [with_rpath_link=yes]) AC_MSG_RESULT($with_rpath_link) if test "$with_rpath_link" = no then LOCAL_LDFLAGS= LOCAL_LDFLAGS2= fi fi ############################################################################### CF_HELP_MESSAGE(Fine-Tuning Your Configuration:) ### use option --enable-broken-linker to force on use of broken-linker support AC_MSG_CHECKING(if you want broken-linker support code) AC_ARG_ENABLE(broken_linker, [ --enable-broken_linker compile with broken-linker support code], [with_broken_linker=$enableval], [with_broken_linker=${BROKEN_LINKER:-no}]) AC_MSG_RESULT($with_broken_linker) BROKEN_LINKER=0 if test "$with_broken_linker" = yes ; then AC_DEFINE(BROKEN_LINKER) BROKEN_LINKER=1 elif test "$DFT_LWR_MODEL" = shared ; then case $cf_cv_system_name in (cygwin*) AC_DEFINE(BROKEN_LINKER) BROKEN_LINKER=1 CF_VERBOSE(cygwin linker is broken anyway) ;; esac fi AC_SUBST(BROKEN_LINKER) # Check to define _XOPEN_SOURCE "automatically" CF_XOPEN_SOURCE CF_LARGEFILE ### Enable compiling-in rcs id's AC_MSG_CHECKING(if RCS identifiers should be compiled-in) AC_ARG_WITH(rcs-ids, [ --with-rcs-ids compile-in RCS identifiers], [with_rcs_ids=$withval], [with_rcs_ids=no]) AC_MSG_RESULT($with_rcs_ids) test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS,1,[Define to 1 if RCS identifiers should be compiled-in)]) ############################################################################### CF_HELP_MESSAGE(Extensions:) ### Note that some functions (such as const) are normally disabled anyway. AC_MSG_CHECKING(if you want to build with function extensions) AC_ARG_ENABLE(ext-funcs, [ --disable-ext-funcs disable function-extensions], [with_ext_funcs=$enableval], [with_ext_funcs=yes]) AC_MSG_RESULT($with_ext_funcs) if test "$with_ext_funcs" = yes ; then NCURSES_EXT_FUNCS=1 AC_DEFINE(HAVE_USE_DEFAULT_COLORS,1,[Define to 1 if we have use_default_colors function]) AC_DEFINE(NCURSES_EXT_FUNCS,1,[Define to 1 if we have ncurses extended functions]) else NCURSES_EXT_FUNCS=0 fi AC_SUBST(NCURSES_EXT_FUNCS) ### use option --enable-const to turn on use of const beyond that in XSI. AC_MSG_CHECKING(for extended use of const keyword) AC_ARG_ENABLE(const, [ --enable-const compile with extra/non-standard const], [with_ext_const=$enableval], [with_ext_const=no]) AC_MSG_RESULT($with_ext_const) NCURSES_CONST='/*nothing*/' if test "$with_ext_const" = yes ; then NCURSES_CONST=const fi AC_SUBST(NCURSES_CONST) ############################################################################### # These options are relatively safe to experiment with. CF_HELP_MESSAGE(Development Code:) AC_MSG_CHECKING(if you want all development code) AC_ARG_WITH(develop, [ --without-develop disable development options], [with_develop=$withval], [with_develop=no]) AC_MSG_RESULT($with_develop) ############################################################################### # These are just experimental, probably should not be in a package: CF_HELP_MESSAGE(Experimental Code:) # This is still experimental (20080329), but should ultimately be moved to # the script-block --with-normal, etc. CF_WITH_PTHREAD AC_MSG_CHECKING(if you want to use weak-symbols for pthreads) AC_ARG_ENABLE(weak-symbols, [ --enable-weak-symbols enable weak-symbols for pthreads], [use_weak_symbols=$withval], [use_weak_symbols=no]) AC_MSG_RESULT($use_weak_symbols) if test "$use_weak_symbols" = yes ; then CF_WEAK_SYMBOLS else cf_cv_weak_symbols=no fi if test $cf_cv_weak_symbols = yes ; then AC_DEFINE(USE_WEAK_SYMBOLS,1,[Define to 1 to enable weak-symbols for pthreads]) fi PTHREAD= if test "$with_pthread" = "yes" ; then AC_DEFINE(USE_PTHREADS,1,[Define to 1 to use the pthreads library]) enable_reentrant=yes if test $cf_cv_weak_symbols = yes ; then PTHREAD=-lpthread fi fi AC_SUBST(PTHREAD) # OpenSUSE is installing ncurses6, using reentrant option. AC_CHECK_FUNC(_nc_TABSIZE,[assume_reentrant=yes], [assume_reentrant=no]) # Reentrant code has to be opaque; there's little advantage to making ncurses # opaque outside of that, so there is no --enable-opaque option. We can use # this option without --with-pthreads, but this will be always set for # pthreads. AC_MSG_CHECKING(if you want experimental reentrant code) AC_ARG_ENABLE(reentrant, [ --enable-reentrant compile with experimental reentrant code], [with_reentrant=$enableval], [with_reentrant=$assume_reentrant]) AC_MSG_RESULT($with_reentrant) if test "$with_reentrant" = yes ; then cf_cv_enable_reentrant=1 if test $cf_cv_weak_symbols = yes ; then CF_REMOVE_LIB(LIBS,$LIBS,pthread) elif test "$assume_reentrant" = no ; then LIB_SUFFIX="t${LIB_SUFFIX}" fi AC_DEFINE(USE_REENTRANT,1,[Define to 1 to compile with experimental reentrant code]) else cf_cv_enable_reentrant=0 fi AC_SUBST(cf_cv_enable_reentrant) ### Allow using a different wrap-prefix if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then AC_MSG_CHECKING(for prefix used to wrap public variables) AC_ARG_WITH(wrap-prefix, [ --with-wrap-prefix=XXX override prefix used for public variables], [NCURSES_WRAP_PREFIX=$withval], [NCURSES_WRAP_PREFIX=_nc_]) AC_MSG_RESULT($NCURSES_WRAP_PREFIX) else NCURSES_WRAP_PREFIX=_nc_ fi AC_SUBST(NCURSES_WRAP_PREFIX) AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX",[Define to override _nc_ ncurses internal prefix]) ############################################################################### CF_HELP_MESSAGE(Testing/development Options:) ### use option --disable-echo to suppress full display compiling commands CF_DISABLE_ECHO ### use option --enable-warnings to turn on all gcc warnings AC_MSG_CHECKING(if you want to see compiler warnings) AC_ARG_ENABLE(warnings, [ --enable-warnings build: turn on GCC compiler warnings], [with_warnings=$enableval]) AC_MSG_RESULT($with_warnings) if test "x$with_warnings" = "xyes"; then CF_ADD_ADAFLAGS(-gnatg) CF_GCC_WARNINGS(Wno-unknown-pragmas Wswitch-enum) fi CF_GCC_ATTRIBUTES ### use option --enable-assertions to turn on generation of assertion code AC_MSG_CHECKING(if you want to enable runtime assertions) AC_ARG_ENABLE(assertions, [ --enable-assertions test: turn on generation of assertion code], [with_assertions=$enableval], [with_assertions=no]) AC_MSG_RESULT($with_assertions) if test -n "$GCC" then if test "$with_assertions" = no then CPPFLAGS="$CPPFLAGS -DNDEBUG" else CF_ADD_ADAFLAGS(-gnata) fi fi ### use option --disable-leaks to suppress "permanent" leaks, for testing AC_DEFINE(HAVE_NC_ALLOC_H,1,[Define to 1 if we have nc_alloc.h header]) ### use option --enable-expanded to generate certain macros as functions AC_ARG_ENABLE(expanded, [ --enable-expanded test: generate functions for certain macros], [test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED,1,[Define to 1 if ncurses macros should be expanded as functions])]) ### use option --disable-macros to suppress macros in favor of functions AC_ARG_ENABLE(macros, [ --disable-macros test: use functions rather than macros], [test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS,1,[Define to 1 if ncurses macros should be expanded as functions])]) # Normally we only add trace() to the debug-library. Allow this to be # extended to all models of the ncurses library: cf_all_traces=no case "$CFLAGS $CPPFLAGS" in (*-DTRACE*) cf_all_traces=yes ;; esac AC_MSG_CHECKING(whether to add trace feature to all models) AC_ARG_WITH(trace, [ --with-trace test: add trace() function to all models of ncurses], [cf_with_trace=$withval], [cf_with_trace=$cf_all_traces]) AC_MSG_RESULT($cf_with_trace) if test "$cf_with_trace" = yes ; then ADA_TRACE=TRUE CF_ADD_CFLAGS(-DTRACE) else ADA_TRACE=FALSE fi AC_SUBST(ADA_TRACE) CF_DISABLE_GNAT_PROJECTS ### Checks for libraries. case $cf_cv_system_name in (*mingw32*) ;; (*) AC_CHECK_FUNC(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY),[ AC_CHECK_LIB(bsd, gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define to 1 if we have gettimeofday]) LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday ;; esac ### Checks for header files. AC_CHECK_SIZEOF([signed char], 0) AC_STDC_HEADERS AC_HEADER_DIRENT AC_HEADER_TIME ### checks for compiler characteristics AC_LANG_C AC_C_CONST ### Checks for external-data CF_LINK_DATAONLY ### Checks for library functions. CF_MKSTEMP dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then CF_STRIP_G_OPT(CFLAGS) CF_STRIP_G_OPT(CXXFLAGS) fi CF_HELP_MESSAGE(Ada95 Binding Options:) cf_with_ada=yes dnl Check for availability of GNU Ada Translator (GNAT). dnl At the moment we support no other Ada95 compiler. if test "$cf_with_ada" != "no" ; then CF_PROG_GNAT if test "$cf_cv_prog_gnat_correct" = yes; then CF_FIXUP_ADAFLAGS CF_GNATPREP_OPT_T CF_GNAT_GENERICS CF_GNAT_SIGINT CF_GNAT_PROJECTS CF_WITH_ADA_COMPILER cf_ada_package=terminal_interface AC_SUBST(cf_ada_package) CF_WITH_ADA_INCLUDE CF_WITH_ADA_OBJECTS CF_WITH_ADA_SHAREDLIB else AC_MSG_ERROR(No usable Ada compiler found) fi else AC_MSG_ERROR(The Ada compiler is needed for this package) fi ################################################################################ # not needed TINFO_LDFLAGS2= AC_SUBST(TINFO_LDFLAGS2) TINFO_LIBS= AC_SUBST(TINFO_LIBS) ### Construct the list of include-directories to be generated CF_INCLUDE_DIRS CF_ADA_INCLUDE_DIRS ### Build up pieces for makefile rules AC_MSG_CHECKING(default library suffix) CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("") AC_MSG_RESULT($DFT_ARG_SUFFIX) AC_MSG_CHECKING(default library-dependency suffix) CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_LIB_SUFFIX,DFT_DEP_SUFFIX)dnl AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a") AC_MSG_RESULT($DFT_DEP_SUFFIX) AC_MSG_CHECKING(default object directory) CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj") AC_MSG_RESULT($DFT_OBJ_SUBDIR) ### Set up low-level terminfo dependencies for makefiles. if test "$DFT_LWR_MODEL" = shared ; then case $cf_cv_system_name in (cygwin*) # "lib" files have ".dll.a" suffix, "cyg" files have ".dll" ;; (msys*) # "lib" files have ".dll.a" suffix, "msys-" files have ".dll" ;; esac fi USE_CFG_SUFFIX=${DFT_ARG_SUFFIX} AC_SUBST(USE_CFG_SUFFIX) ### Construct the list of subdirectories for which we'll customize makefiles ### with the appropriate compile-rules. SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in" AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR',[Define to override ':' as the library path-separator]) ### Now that we're done running tests, add the compiler-warnings, if any CF_ADD_CFLAGS($EXTRA_CFLAGS) ################################################################################ TEST_ARG2= AC_SUBST(TEST_ARG2) TEST_LIBS2= AC_SUBST(TEST_LIBS2) dnl for separate build, this is good enough for "sh $(top_srcdir)/misc/shlib" NCURSES_SHLIB2="sh -c" AC_SUBST(NCURSES_SHLIB2) ADA_SUBDIRS="include gen src doc" if test "x$cf_with_tests" != "xno" ; then ADA_SUBDIRS="$ADA_SUBDIRS samples" fi for cf_dir in $ADA_SUBDIRS do SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile" done AC_SUBST(ADA_SUBDIRS) NCURSES_TREE="#" AC_SUBST(NCURSES_TREE) EXTERNAL_TREE= AC_SUBST(EXTERNAL_TREE) # match layout used by make-tar.sh ADAHTML_DIR=../doc/ada AC_SUBST(ADAHTML_DIR) if test "x$cross_compiling" = xyes ; then ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)' else ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)' fi AC_SUBST(ADAGEN_LDFLAGS) AC_OUTPUT( \ $SUB_MAKEFILES \ doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in \ Makefile,[ if test -z "$USE_OLD_MAKERULES" ; then $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile fi ],[ ### Special initialization commands, used to pass information from the ### configuration-run into config.status AWK="$AWK" DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX" DFT_LWR_MODEL="$DFT_LWR_MODEL" LIB_NAME="$LIB_NAME" LIB_PREFIX="$LIB_PREFIX" LIB_SUFFIX="$LIB_SUFFIX" LN_S="$LN_S" NCURSES_MAJOR="$NCURSES_MAJOR" NCURSES_MINOR="$NCURSES_MINOR" NCURSES_PATCH="$NCURSES_PATCH" USE_OLD_MAKERULES="$USE_OLD_MAKERULES" cf_cv_abi_version="$cf_cv_abi_version" cf_cv_rel_version="$cf_cv_rel_version" cf_cv_rm_so_locs="$cf_cv_rm_so_locs" cf_cv_shared_soname='$cf_cv_shared_soname' cf_cv_shlib_version="$cf_cv_shlib_version" cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" cf_cv_system_name="$cf_cv_system_name" host="$host" target="$target" ],cat)dnl ${MAKE:-make} preinstall AdaCurses-20170708/mk-1st.awk0000644000175100001440000000662111530702161014176 0ustar tomusers# $Id: mk-1st.awk,v 1.4 2011/02/22 09:40:01 tom Exp $ ############################################################################## # Copyright (c) 2010,2011 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 E. Dickey # # Generate compile-rules for the Ada95 modules that we are using in libraries # or programs. This script is used for older versions of gnatmake, which do # not build libraries reliably, e.g., gnatmake 3.15. # # Fields in src/modules: # $1 = module name # $2 = directory where spec-dependency ".ads" is found # $3 = directory where body-dependency ".adb" is found # $4 = unit to compile (spec or body) # BEGIN { printf "\n"; printf "# generated by Ada95/mk-1st.awk\n"; } /^[#]/ { next } /^$/ { next } { printf "\n"; printf "%s.o :", $1; if ( $2 == "none" ) { pre_spec = ""; } else if ( $2 == "." ) { pre_spec = ""; printf " \\\n\t\t%s.ads", $1; } else { pre_spec = sprintf("%s/", $2); printf " \\\n\t\t%s%s.ads", pre_spec, $1; } if ( $3 == "none" ) { pre_body = ""; } else if ( $3 == "." ) { pre_body = ""; printf " \\\n\t\t%s.adb", $1; } else { pre_body = sprintf("%s/", $3); printf " \\\n\t\t%s%s.adb", pre_body, $1; printf " \\\n\t\t$(BASEDEPS)"; } if ( $4 == "spec" ) { suffix = "ads"; prefix = pre_spec; } else { suffix = "adb"; prefix = pre_body; } printf "\n"; printf "\t$(ADA) $(ADAFLAGS) -c -o $@ %s%s.%s\n", prefix, $1, suffix } END { print "" } AdaCurses-20170708/MANIFEST0000644000175100001440000003034513130303161013502 0ustar tomusers./MANIFEST ./Makefile.in ./NEWS ./README ./TODO ./aclocal.m4 ./config.guess ./config.sub ./configure ./configure.in ./doc/Ada95.html ./doc/MKada_config.in ./doc/Makefile.in ./doc/ada/files.htm ./doc/ada/files/T.htm ./doc/ada/funcs.htm ./doc/ada/funcs/A.htm ./doc/ada/funcs/B.htm ./doc/ada/funcs/C.htm ./doc/ada/funcs/D.htm ./doc/ada/funcs/E.htm ./doc/ada/funcs/F.htm ./doc/ada/funcs/G.htm ./doc/ada/funcs/H.htm ./doc/ada/funcs/I.htm ./doc/ada/funcs/K.htm ./doc/ada/funcs/L.htm ./doc/ada/funcs/M.htm ./doc/ada/funcs/N.htm ./doc/ada/funcs/O.htm ./doc/ada/funcs/P.htm ./doc/ada/funcs/Q.htm ./doc/ada/funcs/R.htm ./doc/ada/funcs/S.htm ./doc/ada/funcs/T.htm ./doc/ada/funcs/U.htm ./doc/ada/funcs/V.htm ./doc/ada/funcs/W.htm ./doc/ada/index.htm ./doc/ada/main.htm ./doc/ada/table.html ./doc/ada/terminal_interface-curses-aux__adb.htm ./doc/ada/terminal_interface-curses-aux__ads.htm ./doc/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm ./doc/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm ./doc/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm ./doc/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm ./doc/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm ./doc/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm ./doc/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm ./doc/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm ./doc/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm ./doc/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm ./doc/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm ./doc/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm ./doc/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm ./doc/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm ./doc/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm ./doc/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm ./doc/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm ./doc/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm ./doc/ada/terminal_interface-curses-forms-field_types-user__adb.htm ./doc/ada/terminal_interface-curses-forms-field_types-user__ads.htm ./doc/ada/terminal_interface-curses-forms-field_types__adb.htm ./doc/ada/terminal_interface-curses-forms-field_types__ads.htm ./doc/ada/terminal_interface-curses-forms-field_user_data__adb.htm ./doc/ada/terminal_interface-curses-forms-field_user_data__ads.htm ./doc/ada/terminal_interface-curses-forms-form_user_data__adb.htm ./doc/ada/terminal_interface-curses-forms-form_user_data__ads.htm ./doc/ada/terminal_interface-curses-forms__adb.htm ./doc/ada/terminal_interface-curses-forms__ads.htm ./doc/ada/terminal_interface-curses-menus-item_user_data__adb.htm ./doc/ada/terminal_interface-curses-menus-item_user_data__ads.htm ./doc/ada/terminal_interface-curses-menus-menu_user_data__adb.htm ./doc/ada/terminal_interface-curses-menus-menu_user_data__ads.htm ./doc/ada/terminal_interface-curses-menus__adb.htm ./doc/ada/terminal_interface-curses-menus__ads.htm ./doc/ada/terminal_interface-curses-mouse__adb.htm ./doc/ada/terminal_interface-curses-mouse__ads.htm ./doc/ada/terminal_interface-curses-panels-user_data__adb.htm ./doc/ada/terminal_interface-curses-panels-user_data__ads.htm ./doc/ada/terminal_interface-curses-panels__adb.htm ./doc/ada/terminal_interface-curses-panels__ads.htm ./doc/ada/terminal_interface-curses-putwin__adb.htm ./doc/ada/terminal_interface-curses-putwin__ads.htm ./doc/ada/terminal_interface-curses-termcap__adb.htm ./doc/ada/terminal_interface-curses-termcap__ads.htm ./doc/ada/terminal_interface-curses-terminfo__adb.htm ./doc/ada/terminal_interface-curses-terminfo__ads.htm ./doc/ada/terminal_interface-curses-text_io-aux__adb.htm ./doc/ada/terminal_interface-curses-text_io-aux__ads.htm ./doc/ada/terminal_interface-curses-text_io-complex_io__adb.htm ./doc/ada/terminal_interface-curses-text_io-complex_io__ads.htm ./doc/ada/terminal_interface-curses-text_io-decimal_io__adb.htm ./doc/ada/terminal_interface-curses-text_io-decimal_io__ads.htm ./doc/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm ./doc/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm ./doc/ada/terminal_interface-curses-text_io-fixed_io__adb.htm ./doc/ada/terminal_interface-curses-text_io-fixed_io__ads.htm ./doc/ada/terminal_interface-curses-text_io-float_io__adb.htm ./doc/ada/terminal_interface-curses-text_io-float_io__ads.htm ./doc/ada/terminal_interface-curses-text_io-integer_io__adb.htm ./doc/ada/terminal_interface-curses-text_io-integer_io__ads.htm ./doc/ada/terminal_interface-curses-text_io-modular_io__adb.htm ./doc/ada/terminal_interface-curses-text_io-modular_io__ads.htm ./doc/ada/terminal_interface-curses-text_io__adb.htm ./doc/ada/terminal_interface-curses-text_io__ads.htm ./doc/ada/terminal_interface-curses-trace__adb.htm ./doc/ada/terminal_interface-curses-trace__ads.htm ./doc/ada/terminal_interface-curses__adb.htm ./doc/ada/terminal_interface-curses__ads.htm ./doc/ada/terminal_interface-curses_constants__ads.htm ./doc/ada/terminal_interface__ads.htm ./gen/Makefile.in ./gen/adacurses-config.in ./gen/gen.c ./gen/html.m4 ./gen/normal.m4 ./gen/table.m4 ./gen/terminal_interface-curses-aux.ads.m4 ./gen/terminal_interface-curses-forms-field_types.ads.m4 ./gen/terminal_interface-curses-forms-field_user_data.ads.m4 ./gen/terminal_interface-curses-forms-form_user_data.ads.m4 ./gen/terminal_interface-curses-forms.ads.m4 ./gen/terminal_interface-curses-menus-item_user_data.ads.m4 ./gen/terminal_interface-curses-menus-menu_user_data.ads.m4 ./gen/terminal_interface-curses-menus.ads.m4 ./gen/terminal_interface-curses-mouse.ads.m4 ./gen/terminal_interface-curses-panels-user_data.ads.m4 ./gen/terminal_interface-curses-panels.ads.m4 ./gen/terminal_interface-curses-trace.ads.m4 ./gen/terminal_interface-curses.adb.m4 ./gen/terminal_interface-curses.ads.m4 ./include/MKncurses_def.sh ./include/Makefile.in ./include/ncurses_cfg.hin ./include/ncurses_defs ./install-sh ./make-tar.sh ./mk-1st.awk ./package/AdaCurses-doc.spec ./package/AdaCurses.spec ./package/debian/changelog ./package/debian/compat ./package/debian/control ./package/debian/copyright ./package/debian/docs ./package/debian/rules ./package/debian/source/format ./package/debian/watch ./samples/Makefile.in ./samples/README ./samples/explain.txt ./samples/ncurses.adb ./samples/ncurses2-acs_and_scroll.adb ./samples/ncurses2-acs_and_scroll.ads ./samples/ncurses2-acs_display.adb ./samples/ncurses2-acs_display.ads ./samples/ncurses2-attr_test.adb ./samples/ncurses2-attr_test.ads ./samples/ncurses2-color_edit.adb ./samples/ncurses2-color_edit.ads ./samples/ncurses2-color_test.adb ./samples/ncurses2-color_test.ads ./samples/ncurses2-demo_forms.adb ./samples/ncurses2-demo_forms.ads ./samples/ncurses2-demo_pad.adb ./samples/ncurses2-demo_pad.ads ./samples/ncurses2-demo_panels.adb ./samples/ncurses2-demo_panels.ads ./samples/ncurses2-flushinp_test.adb ./samples/ncurses2-flushinp_test.ads ./samples/ncurses2-genericputs.adb ./samples/ncurses2-genericputs.ads ./samples/ncurses2-getch.ads ./samples/ncurses2-getch_test.adb ./samples/ncurses2-getch_test.ads ./samples/ncurses2-getopt.adb ./samples/ncurses2-getopt.ads ./samples/ncurses2-m.adb ./samples/ncurses2-m.ads ./samples/ncurses2-menu_test.adb ./samples/ncurses2-menu_test.ads ./samples/ncurses2-overlap_test.adb ./samples/ncurses2-overlap_test.ads ./samples/ncurses2-slk_test.adb ./samples/ncurses2-slk_test.ads ./samples/ncurses2-test_sgr_attributes.adb ./samples/ncurses2-test_sgr_attributes.ads ./samples/ncurses2-trace_set.adb ./samples/ncurses2-trace_set.ads ./samples/ncurses2-util.adb ./samples/ncurses2-util.ads ./samples/ncurses2.ads ./samples/rain.adb ./samples/rain.ads ./samples/sample-curses_demo-attributes.adb ./samples/sample-curses_demo-attributes.ads ./samples/sample-curses_demo-mouse.adb ./samples/sample-curses_demo-mouse.ads ./samples/sample-curses_demo.adb ./samples/sample-curses_demo.ads ./samples/sample-explanation.adb ./samples/sample-explanation.ads ./samples/sample-form_demo-aux.adb ./samples/sample-form_demo-aux.ads ./samples/sample-form_demo-handler.adb ./samples/sample-form_demo-handler.ads ./samples/sample-form_demo.adb ./samples/sample-form_demo.ads ./samples/sample-function_key_setting.adb ./samples/sample-function_key_setting.ads ./samples/sample-header_handler.adb ./samples/sample-header_handler.ads ./samples/sample-helpers.adb ./samples/sample-helpers.ads ./samples/sample-keyboard_handler.adb ./samples/sample-keyboard_handler.ads ./samples/sample-manifest.ads ./samples/sample-menu_demo-aux.adb ./samples/sample-menu_demo-aux.ads ./samples/sample-menu_demo-handler.adb ./samples/sample-menu_demo-handler.ads ./samples/sample-menu_demo.adb ./samples/sample-menu_demo.ads ./samples/sample-my_field_type.adb ./samples/sample-my_field_type.ads ./samples/sample-text_io_demo.adb ./samples/sample-text_io_demo.ads ./samples/sample.adb ./samples/sample.ads ./samples/status.adb ./samples/status.ads ./samples/tour.adb ./samples/tour.ads ./src/Makefile.in ./src/c_threaded_variables.c ./src/c_threaded_variables.h ./src/c_varargs_to_ada.c ./src/c_varargs_to_ada.h ./src/library-cfg.sh ./src/library.gpr ./src/modules ./src/ncurses_compat.c ./src/terminal_interface-curses-aux.adb ./src/terminal_interface-curses-forms-field_types-alpha.adb ./src/terminal_interface-curses-forms-field_types-alpha.ads ./src/terminal_interface-curses-forms-field_types-alphanumeric.adb ./src/terminal_interface-curses-forms-field_types-alphanumeric.ads ./src/terminal_interface-curses-forms-field_types-enumeration-ada.adb ./src/terminal_interface-curses-forms-field_types-enumeration-ada.ads ./src/terminal_interface-curses-forms-field_types-enumeration.adb ./src/terminal_interface-curses-forms-field_types-enumeration.ads ./src/terminal_interface-curses-forms-field_types-intfield.adb ./src/terminal_interface-curses-forms-field_types-intfield.ads ./src/terminal_interface-curses-forms-field_types-ipv4_address.adb ./src/terminal_interface-curses-forms-field_types-ipv4_address.ads ./src/terminal_interface-curses-forms-field_types-numeric.adb ./src/terminal_interface-curses-forms-field_types-numeric.ads ./src/terminal_interface-curses-forms-field_types-regexp.adb ./src/terminal_interface-curses-forms-field_types-regexp.ads ./src/terminal_interface-curses-forms-field_types-user-choice.adb ./src/terminal_interface-curses-forms-field_types-user-choice.ads ./src/terminal_interface-curses-forms-field_types-user.adb ./src/terminal_interface-curses-forms-field_types-user.ads ./src/terminal_interface-curses-forms-field_types.adb ./src/terminal_interface-curses-forms-field_user_data.adb ./src/terminal_interface-curses-forms-form_user_data.adb ./src/terminal_interface-curses-forms.adb ./src/terminal_interface-curses-menus-item_user_data.adb ./src/terminal_interface-curses-menus-menu_user_data.adb ./src/terminal_interface-curses-menus.adb ./src/terminal_interface-curses-mouse.adb ./src/terminal_interface-curses-panels-user_data.adb ./src/terminal_interface-curses-panels.adb ./src/terminal_interface-curses-putwin.adb ./src/terminal_interface-curses-putwin.ads ./src/terminal_interface-curses-termcap.adb ./src/terminal_interface-curses-termcap.ads ./src/terminal_interface-curses-terminfo.adb ./src/terminal_interface-curses-terminfo.ads ./src/terminal_interface-curses-text_io-aux.adb ./src/terminal_interface-curses-text_io-aux.ads ./src/terminal_interface-curses-text_io-complex_io.adb ./src/terminal_interface-curses-text_io-complex_io.ads ./src/terminal_interface-curses-text_io-decimal_io.adb ./src/terminal_interface-curses-text_io-decimal_io.ads ./src/terminal_interface-curses-text_io-enumeration_io.adb ./src/terminal_interface-curses-text_io-enumeration_io.ads ./src/terminal_interface-curses-text_io-fixed_io.adb ./src/terminal_interface-curses-text_io-fixed_io.ads ./src/terminal_interface-curses-text_io-float_io.adb ./src/terminal_interface-curses-text_io-float_io.ads ./src/terminal_interface-curses-text_io-integer_io.adb ./src/terminal_interface-curses-text_io-integer_io.ads ./src/terminal_interface-curses-text_io-modular_io.adb ./src/terminal_interface-curses-text_io-modular_io.ads ./src/terminal_interface-curses-text_io.adb ./src/terminal_interface-curses-text_io.ads ./src/terminal_interface-curses-trace.adb_p ./src/terminal_interface.ads AdaCurses-20170708/src/0000755000175100001440000000000013130303161013133 5ustar tomusersAdaCurses-20170708/src/library-cfg.sh0000755000175100001440000000531312767352577015733 0ustar tomusers#!/bin/sh ############################################################################## # Copyright (c) 2016 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. # ############################################################################## # # $Id: library-cfg.sh,v 1.1 2016/09/17 23:45:03 tom Exp $ # # Work around incompatible behavior introduced with gnat6, which causes # gnatmake to attempt to compile all of the C objects which might be part of # the project. This can only work if we provide the compiler flags (done here # by making a copy of the project file with that information filled in). input=$1 shift 1 param= while test $# != 0 do test -n "$param" && param="$param," param="$param\"$1\"" shift 1 done sed \ -e '/for Default_Switches ("C") use/s,-- ,,' \ -e '/for Default_Switches ("C") use/s% use .*'%" use($param);"% \ $input exit 0 AdaCurses-20170708/src/terminal_interface-curses-forms-form_user_data.adb0000644000175100001440000001013312340207631025061 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Form_User_Data -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2014 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, 1996 -- Version Control: -- $Revision: 1.15 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- | -- |===================================================================== -- | man page form__userptr.3x -- |===================================================================== -- | with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Form_User_Data is use type Interfaces.C.int; -- | -- | -- | procedure Set_User_Data (Frm : Form; Data : User_Access) is function Set_Form_Userptr (Frm : Form; Data : User_Access) return Eti_Error; pragma Import (C, Set_Form_Userptr, "set_form_userptr"); begin Eti_Exception (Set_Form_Userptr (Frm, Data)); end Set_User_Data; -- | -- | -- | function Get_User_Data (Frm : Form) return User_Access is function Form_Userptr (Frm : Form) return User_Access; pragma Import (C, Form_Userptr, "form_userptr"); begin return Form_Userptr (Frm); end Get_User_Data; procedure Get_User_Data (Frm : Form; Data : out User_Access) is begin Data := Get_User_Data (Frm); end Get_User_Data; end Terminal_Interface.Curses.Forms.Form_User_Data; AdaCurses-20170708/src/c_varargs_to_ada.c0000644000175100001440000000753212340207742016576 0ustar tomusers/**************************************************************************** * Copyright (c) 2011,2014 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: Nicolas Boulenguez, 2011 * ****************************************************************************/ /* Version Control $Id: c_varargs_to_ada.c,v 1.6 2014/05/24 21:32:18 tom Exp $ --------------------------------------------------------------------------*/ /* */ #include "c_varargs_to_ada.h" int set_field_type_alnum(FIELD *field, int minimum_width) { return set_field_type(field, TYPE_ALNUM, minimum_width); } int set_field_type_alpha(FIELD *field, int minimum_width) { return set_field_type(field, TYPE_ALPHA, minimum_width); } int set_field_type_enum(FIELD *field, char **value_list, int case_sensitive, int unique_match) { return set_field_type(field, TYPE_ENUM, value_list, case_sensitive, unique_match); } int set_field_type_integer(FIELD *field, int precision, long minimum, long maximum) { return set_field_type(field, TYPE_INTEGER, precision, minimum, maximum); } int set_field_type_numeric(FIELD *field, int precision, double minimum, double maximum) { return set_field_type(field, TYPE_NUMERIC, precision, minimum, maximum); } int set_field_type_regexp(FIELD *field, char *regular_expression) { return set_field_type(field, TYPE_REGEXP, regular_expression); } int set_field_type_ipv4(FIELD *field) { return set_field_type(field, TYPE_IPV4); } int set_field_type_user(FIELD *field, FIELDTYPE *fieldtype, void *arg) { return set_field_type(field, fieldtype, arg); } void * void_star_make_arg(va_list *list) { return va_arg(*list, void *); } #ifdef TRACE void _traces(const char *fmt, char *arg) { _tracef(fmt, arg); } #endif AdaCurses-20170708/src/library.gpr0000644000175100001440000000631612767357422015347 0ustar tomusers------------------------------------------------------------------------------ -- Copyright (c) 2010-2014,2016 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. -- ------------------------------------------------------------------------------ -- $Id: library.gpr,v 1.11 2016/09/18 00:25:54 tom Exp $ -- http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html -- http://www.adaworld.com/debian/debian-ada-policy.html project AdaCurses is Build_Dir := External ("BUILD_DIR"); Source_Dir := External ("SOURCE_DIR"); Source_Dir2 := External ("SOURCE_DIR2"); Kind := External ("LIB_KIND"); for Library_Name use External ("LIB_NAME"); for Library_Version use External ("SONAME"); for Library_Kind use Kind; for Library_Dir use Build_Dir & "/lib"; for Object_Dir use Build_Dir & "/" & Kind & "-obj"; for Library_ALI_Dir use Build_Dir & "/" & Kind & "-ali"; for Source_Dirs use (Source_Dir & "/src", Source_Dir2, Build_Dir & "/src"); for Library_Options use ("-lncurses", "-lpanel", "-lmenu", "-lform"); package Compiler is for Default_Switches ("Ada") use ("-g", "-O2", "-gnatafno", "-gnatVa", -- All validity checks "-gnatwa"); -- Activate all optional errors -- for Default_Switches ("C") use end Compiler; for Languages use ("C", "Ada"); end AdaCurses; AdaCurses-20170708/src/terminal_interface-curses-putwin.adb0000644000175100001440000000763607746514446022332 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.PutWin -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000,2003 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, 1996 -- Version Control: -- $Revision: 1.4 $ -- Binding Version 01.00 with Ada.Streams.Stream_IO.C_Streams; with Interfaces.C_Streams; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.PutWin is package ICS renames Interfaces.C_Streams; package ACS renames Ada.Streams.Stream_IO.C_Streams; use type C_Int; procedure Put_Window (Win : Window; File : Ada.Streams.Stream_IO.File_Type) is function putwin (Win : Window; f : ICS.FILEs) return C_Int; pragma Import (C, putwin, "putwin"); R : constant C_Int := putwin (Win, ACS.C_Stream (File)); begin if R /= Curses_Ok then raise Curses_Exception; end if; end Put_Window; function Get_Window (File : Ada.Streams.Stream_IO.File_Type) return Window is function getwin (f : ICS.FILEs) return Window; pragma Import (C, getwin, "getwin"); W : constant Window := getwin (ACS.C_Stream (File)); begin if W = Null_Window then raise Curses_Exception; else return W; end if; end Get_Window; end Terminal_Interface.Curses.PutWin; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-numeric.adb0000644000175100001440000000744612340207631026053 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.Numeric -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.14 $ -- $Date: 2014/05/24 21:31:05 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.Numeric is procedure Set_Field_Type (Fld : Field; Typ : Numeric_Field) is type Double is new Interfaces.C.double; function Set_Fld_Type (F : Field := Fld; Arg1 : C_Int; Arg2 : Double; Arg3 : Double) return Eti_Error; pragma Import (C, Set_Fld_Type, "set_field_type_numeric"); begin Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Precision), Arg2 => Double (Typ.Lower_Limit), Arg3 => Double (Typ.Upper_Limit))); Wrap_Builtin (Fld, Typ); end Set_Field_Type; end Terminal_Interface.Curses.Forms.Field_Types.Numeric; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-enumeration.adb0000644000175100001440000001231212340207631026723 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.Enumeration -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration is function Create (Info : Enumeration_Info; Auto_Release_Names : Boolean := False) return Enumeration_Field is procedure Release_String is new Ada.Unchecked_Deallocation (String, String_Access); E : Enumeration_Field; L : constant size_t := 1 + size_t (Info.C); S : String_Access; begin E.Case_Sensitive := Info.Case_Sensitive; E.Match_Must_Be_Unique := Info.Match_Must_Be_Unique; E.Arr := new chars_ptr_array (size_t (1) .. L); for I in 1 .. Positive (L - 1) loop if Info.Names (I) = null then raise Form_Exception; end if; E.Arr.all (size_t (I)) := New_String (Info.Names (I).all); if Auto_Release_Names then S := Info.Names (I); Release_String (S); end if; end loop; E.Arr.all (L) := Null_Ptr; return E; end Create; procedure Release (Enum : in out Enumeration_Field) is I : size_t := 0; P : chars_ptr; begin loop P := Enum.Arr.all (I); exit when P = Null_Ptr; Free (P); Enum.Arr.all (I) := Null_Ptr; I := I + 1; end loop; Enum.Arr := null; end Release; procedure Set_Field_Type (Fld : Field; Typ : Enumeration_Field) is function Set_Fld_Type (F : Field := Fld; Arg1 : chars_ptr_array; Arg2 : C_Int; Arg3 : C_Int) return Eti_Error; pragma Import (C, Set_Fld_Type, "set_field_type_enum"); begin if Typ.Arr = null then raise Form_Exception; end if; Eti_Exception (Set_Fld_Type (Arg1 => Typ.Arr.all, Arg2 => C_Int (Boolean'Pos (Typ.Case_Sensitive)), Arg3 => C_Int (Boolean'Pos (Typ.Match_Must_Be_Unique)))); Wrap_Builtin (Fld, Typ, C_Choice_Router); end Set_Field_Type; end Terminal_Interface.Curses.Forms.Field_Types.Enumeration; AdaCurses-20170708/src/terminal_interface-curses-menus-menu_user_data.adb0000644000175100001440000000754512340207631025100 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Menus.Menu_User_Data -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2014 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, 1996 -- Version Control: -- $Revision: 1.15 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Menus.Menu_User_Data is use type Interfaces.C.int; procedure Set_User_Data (Men : Menu; Data : User_Access) is function Set_Menu_Userptr (Men : Menu; Data : User_Access) return Eti_Error; pragma Import (C, Set_Menu_Userptr, "set_menu_userptr"); begin Eti_Exception (Set_Menu_Userptr (Men, Data)); end Set_User_Data; function Get_User_Data (Men : Menu) return User_Access is function Menu_Userptr (Men : Menu) return User_Access; pragma Import (C, Menu_Userptr, "menu_userptr"); begin return Menu_Userptr (Men); end Get_User_Data; procedure Get_User_Data (Men : Menu; Data : out User_Access) is begin Data := Get_User_Data (Men); end Get_User_Data; end Terminal_Interface.Curses.Menus.Menu_User_Data; AdaCurses-20170708/src/terminal_interface-curses-text_io-enumeration_io.adb0000644000175100001440000000776511315445471025461 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Enumeration_IO -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Ada.Characters.Handling; use Ada.Characters.Handling; with Terminal_Interface.Curses.Text_IO.Aux; package body Terminal_Interface.Curses.Text_IO.Enumeration_IO is package Aux renames Terminal_Interface.Curses.Text_IO.Aux; package EIO is new Ada.Text_IO.Enumeration_IO (Enum); procedure Put (Win : Window; Item : Enum; Width : Field := Default_Width; Set : Type_Set := Default_Setting) is Buf : String (1 .. Field'Last); Tset : Ada.Text_IO.Type_Set; begin if Set /= Mixed_Case then Tset := Ada.Text_IO.Type_Set'Val (Type_Set'Pos (Set)); else Tset := Ada.Text_IO.Lower_Case; end if; EIO.Put (Buf, Item, Tset); if Set = Mixed_Case then Buf (Buf'First) := To_Upper (Buf (Buf'First)); end if; Aux.Put_Buf (Win, Buf, Width, True, True); end Put; procedure Put (Item : Enum; Width : Field := Default_Width; Set : Type_Set := Default_Setting) is begin Put (Get_Window, Item, Width, Set); end Put; end Terminal_Interface.Curses.Text_IO.Enumeration_IO; AdaCurses-20170708/src/terminal_interface-curses-text_io-modular_io.ads0000644000175100001440000000660211315445551024603 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Modular_IO -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type Num is mod <>; package Terminal_Interface.Curses.Text_IO.Modular_IO is Default_Width : Field := Num'Width; Default_Base : Number_Base := 10; procedure Put (Win : Window; Item : Num; Width : Field := Default_Width; Base : Number_Base := Default_Base); procedure Put (Item : Num; Width : Field := Default_Width; Base : Number_Base := Default_Base); private pragma Inline (Put); end Terminal_Interface.Curses.Text_IO.Modular_IO; AdaCurses-20170708/src/terminal_interface-curses-text_io-float_io.adb0000644000175100001440000000742211315445471024226 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Float_IO -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Terminal_Interface.Curses.Text_IO.Aux; package body Terminal_Interface.Curses.Text_IO.Float_IO is package Aux renames Terminal_Interface.Curses.Text_IO.Aux; package FIO is new Ada.Text_IO.Float_IO (Num); procedure Put (Win : Window; Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is Buf : String (1 .. Field'Last); Len : Field := Fore + 1 + Aft; begin if Exp > 0 then Len := Len + 1 + Exp; end if; FIO.Put (Buf, Item, Aft, Exp); Aux.Put_Buf (Win, Buf, Len, False); end Put; procedure Put (Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is begin Put (Get_Window, Item, Fore, Aft, Exp); end Put; end Terminal_Interface.Curses.Text_IO.Float_IO; AdaCurses-20170708/src/terminal_interface-curses-menus.adb0000644000175100001440000007464212340207631022111 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Menus -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.32 $ -- $Date: 2014/05/24 21:31:05 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with Interfaces.C.Pointers; package body Terminal_Interface.Curses.Menus is type C_Item_Array is array (Natural range <>) of aliased Item; package I_Array is new Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item); use type System.Bit_Order; subtype chars_ptr is Interfaces.C.Strings.chars_ptr; ------------------------------------------------------------------------------ procedure Request_Name (Key : Menu_Request_Code; Name : out String) is function Request_Name (Key : C_Int) return chars_ptr; pragma Import (C, Request_Name, "menu_request_name"); begin Fill_String (Request_Name (C_Int (Key)), Name); end Request_Name; function Request_Name (Key : Menu_Request_Code) return String is function Request_Name (Key : C_Int) return chars_ptr; pragma Import (C, Request_Name, "menu_request_name"); begin return Fill_String (Request_Name (C_Int (Key))); end Request_Name; function Create (Name : String; Description : String := "") return Item is type Char_Ptr is access all Interfaces.C.char; function Newitem (Name, Desc : Char_Ptr) return Item; pragma Import (C, Newitem, "new_item"); type Name_String is new char_array (0 .. Name'Length); type Name_String_Ptr is access Name_String; pragma Controlled (Name_String_Ptr); type Desc_String is new char_array (0 .. Description'Length); type Desc_String_Ptr is access Desc_String; pragma Controlled (Desc_String_Ptr); Name_Str : constant Name_String_Ptr := new Name_String; Desc_Str : constant Desc_String_Ptr := new Desc_String; Name_Len, Desc_Len : size_t; Result : Item; begin To_C (Name, Name_Str.all, Name_Len); To_C (Description, Desc_Str.all, Desc_Len); Result := Newitem (Name_Str.all (Name_Str.all'First)'Access, Desc_Str.all (Desc_Str.all'First)'Access); if Result = Null_Item then raise Eti_System_Error; end if; return Result; end Create; procedure Delete (Itm : in out Item) is function Descname (Itm : Item) return chars_ptr; pragma Import (C, Descname, "item_description"); function Itemname (Itm : Item) return chars_ptr; pragma Import (C, Itemname, "item_name"); function Freeitem (Itm : Item) return Eti_Error; pragma Import (C, Freeitem, "free_item"); Ptr : chars_ptr; begin Ptr := Descname (Itm); if Ptr /= Null_Ptr then Interfaces.C.Strings.Free (Ptr); end if; Ptr := Itemname (Itm); if Ptr /= Null_Ptr then Interfaces.C.Strings.Free (Ptr); end if; Eti_Exception (Freeitem (Itm)); Itm := Null_Item; end Delete; ------------------------------------------------------------------------------- procedure Set_Value (Itm : Item; Value : Boolean := True) is function Set_Item_Val (Itm : Item; Val : C_Int) return Eti_Error; pragma Import (C, Set_Item_Val, "set_item_value"); begin Eti_Exception (Set_Item_Val (Itm, Boolean'Pos (Value))); end Set_Value; function Value (Itm : Item) return Boolean is function Item_Val (Itm : Item) return C_Int; pragma Import (C, Item_Val, "item_value"); begin if Item_Val (Itm) = Curses_False then return False; else return True; end if; end Value; ------------------------------------------------------------------------------- function Visible (Itm : Item) return Boolean is function Item_Vis (Itm : Item) return C_Int; pragma Import (C, Item_Vis, "item_visible"); begin if Item_Vis (Itm) = Curses_False then return False; else return True; end if; end Visible; ------------------------------------------------------------------------------- procedure Set_Options (Itm : Item; Options : Item_Option_Set) is function Set_Item_Opts (Itm : Item; Opt : Item_Option_Set) return Eti_Error; pragma Import (C, Set_Item_Opts, "set_item_opts"); begin Eti_Exception (Set_Item_Opts (Itm, Options)); end Set_Options; procedure Switch_Options (Itm : Item; Options : Item_Option_Set; On : Boolean := True) is function Item_Opts_On (Itm : Item; Opt : Item_Option_Set) return Eti_Error; pragma Import (C, Item_Opts_On, "item_opts_on"); function Item_Opts_Off (Itm : Item; Opt : Item_Option_Set) return Eti_Error; pragma Import (C, Item_Opts_Off, "item_opts_off"); begin if On then Eti_Exception (Item_Opts_On (Itm, Options)); else Eti_Exception (Item_Opts_Off (Itm, Options)); end if; end Switch_Options; procedure Get_Options (Itm : Item; Options : out Item_Option_Set) is function Item_Opts (Itm : Item) return Item_Option_Set; pragma Import (C, Item_Opts, "item_opts"); begin Options := Item_Opts (Itm); end Get_Options; function Get_Options (Itm : Item := Null_Item) return Item_Option_Set is Ios : Item_Option_Set; begin Get_Options (Itm, Ios); return Ios; end Get_Options; ------------------------------------------------------------------------------- procedure Name (Itm : Item; Name : out String) is function Itemname (Itm : Item) return chars_ptr; pragma Import (C, Itemname, "item_name"); begin Fill_String (Itemname (Itm), Name); end Name; function Name (Itm : Item) return String is function Itemname (Itm : Item) return chars_ptr; pragma Import (C, Itemname, "item_name"); begin return Fill_String (Itemname (Itm)); end Name; procedure Description (Itm : Item; Description : out String) is function Descname (Itm : Item) return chars_ptr; pragma Import (C, Descname, "item_description"); begin Fill_String (Descname (Itm), Description); end Description; function Description (Itm : Item) return String is function Descname (Itm : Item) return chars_ptr; pragma Import (C, Descname, "item_description"); begin return Fill_String (Descname (Itm)); end Description; ------------------------------------------------------------------------------- procedure Set_Current (Men : Menu; Itm : Item) is function Set_Curr_Item (Men : Menu; Itm : Item) return Eti_Error; pragma Import (C, Set_Curr_Item, "set_current_item"); begin Eti_Exception (Set_Curr_Item (Men, Itm)); end Set_Current; function Current (Men : Menu) return Item is function Curr_Item (Men : Menu) return Item; pragma Import (C, Curr_Item, "current_item"); Res : constant Item := Curr_Item (Men); begin if Res = Null_Item then raise Menu_Exception; end if; return Res; end Current; procedure Set_Top_Row (Men : Menu; Line : Line_Position) is function Set_Toprow (Men : Menu; Line : C_Int) return Eti_Error; pragma Import (C, Set_Toprow, "set_top_row"); begin Eti_Exception (Set_Toprow (Men, C_Int (Line))); end Set_Top_Row; function Top_Row (Men : Menu) return Line_Position is function Toprow (Men : Menu) return C_Int; pragma Import (C, Toprow, "top_row"); Res : constant C_Int := Toprow (Men); begin if Res = Curses_Err then raise Menu_Exception; end if; return Line_Position (Res); end Top_Row; function Get_Index (Itm : Item) return Positive is function Get_Itemindex (Itm : Item) return C_Int; pragma Import (C, Get_Itemindex, "item_index"); Res : constant C_Int := Get_Itemindex (Itm); begin if Res = Curses_Err then raise Menu_Exception; end if; return Positive (Natural (Res) + Positive'First); end Get_Index; ------------------------------------------------------------------------------- procedure Post (Men : Menu; Post : Boolean := True) is function M_Post (Men : Menu) return Eti_Error; pragma Import (C, M_Post, "post_menu"); function M_Unpost (Men : Menu) return Eti_Error; pragma Import (C, M_Unpost, "unpost_menu"); begin if Post then Eti_Exception (M_Post (Men)); else Eti_Exception (M_Unpost (Men)); end if; end Post; ------------------------------------------------------------------------------- procedure Set_Options (Men : Menu; Options : Menu_Option_Set) is function Set_Menu_Opts (Men : Menu; Opt : Menu_Option_Set) return Eti_Error; pragma Import (C, Set_Menu_Opts, "set_menu_opts"); begin Eti_Exception (Set_Menu_Opts (Men, Options)); end Set_Options; procedure Switch_Options (Men : Menu; Options : Menu_Option_Set; On : Boolean := True) is function Menu_Opts_On (Men : Menu; Opt : Menu_Option_Set) return Eti_Error; pragma Import (C, Menu_Opts_On, "menu_opts_on"); function Menu_Opts_Off (Men : Menu; Opt : Menu_Option_Set) return Eti_Error; pragma Import (C, Menu_Opts_Off, "menu_opts_off"); begin if On then Eti_Exception (Menu_Opts_On (Men, Options)); else Eti_Exception (Menu_Opts_Off (Men, Options)); end if; end Switch_Options; procedure Get_Options (Men : Menu; Options : out Menu_Option_Set) is function Menu_Opts (Men : Menu) return Menu_Option_Set; pragma Import (C, Menu_Opts, "menu_opts"); begin Options := Menu_Opts (Men); end Get_Options; function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set is Mos : Menu_Option_Set; begin Get_Options (Men, Mos); return Mos; end Get_Options; ------------------------------------------------------------------------------- procedure Set_Window (Men : Menu; Win : Window) is function Set_Menu_Win (Men : Menu; Win : Window) return Eti_Error; pragma Import (C, Set_Menu_Win, "set_menu_win"); begin Eti_Exception (Set_Menu_Win (Men, Win)); end Set_Window; function Get_Window (Men : Menu) return Window is function Menu_Win (Men : Menu) return Window; pragma Import (C, Menu_Win, "menu_win"); W : constant Window := Menu_Win (Men); begin return W; end Get_Window; procedure Set_Sub_Window (Men : Menu; Win : Window) is function Set_Menu_Sub (Men : Menu; Win : Window) return Eti_Error; pragma Import (C, Set_Menu_Sub, "set_menu_sub"); begin Eti_Exception (Set_Menu_Sub (Men, Win)); end Set_Sub_Window; function Get_Sub_Window (Men : Menu) return Window is function Menu_Sub (Men : Menu) return Window; pragma Import (C, Menu_Sub, "menu_sub"); W : constant Window := Menu_Sub (Men); begin return W; end Get_Sub_Window; procedure Scale (Men : Menu; Lines : out Line_Count; Columns : out Column_Count) is type C_Int_Access is access all C_Int; function M_Scale (Men : Menu; Yp, Xp : C_Int_Access) return Eti_Error; pragma Import (C, M_Scale, "scale_menu"); X, Y : aliased C_Int; begin Eti_Exception (M_Scale (Men, Y'Access, X'Access)); Lines := Line_Count (Y); Columns := Column_Count (X); end Scale; ------------------------------------------------------------------------------- procedure Position_Cursor (Men : Menu) is function Pos_Menu_Cursor (Men : Menu) return Eti_Error; pragma Import (C, Pos_Menu_Cursor, "pos_menu_cursor"); begin Eti_Exception (Pos_Menu_Cursor (Men)); end Position_Cursor; ------------------------------------------------------------------------------- procedure Set_Mark (Men : Menu; Mark : String) is type Char_Ptr is access all Interfaces.C.char; function Set_Mark (Men : Menu; Mark : Char_Ptr) return Eti_Error; pragma Import (C, Set_Mark, "set_menu_mark"); Txt : char_array (0 .. Mark'Length); Len : size_t; begin To_C (Mark, Txt, Len); Eti_Exception (Set_Mark (Men, Txt (Txt'First)'Access)); end Set_Mark; procedure Mark (Men : Menu; Mark : out String) is function Get_Menu_Mark (Men : Menu) return chars_ptr; pragma Import (C, Get_Menu_Mark, "menu_mark"); begin Fill_String (Get_Menu_Mark (Men), Mark); end Mark; function Mark (Men : Menu) return String is function Get_Menu_Mark (Men : Menu) return chars_ptr; pragma Import (C, Get_Menu_Mark, "menu_mark"); begin return Fill_String (Get_Menu_Mark (Men)); end Mark; ------------------------------------------------------------------------------- procedure Set_Foreground (Men : Menu; Fore : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First) is function Set_Menu_Fore (Men : Menu; Attr : Attributed_Character) return Eti_Error; pragma Import (C, Set_Menu_Fore, "set_menu_fore"); Ch : constant Attributed_Character := (Ch => Character'First, Color => Color, Attr => Fore); begin Eti_Exception (Set_Menu_Fore (Men, Ch)); end Set_Foreground; procedure Foreground (Men : Menu; Fore : out Character_Attribute_Set) is function Menu_Fore (Men : Menu) return Attributed_Character; pragma Import (C, Menu_Fore, "menu_fore"); begin Fore := Menu_Fore (Men).Attr; end Foreground; procedure Foreground (Men : Menu; Fore : out Character_Attribute_Set; Color : out Color_Pair) is function Menu_Fore (Men : Menu) return Attributed_Character; pragma Import (C, Menu_Fore, "menu_fore"); begin Fore := Menu_Fore (Men).Attr; Color := Menu_Fore (Men).Color; end Foreground; procedure Set_Background (Men : Menu; Back : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First) is function Set_Menu_Back (Men : Menu; Attr : Attributed_Character) return Eti_Error; pragma Import (C, Set_Menu_Back, "set_menu_back"); Ch : constant Attributed_Character := (Ch => Character'First, Color => Color, Attr => Back); begin Eti_Exception (Set_Menu_Back (Men, Ch)); end Set_Background; procedure Background (Men : Menu; Back : out Character_Attribute_Set) is function Menu_Back (Men : Menu) return Attributed_Character; pragma Import (C, Menu_Back, "menu_back"); begin Back := Menu_Back (Men).Attr; end Background; procedure Background (Men : Menu; Back : out Character_Attribute_Set; Color : out Color_Pair) is function Menu_Back (Men : Menu) return Attributed_Character; pragma Import (C, Menu_Back, "menu_back"); begin Back := Menu_Back (Men).Attr; Color := Menu_Back (Men).Color; end Background; procedure Set_Grey (Men : Menu; Grey : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First) is function Set_Menu_Grey (Men : Menu; Attr : Attributed_Character) return Eti_Error; pragma Import (C, Set_Menu_Grey, "set_menu_grey"); Ch : constant Attributed_Character := (Ch => Character'First, Color => Color, Attr => Grey); begin Eti_Exception (Set_Menu_Grey (Men, Ch)); end Set_Grey; procedure Grey (Men : Menu; Grey : out Character_Attribute_Set) is function Menu_Grey (Men : Menu) return Attributed_Character; pragma Import (C, Menu_Grey, "menu_grey"); begin Grey := Menu_Grey (Men).Attr; end Grey; procedure Grey (Men : Menu; Grey : out Character_Attribute_Set; Color : out Color_Pair) is function Menu_Grey (Men : Menu) return Attributed_Character; pragma Import (C, Menu_Grey, "menu_grey"); begin Grey := Menu_Grey (Men).Attr; Color := Menu_Grey (Men).Color; end Grey; procedure Set_Pad_Character (Men : Menu; Pad : Character := Space) is function Set_Menu_Pad (Men : Menu; Ch : C_Int) return Eti_Error; pragma Import (C, Set_Menu_Pad, "set_menu_pad"); begin Eti_Exception (Set_Menu_Pad (Men, C_Int (Character'Pos (Pad)))); end Set_Pad_Character; procedure Pad_Character (Men : Menu; Pad : out Character) is function Menu_Pad (Men : Menu) return C_Int; pragma Import (C, Menu_Pad, "menu_pad"); begin Pad := Character'Val (Menu_Pad (Men)); end Pad_Character; ------------------------------------------------------------------------------- procedure Set_Spacing (Men : Menu; Descr : Column_Position := 0; Row : Line_Position := 0; Col : Column_Position := 0) is function Set_Spacing (Men : Menu; D, R, C : C_Int) return Eti_Error; pragma Import (C, Set_Spacing, "set_menu_spacing"); begin Eti_Exception (Set_Spacing (Men, C_Int (Descr), C_Int (Row), C_Int (Col))); end Set_Spacing; procedure Spacing (Men : Menu; Descr : out Column_Position; Row : out Line_Position; Col : out Column_Position) is type C_Int_Access is access all C_Int; function Get_Spacing (Men : Menu; D, R, C : C_Int_Access) return Eti_Error; pragma Import (C, Get_Spacing, "menu_spacing"); D, R, C : aliased C_Int; begin Eti_Exception (Get_Spacing (Men, D'Access, R'Access, C'Access)); Descr := Column_Position (D); Row := Line_Position (R); Col := Column_Position (C); end Spacing; ------------------------------------------------------------------------------- function Set_Pattern (Men : Menu; Text : String) return Boolean is type Char_Ptr is access all Interfaces.C.char; function Set_Pattern (Men : Menu; Pattern : Char_Ptr) return Eti_Error; pragma Import (C, Set_Pattern, "set_menu_pattern"); S : char_array (0 .. Text'Length); L : size_t; Res : Eti_Error; begin To_C (Text, S, L); Res := Set_Pattern (Men, S (S'First)'Access); case Res is when E_No_Match => return False; when others => Eti_Exception (Res); return True; end case; end Set_Pattern; procedure Pattern (Men : Menu; Text : out String) is function Get_Pattern (Men : Menu) return chars_ptr; pragma Import (C, Get_Pattern, "menu_pattern"); begin Fill_String (Get_Pattern (Men), Text); end Pattern; ------------------------------------------------------------------------------- procedure Set_Format (Men : Menu; Lines : Line_Count; Columns : Column_Count) is function Set_Menu_Fmt (Men : Menu; Lin : C_Int; Col : C_Int) return Eti_Error; pragma Import (C, Set_Menu_Fmt, "set_menu_format"); begin Eti_Exception (Set_Menu_Fmt (Men, C_Int (Lines), C_Int (Columns))); end Set_Format; procedure Format (Men : Menu; Lines : out Line_Count; Columns : out Column_Count) is type C_Int_Access is access all C_Int; function Menu_Fmt (Men : Menu; Y, X : C_Int_Access) return Eti_Error; pragma Import (C, Menu_Fmt, "menu_format"); L, C : aliased C_Int; begin Eti_Exception (Menu_Fmt (Men, L'Access, C'Access)); Lines := Line_Count (L); Columns := Column_Count (C); end Format; ------------------------------------------------------------------------------- procedure Set_Item_Init_Hook (Men : Menu; Proc : Menu_Hook_Function) is function Set_Item_Init (Men : Menu; Proc : Menu_Hook_Function) return Eti_Error; pragma Import (C, Set_Item_Init, "set_item_init"); begin Eti_Exception (Set_Item_Init (Men, Proc)); end Set_Item_Init_Hook; procedure Set_Item_Term_Hook (Men : Menu; Proc : Menu_Hook_Function) is function Set_Item_Term (Men : Menu; Proc : Menu_Hook_Function) return Eti_Error; pragma Import (C, Set_Item_Term, "set_item_term"); begin Eti_Exception (Set_Item_Term (Men, Proc)); end Set_Item_Term_Hook; procedure Set_Menu_Init_Hook (Men : Menu; Proc : Menu_Hook_Function) is function Set_Menu_Init (Men : Menu; Proc : Menu_Hook_Function) return Eti_Error; pragma Import (C, Set_Menu_Init, "set_menu_init"); begin Eti_Exception (Set_Menu_Init (Men, Proc)); end Set_Menu_Init_Hook; procedure Set_Menu_Term_Hook (Men : Menu; Proc : Menu_Hook_Function) is function Set_Menu_Term (Men : Menu; Proc : Menu_Hook_Function) return Eti_Error; pragma Import (C, Set_Menu_Term, "set_menu_term"); begin Eti_Exception (Set_Menu_Term (Men, Proc)); end Set_Menu_Term_Hook; function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function is function Item_Init (Men : Menu) return Menu_Hook_Function; pragma Import (C, Item_Init, "item_init"); begin return Item_Init (Men); end Get_Item_Init_Hook; function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function is function Item_Term (Men : Menu) return Menu_Hook_Function; pragma Import (C, Item_Term, "item_term"); begin return Item_Term (Men); end Get_Item_Term_Hook; function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function is function Menu_Init (Men : Menu) return Menu_Hook_Function; pragma Import (C, Menu_Init, "menu_init"); begin return Menu_Init (Men); end Get_Menu_Init_Hook; function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function is function Menu_Term (Men : Menu) return Menu_Hook_Function; pragma Import (C, Menu_Term, "menu_term"); begin return Menu_Term (Men); end Get_Menu_Term_Hook; ------------------------------------------------------------------------------- procedure Redefine (Men : Menu; Items : Item_Array_Access) is function Set_Items (Men : Menu; Items : System.Address) return Eti_Error; pragma Import (C, Set_Items, "set_menu_items"); begin pragma Assert (Items.all (Items'Last) = Null_Item); if Items.all (Items'Last) /= Null_Item then raise Menu_Exception; else Eti_Exception (Set_Items (Men, Items.all'Address)); end if; end Redefine; function Item_Count (Men : Menu) return Natural is function Count (Men : Menu) return C_Int; pragma Import (C, Count, "item_count"); begin return Natural (Count (Men)); end Item_Count; function Items (Men : Menu; Index : Positive) return Item is use I_Array; function C_Mitems (Men : Menu) return Pointer; pragma Import (C, C_Mitems, "menu_items"); P : Pointer := C_Mitems (Men); begin if P = null or else Index > Item_Count (Men) then raise Menu_Exception; else P := P + ptrdiff_t (C_Int (Index) - 1); return P.all; end if; end Items; ------------------------------------------------------------------------------- function Create (Items : Item_Array_Access) return Menu is function Newmenu (Items : System.Address) return Menu; pragma Import (C, Newmenu, "new_menu"); M : Menu; begin pragma Assert (Items.all (Items'Last) = Null_Item); if Items.all (Items'Last) /= Null_Item then raise Menu_Exception; else M := Newmenu (Items.all'Address); if M = Null_Menu then raise Menu_Exception; end if; return M; end if; end Create; procedure Delete (Men : in out Menu) is function Free (Men : Menu) return Eti_Error; pragma Import (C, Free, "free_menu"); begin Eti_Exception (Free (Men)); Men := Null_Menu; end Delete; ------------------------------------------------------------------------------ function Driver (Men : Menu; Key : Key_Code) return Driver_Result is function Driver (Men : Menu; Key : C_Int) return Eti_Error; pragma Import (C, Driver, "menu_driver"); R : constant Eti_Error := Driver (Men, C_Int (Key)); begin case R is when E_Unknown_Command => return Unknown_Request; when E_No_Match => return No_Match; when E_Request_Denied | E_Not_Selectable => return Request_Denied; when others => Eti_Exception (R); return Menu_Ok; end case; end Driver; procedure Free (IA : in out Item_Array_Access; Free_Items : Boolean := False) is procedure Release is new Ada.Unchecked_Deallocation (Item_Array, Item_Array_Access); begin if IA /= null and then Free_Items then for I in IA'First .. (IA'Last - 1) loop if IA.all (I) /= Null_Item then Delete (IA.all (I)); end if; end loop; end if; Release (IA); end Free; ------------------------------------------------------------------------------- function Default_Menu_Options return Menu_Option_Set is begin return Get_Options (Null_Menu); end Default_Menu_Options; function Default_Item_Options return Item_Option_Set is begin return Get_Options (Null_Item); end Default_Item_Options; ------------------------------------------------------------------------------- end Terminal_Interface.Curses.Menus; AdaCurses-20170708/src/terminal_interface-curses-text_io-decimal_io.ads0000644000175100001440000000672711315445471024547 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Decimal_IO -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type Num is delta <> digits <>; package Terminal_Interface.Curses.Text_IO.Decimal_IO is Default_Fore : Field := Num'Fore; Default_Aft : Field := Num'Aft; Default_Exp : Field := 0; procedure Put (Win : Window; Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); procedure Put (Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); private pragma Inline (Put); end Terminal_Interface.Curses.Text_IO.Decimal_IO; AdaCurses-20170708/src/terminal_interface-curses-termcap.adb0000644000175100001440000001553011315445062022407 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Termcap -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2006,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; package body Terminal_Interface.Curses.Termcap is function Get_Entry (Name : String) return Boolean is function tgetent (name : char_array; val : char_array) return C_Int; pragma Import (C, tgetent, "tgetent"); NameTxt : char_array (0 .. Name'Length); Length : size_t; ignored : constant char_array (0 .. 0) := (0 => nul); result : C_Int; begin To_C (Name, NameTxt, Length); result := tgetent (char_array (ignored), NameTxt); if result = -1 then raise Curses_Exception; else return Boolean'Val (result); end if; end Get_Entry; ------------------------------------------------------------------------------ function Get_Flag (Name : String) return Boolean is function tgetflag (id : char_array) return C_Int; pragma Import (C, tgetflag, "tgetflag"); Txt : char_array (0 .. Name'Length); Length : size_t; begin To_C (Name, Txt, Length); if tgetflag (Txt) = 0 then return False; else return True; end if; end Get_Flag; ------------------------------------------------------------------------------ procedure Get_Number (Name : String; Value : out Integer; Result : out Boolean) is function tgetnum (id : char_array) return C_Int; pragma Import (C, tgetnum, "tgetnum"); Txt : char_array (0 .. Name'Length); Length : size_t; begin To_C (Name, Txt, Length); Value := Integer (tgetnum (Txt)); if Value = -1 then Result := False; else Result := True; end if; end Get_Number; ------------------------------------------------------------------------------ procedure Get_String (Name : String; Value : out String; Result : out Boolean) is function tgetstr (id : char_array; buf : char_array) return chars_ptr; pragma Import (C, tgetstr, "tgetstr"); Txt : char_array (0 .. Name'Length); Length : size_t; Txt2 : chars_ptr; type t is new char_array (0 .. 1024); -- does it need to be 1024? Return_Buffer : constant t := (others => nul); begin To_C (Name, Txt, Length); Txt2 := tgetstr (Txt, char_array (Return_Buffer)); if Txt2 = Null_Ptr then Result := False; else Value := Fill_String (Txt2); Result := True; end if; end Get_String; function Get_String (Name : String) return Boolean is function tgetstr (Id : char_array; buf : char_array) return chars_ptr; pragma Import (C, tgetstr, "tgetstr"); Txt : char_array (0 .. Name'Length); Length : size_t; Txt2 : chars_ptr; type t is new char_array (0 .. 1024); -- does it need to be 1024? Phony_Txt : constant t := (others => nul); begin To_C (Name, Txt, Length); Txt2 := tgetstr (Txt, char_array (Phony_Txt)); if Txt2 = Null_Ptr then return False; else return True; end if; end Get_String; ------------------------------------------------------------------------------ function TGoto (Cap : String; Col : Column_Position; Row : Line_Position) return Termcap_String is function tgoto (cap : char_array; col : C_Int; row : C_Int) return chars_ptr; pragma Import (C, tgoto); Txt : char_array (0 .. Cap'Length); Length : size_t; begin To_C (Cap, Txt, Length); return Termcap_String (Fill_String (tgoto (Txt, C_Int (Col), C_Int (Row)))); end TGoto; end Terminal_Interface.Curses.Termcap; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-alphanumeric.ads0000644000175100001440000000654111315445666027112 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric); type AlphaNumeric_Field is new Field_Type with record Minimum_Field_Width : Natural := 0; end record; procedure Set_Field_Type (Fld : Field; Typ : AlphaNumeric_Field); pragma Inline (Set_Field_Type); end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric; AdaCurses-20170708/src/terminal_interface-curses-aux.adb0000644000175100001440000001213011315445604021544 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Aux -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package body Terminal_Interface.Curses.Aux is -- -- Some helpers procedure Fill_String (Cp : chars_ptr; Str : out String) is -- Fill the string with the characters referenced by the -- chars_ptr. -- Len : Natural; begin if Cp /= Null_Ptr then Len := Natural (Strlen (Cp)); if Str'Length < Len then raise Constraint_Error; end if; declare S : String (1 .. Len); begin S := Value (Cp); Str (Str'First .. (Str'First + Len - 1)) := S (S'Range); end; else Len := 0; end if; if Len < Str'Length then Str ((Str'First + Len) .. Str'Last) := (others => ' '); end if; end Fill_String; function Fill_String (Cp : chars_ptr) return String is Len : Natural; begin if Cp /= Null_Ptr then Len := Natural (Strlen (Cp)); if Len = 0 then return ""; else declare S : String (1 .. Len); begin Fill_String (Cp, S); return S; end; end if; else return ""; end if; end Fill_String; procedure Eti_Exception (Code : Eti_Error) is begin case Code is when E_Ok => null; when E_System_Error => raise Eti_System_Error; when E_Bad_Argument => raise Eti_Bad_Argument; when E_Posted => raise Eti_Posted; when E_Connected => raise Eti_Connected; when E_Bad_State => raise Eti_Bad_State; when E_No_Room => raise Eti_No_Room; when E_Not_Posted => raise Eti_Not_Posted; when E_Unknown_Command => raise Eti_Unknown_Command; when E_No_Match => raise Eti_No_Match; when E_Not_Selectable => raise Eti_Not_Selectable; when E_Not_Connected => raise Eti_Not_Connected; when E_Request_Denied => raise Eti_Request_Denied; when E_Invalid_Field => raise Eti_Invalid_Field; when E_Current => raise Eti_Current; end case; end Eti_Exception; end Terminal_Interface.Curses.Aux; AdaCurses-20170708/src/terminal_interface-curses-text_io-complex_io.adb0000644000175100001440000000730311315446021024556 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Complex_IO -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Text_IO.Float_IO; package body Terminal_Interface.Curses.Text_IO.Complex_IO is package FIO is new Terminal_Interface.Curses.Text_IO.Float_IO (Complex_Types.Real'Base); procedure Put (Win : Window; Item : Complex; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is begin Put (Win, '('); FIO.Put (Win, Item.Re, Fore, Aft, Exp); Put (Win, ','); FIO.Put (Win, Item.Im, Fore, Aft, Exp); Put (Win, ')'); end Put; procedure Put (Item : Complex; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is begin Put (Get_Window, Item, Fore, Aft, Exp); end Put; end Terminal_Interface.Curses.Text_IO.Complex_IO; AdaCurses-20170708/src/terminal_interface-curses-text_io-integer_io.adb0000644000175100001440000000716511315445471024562 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Integer_IO -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Terminal_Interface.Curses.Text_IO.Aux; package body Terminal_Interface.Curses.Text_IO.Integer_IO is package Aux renames Terminal_Interface.Curses.Text_IO.Aux; package IIO is new Ada.Text_IO.Integer_IO (Num); procedure Put (Win : Window; Item : Num; Width : Field := Default_Width; Base : Number_Base := Default_Base) is Buf : String (1 .. Field'Last); begin IIO.Put (Buf, Item, Base); Aux.Put_Buf (Win, Buf, Width); end Put; procedure Put (Item : Num; Width : Field := Default_Width; Base : Number_Base := Default_Base) is begin Put (Get_Window, Item, Width, Base); end Put; end Terminal_Interface.Curses.Text_IO.Integer_IO; AdaCurses-20170708/src/terminal_interface-curses-text_io-float_io.ads0000644000175100001440000000671211315445471024250 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Float_IO -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type Num is digits <>; package Terminal_Interface.Curses.Text_IO.Float_IO is Default_Fore : Field := 2; Default_Aft : Field := Num'Digits - 1; Default_Exp : Field := 3; procedure Put (Win : Window; Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); procedure Put (Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); private pragma Inline (Put); end Terminal_Interface.Curses.Text_IO.Float_IO; AdaCurses-20170708/src/terminal_interface-curses-termcap.ads0000644000175100001440000001006607746514446022447 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Termcap -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000,2003 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, 1996 -- Version Control: -- $Revision: 1.4 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Termcap is pragma Preelaborate (Terminal_Interface.Curses.Termcap); -- |===================================================================== -- | Man page curs_termcap.3x -- |===================================================================== -- Not implemented: tputs (see curs_terminfo) type Termcap_String is new String; -- | function TGoto (Cap : String; Col : Column_Position; Row : Line_Position) return Termcap_String; -- AKA: tgoto() -- | function Get_Entry (Name : String) return Boolean; -- AKA: tgetent() -- | function Get_Flag (Name : String) return Boolean; -- AKA: tgetflag() -- | procedure Get_Number (Name : String; Value : out Integer; Result : out Boolean); -- AKA: tgetnum() -- | procedure Get_String (Name : String; Value : out String; Result : out Boolean); function Get_String (Name : String) return Boolean; -- Returns True if the string is found. -- AKA: tgetstr() end Terminal_Interface.Curses.Termcap; AdaCurses-20170708/src/terminal_interface-curses-menus-item_user_data.adb0000644000175100001440000000756712340207631025076 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Menus.Item_User_Data -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2014 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, 1996 -- Version Control: -- $Revision: 1.14 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Menus.Item_User_Data is use type Interfaces.C.int; procedure Set_User_Data (Itm : Item; Data : User_Access) is function Set_Item_Userptr (Itm : Item; Addr : User_Access) return Eti_Error; pragma Import (C, Set_Item_Userptr, "set_item_userptr"); begin Eti_Exception (Set_Item_Userptr (Itm, Data)); end Set_User_Data; function Get_User_Data (Itm : Item) return User_Access is function Item_Userptr (Itm : Item) return User_Access; pragma Import (C, Item_Userptr, "item_userptr"); begin return Item_Userptr (Itm); end Get_User_Data; procedure Get_User_Data (Itm : Item; Data : out User_Access) is begin Data := Get_User_Data (Itm); end Get_User_Data; end Terminal_Interface.Curses.Menus.Item_User_Data; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-intfield.adb0000644000175100001440000000736612340207631026210 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.IntField -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.13 $ -- $Date: 2014/05/24 21:31:05 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.IntField is procedure Set_Field_Type (Fld : Field; Typ : Integer_Field) is function Set_Fld_Type (F : Field := Fld; Arg1 : C_Int; Arg2 : C_Long_Int; Arg3 : C_Long_Int) return Eti_Error; pragma Import (C, Set_Fld_Type, "set_field_type_integer"); begin Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Precision), Arg2 => C_Long_Int (Typ.Lower_Limit), Arg3 => C_Long_Int (Typ.Upper_Limit))); Wrap_Builtin (Fld, Typ); end Set_Field_Type; end Terminal_Interface.Curses.Forms.Field_Types.IntField; AdaCurses-20170708/src/terminal_interface-curses-trace.adb_p0000644000175100001440000000744212340207715022374 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Trace -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2009,2014 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, 1996 -- Version Control: -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ #if ADA_TRACE then with Interfaces.C; use Interfaces.C; #end if; package body Terminal_Interface.Curses.Trace is #if ADA_TRACE then procedure Trace_On (x : Trace_Attribute_Set) is procedure traceC (y : Trace_Attribute_Set); pragma Import (C, traceC, "trace"); begin traceC (x); end Trace_On; procedure Trace_Put (str : String) is procedure tracef (format : char_array; s : char_array); pragma Import (C, tracef, "_traces"); -- _traces() is defined in c_varargs_to_ada.h begin tracef (To_C ("%s"), To_C (str)); end Trace_Put; #else procedure Trace_On (x : Trace_Attribute_Set) is pragma Warnings (Off, x); -- unreferenced begin null; end Trace_On; procedure Trace_Put (str : String) is pragma Warnings (Off, str); -- unreferenced begin null; end Trace_Put; #end if; end Terminal_Interface.Curses.Trace; AdaCurses-20170708/src/terminal_interface.ads0000644000175100001440000000605310447516776017515 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2006 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, 1996 -- Version Control: -- $Revision: 1.14 $ -- $Date: 2006/06/25 14:30:22 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface is pragma Pure (Terminal_Interface); -- -- Everything is in the child units -- end Terminal_Interface; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-user.adb0000644000175100001440000001373512340207631025365 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.User -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.23 $ -- $Date: 2014/05/24 21:31:05 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System.Address_To_Access_Conversions; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.User is procedure Set_Field_Type (Fld : Field; Typ : User_Defined_Field_Type) is function Allocate_Arg (T : User_Defined_Field_Type'Class) return Argument_Access; function Set_Fld_Type (F : Field := Fld; Cft : C_Field_Type := C_Generic_Type; Arg1 : Argument_Access) return Eti_Error; pragma Import (C, Set_Fld_Type, "set_field_type_user"); function Allocate_Arg (T : User_Defined_Field_Type'Class) return Argument_Access is Ptr : constant Field_Type_Access := new User_Defined_Field_Type'Class'(T); begin return new Argument'(Usr => System.Null_Address, Typ => Ptr, Cft => Null_Field_Type); end Allocate_Arg; begin Eti_Exception (Set_Fld_Type (Arg1 => Allocate_Arg (Typ))); end Set_Field_Type; package Argument_Conversions is new System.Address_To_Access_Conversions (Argument); function Generic_Field_Check (Fld : Field; Usr : System.Address) return Curses_Bool is Result : Boolean; Udf : constant User_Defined_Field_Type_Access := User_Defined_Field_Type_Access (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ); begin Result := Field_Check (Fld, Udf.all); return Curses_Bool (Boolean'Pos (Result)); end Generic_Field_Check; function Generic_Char_Check (Ch : C_Int; Usr : System.Address) return Curses_Bool is Result : Boolean; Udf : constant User_Defined_Field_Type_Access := User_Defined_Field_Type_Access (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ); begin Result := Character_Check (Character'Val (Ch), Udf.all); return Curses_Bool (Boolean'Pos (Result)); end Generic_Char_Check; -- ----------------------------------------------------------------------- -- function C_Generic_Type return C_Field_Type is Res : Eti_Error; T : C_Field_Type; begin if M_Generic_Type = Null_Field_Type then T := New_Fieldtype (Generic_Field_Check'Access, Generic_Char_Check'Access); if T = Null_Field_Type then raise Form_Exception; else Res := Set_Fieldtype_Arg (T, Make_Arg'Access, Copy_Arg'Access, Free_Arg'Access); Eti_Exception (Res); end if; M_Generic_Type := T; end if; pragma Assert (M_Generic_Type /= Null_Field_Type); return M_Generic_Type; end C_Generic_Type; end Terminal_Interface.Curses.Forms.Field_Types.User; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-regexp.ads0000644000175100001440000000660211315446021025714 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.RegExp -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.RegExp is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.RegExp); type String_Access is access String; type Regular_Expression_Field is new Field_Type with record Regular_Expression : String_Access; end record; procedure Set_Field_Type (Fld : Field; Typ : Regular_Expression_Field); pragma Inline (Set_Field_Type); end Terminal_Interface.Curses.Forms.Field_Types.RegExp; AdaCurses-20170708/src/terminal_interface-curses-text_io-complex_io.ads0000644000175100001440000000711411315445471024607 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Complex_IO -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Numerics.Generic_Complex_Types; generic with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (<>); package Terminal_Interface.Curses.Text_IO.Complex_IO is use Complex_Types; Default_Fore : Field := 2; Default_Aft : Field := Real'Digits - 1; Default_Exp : Field := 3; procedure Put (Win : Window; Item : Complex; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); procedure Put (Item : Complex; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); private pragma Inline (Put); end Terminal_Interface.Curses.Text_IO.Complex_IO; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-user-choice.ads0000644000175100001440000001176011541120503026624 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.User.Choice -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2008,2011 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, 1996 -- Version Control: -- $Revision: 1.14 $ -- $Date: 2011/03/19 12:27:47 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; package Terminal_Interface.Curses.Forms.Field_Types.User.Choice is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.User.Choice); subtype C_Int is Interfaces.C.int; type User_Defined_Field_Type_With_Choice is abstract new User_Defined_Field_Type with null record; -- This is the root of the mechanism we use to create field types in -- Ada95 that allow the prev/next mechanism. You should your own type -- derive from this one and implement the Field_Check, Character_Check -- Next and Previous functions for your own type. type User_Defined_Field_Type_With_Choice_Access is access all User_Defined_Field_Type_With_Choice'Class; function Next (Fld : Field; Typ : User_Defined_Field_Type_With_Choice) return Boolean is abstract; -- If True is returned, the function successfully generated a next -- value into the fields buffer. function Previous (Fld : Field; Typ : User_Defined_Field_Type_With_Choice) return Boolean is abstract; -- If True is returned, the function successfully generated a previous -- value into the fields buffer. -- +---------------------------------------------------------------------- -- | Private Part. -- | private function C_Generic_Choice return C_Field_Type; function Generic_Next (Fld : Field; Usr : System.Address) return Curses_Bool; pragma Convention (C, Generic_Next); -- This is the generic next Choice_Function for the low-level fieldtype -- representing all the User_Defined_Field_Type derivatives. It routes -- the call to the Next implementation for the type. function Generic_Prev (Fld : Field; Usr : System.Address) return Curses_Bool; pragma Convention (C, Generic_Prev); -- This is the generic prev Choice_Function for the low-level fieldtype -- representing all the User_Defined_Field_Type derivatives. It routes -- the call to the Previous implementation for the type. end Terminal_Interface.Curses.Forms.Field_Types.User.Choice; AdaCurses-20170708/src/terminal_interface-curses-forms.adb0000644000175100001440000010053312340207631022075 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.32 $ -- $Date: 2014/05/24 21:31:05 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with Interfaces.C.Pointers; with Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms is use Terminal_Interface.Curses.Aux; type C_Field_Array is array (Natural range <>) of aliased Field; package F_Array is new Interfaces.C.Pointers (Natural, Field, C_Field_Array, Null_Field); ------------------------------------------------------------------------------ -- | -- | -- | -- subtype chars_ptr is Interfaces.C.Strings.chars_ptr; procedure Request_Name (Key : Form_Request_Code; Name : out String) is function Form_Request_Name (Key : C_Int) return chars_ptr; pragma Import (C, Form_Request_Name, "form_request_name"); begin Fill_String (Form_Request_Name (C_Int (Key)), Name); end Request_Name; function Request_Name (Key : Form_Request_Code) return String is function Form_Request_Name (Key : C_Int) return chars_ptr; pragma Import (C, Form_Request_Name, "form_request_name"); begin return Fill_String (Form_Request_Name (C_Int (Key))); end Request_Name; ------------------------------------------------------------------------------ -- | -- | -- | -- | -- |===================================================================== -- | man page form_field_new.3x -- |===================================================================== -- | -- | -- | function Create (Height : Line_Count; Width : Column_Count; Top : Line_Position; Left : Column_Position; Off_Screen : Natural := 0; More_Buffers : Buffer_Number := Buffer_Number'First) return Field is function Newfield (H, W, T, L, O, M : C_Int) return Field; pragma Import (C, Newfield, "new_field"); Fld : constant Field := Newfield (C_Int (Height), C_Int (Width), C_Int (Top), C_Int (Left), C_Int (Off_Screen), C_Int (More_Buffers)); begin if Fld = Null_Field then raise Form_Exception; end if; return Fld; end Create; -- | -- | -- | procedure Delete (Fld : in out Field) is function Free_Field (Fld : Field) return Eti_Error; pragma Import (C, Free_Field, "free_field"); begin Eti_Exception (Free_Field (Fld)); Fld := Null_Field; end Delete; -- | -- | -- | function Duplicate (Fld : Field; Top : Line_Position; Left : Column_Position) return Field is function Dup_Field (Fld : Field; Top : C_Int; Left : C_Int) return Field; pragma Import (C, Dup_Field, "dup_field"); F : constant Field := Dup_Field (Fld, C_Int (Top), C_Int (Left)); begin if F = Null_Field then raise Form_Exception; end if; return F; end Duplicate; -- | -- | -- | function Link (Fld : Field; Top : Line_Position; Left : Column_Position) return Field is function Lnk_Field (Fld : Field; Top : C_Int; Left : C_Int) return Field; pragma Import (C, Lnk_Field, "link_field"); F : constant Field := Lnk_Field (Fld, C_Int (Top), C_Int (Left)); begin if F = Null_Field then raise Form_Exception; end if; return F; end Link; -- | -- |===================================================================== -- | man page form_field_just.3x -- |===================================================================== -- | -- | -- | procedure Set_Justification (Fld : Field; Just : Field_Justification := None) is function Set_Field_Just (Fld : Field; Just : C_Int) return Eti_Error; pragma Import (C, Set_Field_Just, "set_field_just"); begin Eti_Exception (Set_Field_Just (Fld, C_Int (Field_Justification'Pos (Just)))); end Set_Justification; -- | -- | -- | function Get_Justification (Fld : Field) return Field_Justification is function Field_Just (Fld : Field) return C_Int; pragma Import (C, Field_Just, "field_just"); begin return Field_Justification'Val (Field_Just (Fld)); end Get_Justification; -- | -- |===================================================================== -- | man page form_field_buffer.3x -- |===================================================================== -- | -- | -- | procedure Set_Buffer (Fld : Field; Buffer : Buffer_Number := Buffer_Number'First; Str : String) is function Set_Fld_Buffer (Fld : Field; Bufnum : C_Int; S : char_array) return Eti_Error; pragma Import (C, Set_Fld_Buffer, "set_field_buffer"); begin Eti_Exception (Set_Fld_Buffer (Fld, C_Int (Buffer), To_C (Str))); end Set_Buffer; -- | -- | -- | procedure Get_Buffer (Fld : Field; Buffer : Buffer_Number := Buffer_Number'First; Str : out String) is function Field_Buffer (Fld : Field; B : C_Int) return chars_ptr; pragma Import (C, Field_Buffer, "field_buffer"); begin Fill_String (Field_Buffer (Fld, C_Int (Buffer)), Str); end Get_Buffer; function Get_Buffer (Fld : Field; Buffer : Buffer_Number := Buffer_Number'First) return String is function Field_Buffer (Fld : Field; B : C_Int) return chars_ptr; pragma Import (C, Field_Buffer, "field_buffer"); begin return Fill_String (Field_Buffer (Fld, C_Int (Buffer))); end Get_Buffer; -- | -- | -- | procedure Set_Status (Fld : Field; Status : Boolean := True) is function Set_Fld_Status (Fld : Field; St : C_Int) return Eti_Error; pragma Import (C, Set_Fld_Status, "set_field_status"); begin if Set_Fld_Status (Fld, Boolean'Pos (Status)) /= E_Ok then raise Form_Exception; end if; end Set_Status; -- | -- | -- | function Changed (Fld : Field) return Boolean is function Field_Status (Fld : Field) return C_Int; pragma Import (C, Field_Status, "field_status"); Res : constant C_Int := Field_Status (Fld); begin if Res = Curses_False then return False; else return True; end if; end Changed; -- | -- | -- | procedure Set_Maximum_Size (Fld : Field; Max : Natural := 0) is function Set_Field_Max (Fld : Field; M : C_Int) return Eti_Error; pragma Import (C, Set_Field_Max, "set_max_field"); begin Eti_Exception (Set_Field_Max (Fld, C_Int (Max))); end Set_Maximum_Size; -- | -- |===================================================================== -- | man page form_field_opts.3x -- |===================================================================== -- | -- | -- | procedure Set_Options (Fld : Field; Options : Field_Option_Set) is function Set_Field_Opts (Fld : Field; Opt : Field_Option_Set) return Eti_Error; pragma Import (C, Set_Field_Opts, "set_field_opts"); begin Eti_Exception (Set_Field_Opts (Fld, Options)); end Set_Options; -- | -- | -- | procedure Switch_Options (Fld : Field; Options : Field_Option_Set; On : Boolean := True) is function Field_Opts_On (Fld : Field; Opt : Field_Option_Set) return Eti_Error; pragma Import (C, Field_Opts_On, "field_opts_on"); function Field_Opts_Off (Fld : Field; Opt : Field_Option_Set) return Eti_Error; pragma Import (C, Field_Opts_Off, "field_opts_off"); begin if On then Eti_Exception (Field_Opts_On (Fld, Options)); else Eti_Exception (Field_Opts_Off (Fld, Options)); end if; end Switch_Options; -- | -- | -- | procedure Get_Options (Fld : Field; Options : out Field_Option_Set) is function Field_Opts (Fld : Field) return Field_Option_Set; pragma Import (C, Field_Opts, "field_opts"); begin Options := Field_Opts (Fld); end Get_Options; -- | -- | -- | function Get_Options (Fld : Field := Null_Field) return Field_Option_Set is Fos : Field_Option_Set; begin Get_Options (Fld, Fos); return Fos; end Get_Options; -- | -- |===================================================================== -- | man page form_field_attributes.3x -- |===================================================================== -- | -- | -- | procedure Set_Foreground (Fld : Field; Fore : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First) is function Set_Field_Fore (Fld : Field; Attr : Attributed_Character) return Eti_Error; pragma Import (C, Set_Field_Fore, "set_field_fore"); begin Eti_Exception (Set_Field_Fore (Fld, (Ch => Character'First, Color => Color, Attr => Fore))); end Set_Foreground; -- | -- | -- | procedure Foreground (Fld : Field; Fore : out Character_Attribute_Set) is function Field_Fore (Fld : Field) return Attributed_Character; pragma Import (C, Field_Fore, "field_fore"); begin Fore := Field_Fore (Fld).Attr; end Foreground; procedure Foreground (Fld : Field; Fore : out Character_Attribute_Set; Color : out Color_Pair) is function Field_Fore (Fld : Field) return Attributed_Character; pragma Import (C, Field_Fore, "field_fore"); begin Fore := Field_Fore (Fld).Attr; Color := Field_Fore (Fld).Color; end Foreground; -- | -- | -- | procedure Set_Background (Fld : Field; Back : Character_Attribute_Set := Normal_Video; Color : Color_Pair := Color_Pair'First) is function Set_Field_Back (Fld : Field; Attr : Attributed_Character) return Eti_Error; pragma Import (C, Set_Field_Back, "set_field_back"); begin Eti_Exception (Set_Field_Back (Fld, (Ch => Character'First, Color => Color, Attr => Back))); end Set_Background; -- | -- | -- | procedure Background (Fld : Field; Back : out Character_Attribute_Set) is function Field_Back (Fld : Field) return Attributed_Character; pragma Import (C, Field_Back, "field_back"); begin Back := Field_Back (Fld).Attr; end Background; procedure Background (Fld : Field; Back : out Character_Attribute_Set; Color : out Color_Pair) is function Field_Back (Fld : Field) return Attributed_Character; pragma Import (C, Field_Back, "field_back"); begin Back := Field_Back (Fld).Attr; Color := Field_Back (Fld).Color; end Background; -- | -- | -- | procedure Set_Pad_Character (Fld : Field; Pad : Character := Space) is function Set_Field_Pad (Fld : Field; Ch : C_Int) return Eti_Error; pragma Import (C, Set_Field_Pad, "set_field_pad"); begin Eti_Exception (Set_Field_Pad (Fld, C_Int (Character'Pos (Pad)))); end Set_Pad_Character; -- | -- | -- | procedure Pad_Character (Fld : Field; Pad : out Character) is function Field_Pad (Fld : Field) return C_Int; pragma Import (C, Field_Pad, "field_pad"); begin Pad := Character'Val (Field_Pad (Fld)); end Pad_Character; -- | -- |===================================================================== -- | man page form_field_info.3x -- |===================================================================== -- | -- | -- | procedure Info (Fld : Field; Lines : out Line_Count; Columns : out Column_Count; First_Row : out Line_Position; First_Column : out Column_Position; Off_Screen : out Natural; Additional_Buffers : out Buffer_Number) is type C_Int_Access is access all C_Int; function Fld_Info (Fld : Field; L, C, Fr, Fc, Os, Ab : C_Int_Access) return Eti_Error; pragma Import (C, Fld_Info, "field_info"); L, C, Fr, Fc, Os, Ab : aliased C_Int; begin Eti_Exception (Fld_Info (Fld, L'Access, C'Access, Fr'Access, Fc'Access, Os'Access, Ab'Access)); Lines := Line_Count (L); Columns := Column_Count (C); First_Row := Line_Position (Fr); First_Column := Column_Position (Fc); Off_Screen := Natural (Os); Additional_Buffers := Buffer_Number (Ab); end Info; -- | -- | -- | procedure Dynamic_Info (Fld : Field; Lines : out Line_Count; Columns : out Column_Count; Max : out Natural) is type C_Int_Access is access all C_Int; function Dyn_Info (Fld : Field; L, C, M : C_Int_Access) return Eti_Error; pragma Import (C, Dyn_Info, "dynamic_field_info"); L, C, M : aliased C_Int; begin Eti_Exception (Dyn_Info (Fld, L'Access, C'Access, M'Access)); Lines := Line_Count (L); Columns := Column_Count (C); Max := Natural (M); end Dynamic_Info; -- | -- |===================================================================== -- | man page form_win.3x -- |===================================================================== -- | -- | -- | procedure Set_Window (Frm : Form; Win : Window) is function Set_Form_Win (Frm : Form; Win : Window) return Eti_Error; pragma Import (C, Set_Form_Win, "set_form_win"); begin Eti_Exception (Set_Form_Win (Frm, Win)); end Set_Window; -- | -- | -- | function Get_Window (Frm : Form) return Window is function Form_Win (Frm : Form) return Window; pragma Import (C, Form_Win, "form_win"); W : constant Window := Form_Win (Frm); begin return W; end Get_Window; -- | -- | -- | procedure Set_Sub_Window (Frm : Form; Win : Window) is function Set_Form_Sub (Frm : Form; Win : Window) return Eti_Error; pragma Import (C, Set_Form_Sub, "set_form_sub"); begin Eti_Exception (Set_Form_Sub (Frm, Win)); end Set_Sub_Window; -- | -- | -- | function Get_Sub_Window (Frm : Form) return Window is function Form_Sub (Frm : Form) return Window; pragma Import (C, Form_Sub, "form_sub"); W : constant Window := Form_Sub (Frm); begin return W; end Get_Sub_Window; -- | -- | -- | procedure Scale (Frm : Form; Lines : out Line_Count; Columns : out Column_Count) is type C_Int_Access is access all C_Int; function M_Scale (Frm : Form; Yp, Xp : C_Int_Access) return Eti_Error; pragma Import (C, M_Scale, "scale_form"); X, Y : aliased C_Int; begin Eti_Exception (M_Scale (Frm, Y'Access, X'Access)); Lines := Line_Count (Y); Columns := Column_Count (X); end Scale; -- | -- |===================================================================== -- | man page menu_hook.3x -- |===================================================================== -- | -- | -- | procedure Set_Field_Init_Hook (Frm : Form; Proc : Form_Hook_Function) is function Set_Field_Init (Frm : Form; Proc : Form_Hook_Function) return Eti_Error; pragma Import (C, Set_Field_Init, "set_field_init"); begin Eti_Exception (Set_Field_Init (Frm, Proc)); end Set_Field_Init_Hook; -- | -- | -- | procedure Set_Field_Term_Hook (Frm : Form; Proc : Form_Hook_Function) is function Set_Field_Term (Frm : Form; Proc : Form_Hook_Function) return Eti_Error; pragma Import (C, Set_Field_Term, "set_field_term"); begin Eti_Exception (Set_Field_Term (Frm, Proc)); end Set_Field_Term_Hook; -- | -- | -- | procedure Set_Form_Init_Hook (Frm : Form; Proc : Form_Hook_Function) is function Set_Form_Init (Frm : Form; Proc : Form_Hook_Function) return Eti_Error; pragma Import (C, Set_Form_Init, "set_form_init"); begin Eti_Exception (Set_Form_Init (Frm, Proc)); end Set_Form_Init_Hook; -- | -- | -- | procedure Set_Form_Term_Hook (Frm : Form; Proc : Form_Hook_Function) is function Set_Form_Term (Frm : Form; Proc : Form_Hook_Function) return Eti_Error; pragma Import (C, Set_Form_Term, "set_form_term"); begin Eti_Exception (Set_Form_Term (Frm, Proc)); end Set_Form_Term_Hook; -- | -- |===================================================================== -- | man page form_fields.3x -- |===================================================================== -- | -- | -- | procedure Redefine (Frm : Form; Flds : Field_Array_Access) is function Set_Frm_Fields (Frm : Form; Items : System.Address) return Eti_Error; pragma Import (C, Set_Frm_Fields, "set_form_fields"); begin pragma Assert (Flds.all (Flds'Last) = Null_Field); if Flds.all (Flds'Last) /= Null_Field then raise Form_Exception; else Eti_Exception (Set_Frm_Fields (Frm, Flds.all (Flds'First)'Address)); end if; end Redefine; -- | -- | -- | function Fields (Frm : Form; Index : Positive) return Field is use F_Array; function C_Fields (Frm : Form) return Pointer; pragma Import (C, C_Fields, "form_fields"); P : Pointer := C_Fields (Frm); begin if P = null or else Index > Field_Count (Frm) then raise Form_Exception; else P := P + ptrdiff_t (C_Int (Index) - 1); return P.all; end if; end Fields; -- | -- | -- | function Field_Count (Frm : Form) return Natural is function Count (Frm : Form) return C_Int; pragma Import (C, Count, "field_count"); begin return Natural (Count (Frm)); end Field_Count; -- | -- | -- | procedure Move (Fld : Field; Line : Line_Position; Column : Column_Position) is function Move (Fld : Field; L, C : C_Int) return Eti_Error; pragma Import (C, Move, "move_field"); begin Eti_Exception (Move (Fld, C_Int (Line), C_Int (Column))); end Move; -- | -- |===================================================================== -- | man page form_new.3x -- |===================================================================== -- | -- | -- | function Create (Fields : Field_Array_Access) return Form is function NewForm (Fields : System.Address) return Form; pragma Import (C, NewForm, "new_form"); M : Form; begin pragma Assert (Fields.all (Fields'Last) = Null_Field); if Fields.all (Fields'Last) /= Null_Field then raise Form_Exception; else M := NewForm (Fields.all (Fields'First)'Address); if M = Null_Form then raise Form_Exception; end if; return M; end if; end Create; -- | -- | -- | procedure Delete (Frm : in out Form) is function Free (Frm : Form) return Eti_Error; pragma Import (C, Free, "free_form"); begin Eti_Exception (Free (Frm)); Frm := Null_Form; end Delete; -- | -- |===================================================================== -- | man page form_opts.3x -- |===================================================================== -- | -- | -- | procedure Set_Options (Frm : Form; Options : Form_Option_Set) is function Set_Form_Opts (Frm : Form; Opt : Form_Option_Set) return Eti_Error; pragma Import (C, Set_Form_Opts, "set_form_opts"); begin Eti_Exception (Set_Form_Opts (Frm, Options)); end Set_Options; -- | -- | -- | procedure Switch_Options (Frm : Form; Options : Form_Option_Set; On : Boolean := True) is function Form_Opts_On (Frm : Form; Opt : Form_Option_Set) return Eti_Error; pragma Import (C, Form_Opts_On, "form_opts_on"); function Form_Opts_Off (Frm : Form; Opt : Form_Option_Set) return Eti_Error; pragma Import (C, Form_Opts_Off, "form_opts_off"); begin if On then Eti_Exception (Form_Opts_On (Frm, Options)); else Eti_Exception (Form_Opts_Off (Frm, Options)); end if; end Switch_Options; -- | -- | -- | procedure Get_Options (Frm : Form; Options : out Form_Option_Set) is function Form_Opts (Frm : Form) return Form_Option_Set; pragma Import (C, Form_Opts, "form_opts"); begin Options := Form_Opts (Frm); end Get_Options; -- | -- | -- | function Get_Options (Frm : Form := Null_Form) return Form_Option_Set is Fos : Form_Option_Set; begin Get_Options (Frm, Fos); return Fos; end Get_Options; -- | -- |===================================================================== -- | man page form_post.3x -- |===================================================================== -- | -- | -- | procedure Post (Frm : Form; Post : Boolean := True) is function M_Post (Frm : Form) return Eti_Error; pragma Import (C, M_Post, "post_form"); function M_Unpost (Frm : Form) return Eti_Error; pragma Import (C, M_Unpost, "unpost_form"); begin if Post then Eti_Exception (M_Post (Frm)); else Eti_Exception (M_Unpost (Frm)); end if; end Post; -- | -- |===================================================================== -- | man page form_cursor.3x -- |===================================================================== -- | -- | -- | procedure Position_Cursor (Frm : Form) is function Pos_Form_Cursor (Frm : Form) return Eti_Error; pragma Import (C, Pos_Form_Cursor, "pos_form_cursor"); begin Eti_Exception (Pos_Form_Cursor (Frm)); end Position_Cursor; -- | -- |===================================================================== -- | man page form_data.3x -- |===================================================================== -- | -- | -- | function Data_Ahead (Frm : Form) return Boolean is function Ahead (Frm : Form) return C_Int; pragma Import (C, Ahead, "data_ahead"); Res : constant C_Int := Ahead (Frm); begin if Res = Curses_False then return False; else return True; end if; end Data_Ahead; -- | -- | -- | function Data_Behind (Frm : Form) return Boolean is function Behind (Frm : Form) return C_Int; pragma Import (C, Behind, "data_behind"); Res : constant C_Int := Behind (Frm); begin if Res = Curses_False then return False; else return True; end if; end Data_Behind; -- | -- |===================================================================== -- | man page form_driver.3x -- |===================================================================== -- | -- | -- | function Driver (Frm : Form; Key : Key_Code) return Driver_Result is function Frm_Driver (Frm : Form; Key : C_Int) return Eti_Error; pragma Import (C, Frm_Driver, "form_driver"); R : constant Eti_Error := Frm_Driver (Frm, C_Int (Key)); begin case R is when E_Unknown_Command => return Unknown_Request; when E_Invalid_Field => return Invalid_Field; when E_Request_Denied => return Request_Denied; when others => Eti_Exception (R); return Form_Ok; end case; end Driver; -- | -- |===================================================================== -- | man page form_page.3x -- |===================================================================== -- | -- | -- | procedure Set_Current (Frm : Form; Fld : Field) is function Set_Current_Fld (Frm : Form; Fld : Field) return Eti_Error; pragma Import (C, Set_Current_Fld, "set_current_field"); begin Eti_Exception (Set_Current_Fld (Frm, Fld)); end Set_Current; -- | -- | -- | function Current (Frm : Form) return Field is function Current_Fld (Frm : Form) return Field; pragma Import (C, Current_Fld, "current_field"); Fld : constant Field := Current_Fld (Frm); begin if Fld = Null_Field then raise Form_Exception; end if; return Fld; end Current; -- | -- | -- | procedure Set_Page (Frm : Form; Page : Page_Number := Page_Number'First) is function Set_Frm_Page (Frm : Form; Pg : C_Int) return Eti_Error; pragma Import (C, Set_Frm_Page, "set_form_page"); begin Eti_Exception (Set_Frm_Page (Frm, C_Int (Page))); end Set_Page; -- | -- | -- | function Page (Frm : Form) return Page_Number is function Get_Page (Frm : Form) return C_Int; pragma Import (C, Get_Page, "form_page"); P : constant C_Int := Get_Page (Frm); begin if P < 0 then raise Form_Exception; else return Page_Number (P); end if; end Page; function Get_Index (Fld : Field) return Positive is function Get_Fieldindex (Fld : Field) return C_Int; pragma Import (C, Get_Fieldindex, "field_index"); Res : constant C_Int := Get_Fieldindex (Fld); begin if Res = Curses_Err then raise Form_Exception; end if; return Positive (Natural (Res) + Positive'First); end Get_Index; -- | -- |===================================================================== -- | man page form_new_page.3x -- |===================================================================== -- | -- | -- | procedure Set_New_Page (Fld : Field; New_Page : Boolean := True) is function Set_Page (Fld : Field; Flg : C_Int) return Eti_Error; pragma Import (C, Set_Page, "set_new_page"); begin Eti_Exception (Set_Page (Fld, Boolean'Pos (New_Page))); end Set_New_Page; -- | -- | -- | function Is_New_Page (Fld : Field) return Boolean is function Is_New (Fld : Field) return C_Int; pragma Import (C, Is_New, "new_page"); Res : constant C_Int := Is_New (Fld); begin if Res = Curses_False then return False; else return True; end if; end Is_New_Page; procedure Free (FA : in out Field_Array_Access; Free_Fields : Boolean := False) is procedure Release is new Ada.Unchecked_Deallocation (Field_Array, Field_Array_Access); begin if FA /= null and then Free_Fields then for I in FA'First .. (FA'Last - 1) loop if FA.all (I) /= Null_Field then Delete (FA.all (I)); end if; end loop; end if; Release (FA); end Free; -- |===================================================================== function Default_Field_Options return Field_Option_Set is begin return Get_Options (Null_Field); end Default_Field_Options; function Default_Form_Options return Form_Option_Set is begin return Get_Options (Null_Form); end Default_Form_Options; end Terminal_Interface.Curses.Forms; AdaCurses-20170708/src/terminal_interface-curses-panels-user_data.adb0000644000175100001440000000777011315446021024206 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Panels.User_Data -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; package body Terminal_Interface.Curses.Panels.User_Data is use type Interfaces.C.int; procedure Set_User_Data (Pan : Panel; Data : User_Access) is function Set_Panel_Userptr (Pan : Panel; Addr : User_Access) return C_Int; pragma Import (C, Set_Panel_Userptr, "set_panel_userptr"); begin if Set_Panel_Userptr (Pan, Data) = Curses_Err then raise Panel_Exception; end if; end Set_User_Data; function Get_User_Data (Pan : Panel) return User_Access is function Panel_Userptr (Pan : Panel) return User_Access; pragma Import (C, Panel_Userptr, "panel_userptr"); begin return Panel_Userptr (Pan); end Get_User_Data; procedure Get_User_Data (Pan : Panel; Data : out User_Access) is begin Data := Get_User_Data (Pan); end Get_User_Data; end Terminal_Interface.Curses.Panels.User_Data; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-alphanumeric.adb0000644000175100001440000000703112340207631027047 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.13 $ -- $Date: 2014/05/24 21:31:05 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is procedure Set_Field_Type (Fld : Field; Typ : AlphaNumeric_Field) is function Set_Fld_Type (F : Field := Fld; Arg1 : C_Int) return Eti_Error; pragma Import (C, Set_Fld_Type, "set_field_type_alnum"); begin Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width))); Wrap_Builtin (Fld, Typ); end Set_Field_Type; end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric; AdaCurses-20170708/src/terminal_interface-curses-text_io-modular_io.adb0000644000175100001440000000716511315445551024567 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Modular_IO -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Terminal_Interface.Curses.Text_IO.Aux; package body Terminal_Interface.Curses.Text_IO.Modular_IO is package Aux renames Terminal_Interface.Curses.Text_IO.Aux; package MIO is new Ada.Text_IO.Modular_IO (Num); procedure Put (Win : Window; Item : Num; Width : Field := Default_Width; Base : Number_Base := Default_Base) is Buf : String (1 .. Field'Last); begin MIO.Put (Buf, Item, Base); Aux.Put_Buf (Win, Buf, Width); end Put; procedure Put (Item : Num; Width : Field := Default_Width; Base : Number_Base := Default_Base) is begin Put (Get_Window, Item, Width, Base); end Put; end Terminal_Interface.Curses.Text_IO.Modular_IO; AdaCurses-20170708/src/terminal_interface-curses-terminfo.adb0000644000175100001440000001542411315445062022601 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Terminfo -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2006,2009 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, 1996 -- Version Control: -- $Revision: 1.6 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with Ada.Unchecked_Conversion; package body Terminal_Interface.Curses.Terminfo is function Is_MinusOne_Pointer (P : chars_ptr) return Boolean; function Is_MinusOne_Pointer (P : chars_ptr) return Boolean is type Weird_Address is new System.Storage_Elements.Integer_Address; Invalid_Pointer : constant Weird_Address := -1; function To_Weird is new Ada.Unchecked_Conversion (Source => chars_ptr, Target => Weird_Address); begin if To_Weird (P) = Invalid_Pointer then return True; else return False; end if; end Is_MinusOne_Pointer; pragma Inline (Is_MinusOne_Pointer); ------------------------------------------------------------------------------ function Get_Flag (Name : String) return Boolean is function tigetflag (id : char_array) return Curses_Bool; pragma Import (C, tigetflag); Txt : char_array (0 .. Name'Length); Length : size_t; begin To_C (Name, Txt, Length); if tigetflag (Txt) = Curses_Bool (Curses_True) then return True; else return False; end if; end Get_Flag; ------------------------------------------------------------------------------ procedure Get_String (Name : String; Value : out Terminfo_String; Result : out Boolean) is function tigetstr (id : char_array) return chars_ptr; pragma Import (C, tigetstr, "tigetstr"); Txt : char_array (0 .. Name'Length); Length : size_t; Txt2 : chars_ptr; begin To_C (Name, Txt, Length); Txt2 := tigetstr (Txt); if Txt2 = Null_Ptr then Result := False; elsif Is_MinusOne_Pointer (Txt2) then raise Curses_Exception; else Value := Terminfo_String (Fill_String (Txt2)); Result := True; end if; end Get_String; ------------------------------------------------------------------------------ function Has_String (Name : String) return Boolean is function tigetstr (id : char_array) return chars_ptr; pragma Import (C, tigetstr, "tigetstr"); Txt : char_array (0 .. Name'Length); Length : size_t; Txt2 : chars_ptr; begin To_C (Name, Txt, Length); Txt2 := tigetstr (Txt); if Txt2 = Null_Ptr then return False; elsif Is_MinusOne_Pointer (Txt2) then raise Curses_Exception; else return True; end if; end Has_String; ------------------------------------------------------------------------------ function Get_Number (Name : String) return Integer is function tigetstr (s : char_array) return C_Int; pragma Import (C, tigetstr); Txt : char_array (0 .. Name'Length); Length : size_t; begin To_C (Name, Txt, Length); return Integer (tigetstr (Txt)); end Get_Number; ------------------------------------------------------------------------------ procedure Put_String (Str : Terminfo_String; affcnt : Natural := 1; putc : putctype := null) is function tputs (str : char_array; affcnt : C_Int; putc : putctype) return C_Int; function putp (str : char_array) return C_Int; pragma Import (C, tputs); pragma Import (C, putp); Txt : char_array (0 .. Str'Length); Length : size_t; Err : C_Int; begin To_C (String (Str), Txt, Length); if putc = null then Err := putp (Txt); else Err := tputs (Txt, C_Int (affcnt), putc); end if; if Err = Curses_Err then raise Curses_Exception; end if; end Put_String; end Terminal_Interface.Curses.Terminfo; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-regexp.adb0000644000175100001440000000701712340207631025675 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.RegExp -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; use Interfaces.C; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.RegExp is procedure Set_Field_Type (Fld : Field; Typ : Regular_Expression_Field) is function Set_Ftyp (F : Field := Fld; Arg1 : char_array) return Eti_Error; pragma Import (C, Set_Ftyp, "set_field_type_regexp"); begin Eti_Exception (Set_Ftyp (Arg1 => To_C (Typ.Regular_Expression.all))); Wrap_Builtin (Fld, Typ); end Set_Field_Type; end Terminal_Interface.Curses.Forms.Field_Types.RegExp; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-numeric.ads0000644000175100001440000000656511315445666026112 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.Numeric -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.Numeric is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Numeric); type Numeric_Field is new Field_Type with record Precision : Natural; Lower_Limit : Float; Upper_Limit : Float; end record; procedure Set_Field_Type (Fld : Field; Typ : Numeric_Field); pragma Inline (Set_Field_Type); end Terminal_Interface.Curses.Forms.Field_Types.Numeric; AdaCurses-20170708/src/terminal_interface-curses-forms-field_user_data.adb0000644000175100001440000001015512340207631025205 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_User_Data -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2014 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, 1996 -- Version Control: -- $Revision: 1.15 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; -- | -- |===================================================================== -- | man page form_field_userptr.3x -- |===================================================================== -- | package body Terminal_Interface.Curses.Forms.Field_User_Data is -- | -- | -- | use type Interfaces.C.int; procedure Set_User_Data (Fld : Field; Data : User_Access) is function Set_Field_Userptr (Fld : Field; Usr : User_Access) return Eti_Error; pragma Import (C, Set_Field_Userptr, "set_field_userptr"); begin Eti_Exception (Set_Field_Userptr (Fld, Data)); end Set_User_Data; -- | -- | -- | function Get_User_Data (Fld : Field) return User_Access is function Field_Userptr (Fld : Field) return User_Access; pragma Import (C, Field_Userptr, "field_userptr"); begin return Field_Userptr (Fld); end Get_User_Data; procedure Get_User_Data (Fld : Field; Data : out User_Access) is begin Data := Get_User_Data (Fld); end Get_User_Data; end Terminal_Interface.Curses.Forms.Field_User_Data; AdaCurses-20170708/src/terminal_interface-curses-putwin.ads0000644000175100001440000000614107746514446022341 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.PutWin -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000,2003 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, 1996 -- Version Control: -- $Revision: 1.4 $ -- Binding Version 01.00 with Ada.Streams.Stream_IO; package Terminal_Interface.Curses.PutWin is procedure Put_Window (Win : Window; File : Ada.Streams.Stream_IO.File_Type); function Get_Window (File : Ada.Streams.Stream_IO.File_Type) return Window; end Terminal_Interface.Curses.PutWin; AdaCurses-20170708/src/terminal_interface-curses-text_io-enumeration_io.ads0000644000175100001440000000661211315445471025470 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Enumeration_IO -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type Enum is (<>); package Terminal_Interface.Curses.Text_IO.Enumeration_IO is Default_Width : Field := 0; Default_Setting : Type_Set := Mixed_Case; procedure Put (Win : Window; Item : Enum; Width : Field := Default_Width; Set : Type_Set := Default_Setting); procedure Put (Item : Enum; Width : Field := Default_Width; Set : Type_Set := Default_Setting); private pragma Inline (Put); end Terminal_Interface.Curses.Text_IO.Enumeration_IO; AdaCurses-20170708/src/Makefile.in0000644000175100001440000002706512767357374015250 0ustar tomusers############################################################################## # Copyright (c) 1998-2015,2016 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, 1996 # # $Id: Makefile.in,v 1.73 2016/09/18 00:25:32 tom Exp $ # .SUFFIXES: SHELL = @SHELL@ VPATH = @srcdir@ THIS = Makefile ADA_MFLAGS = @cf_cv_makeflags@ @SET_MAKE@ MODEL = ../../@DFT_OBJ_SUBDIR@ DESTDIR = @DESTDIR@ top_srcdir = @top_srcdir@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ includedir = @includedir@ libdir = @libdir@ LIBDIR = $(DESTDIR)$(libdir) ADA_INCLUDE = $(DESTDIR)@ADA_INCLUDE@ ADA_OBJECTS = $(DESTDIR)@ADA_OBJECTS@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ AR = @AR@ ARFLAGS = @ARFLAGS@ AWK = @AWK@ LN_S = @LN_S@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @ACPPFLAGS@ @CPPFLAGS@ \ -DHAVE_CONFIG_H -I$(srcdir) CCFLAGS = $(CPPFLAGS) $(CFLAGS) CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LINK = $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ RANLIB = @RANLIB@ ################################################################################ ADA = @cf_ada_compiler@ ADAPREP = gnatprep ADAFLAGS = @ADAFLAGS@ -I. -I$(srcdir) LIB_NAME = AdaCurses SONAME = @ADA_SHAREDLIB@ GNAT_PROJECT = AdaCurses.gpr # build/source are the Ada95 tree BUILD_DIR = .. SOURCE_DIR = .. BUILD_DIR_LIB = $(BUILD_DIR)/lib SOURCE_DIR_SRC = $(SOURCE_DIR)/src ADAMAKE = @cf_ada_make@ ADAMAKEFLAGS = \ -P$(GNAT_PROJECT) \ -XBUILD_DIR=`cd $(BUILD_DIR);pwd` \ -XSOURCE_DIR=`cd $(SOURCE_DIR);pwd` \ -XSOURCE_DIR2=`cd $(srcdir);pwd` \ -XLIB_NAME=$(LIB_NAME) \ -XSONAME=$(SONAME) CARGS = -cargs $(ADAFLAGS) LARGS = STATIC_LIBNAME = lib$(LIB_NAME).a SHARED_LIBNAME = $(SONAME) SHARED_SYMLINK = lib$(LIB_NAME).so ALIB = @cf_ada_package@ ABASE = $(ALIB)-curses ################################################################################ GENERATED_SOURCES=$(ABASE).ads \ $(ABASE).adb \ $(ABASE)-aux.ads \ $(ABASE)-trace.ads \ $(ABASE)-menus.ads \ $(ABASE)-forms.ads \ $(ABASE)-mouse.ads \ $(ABASE)-panels.ads \ $(ABASE)-menus-menu_user_data.ads \ $(ABASE)-menus-item_user_data.ads \ $(ABASE)-forms-form_user_data.ads \ $(ABASE)-forms-field_types.ads \ $(ABASE)-forms-field_user_data.ads \ $(ABASE)-panels-user_data.ads ################################################################################ LIBOBJS=$(ALIB).o \ $(ABASE)-aux.o \ $(ABASE).o \ $(ABASE)-terminfo.o \ $(ABASE)-termcap.o \ $(ABASE)-putwin.o \ $(ABASE)-trace.o \ $(ABASE)-mouse.o \ $(ABASE)-panels.o \ $(ABASE)-menus.o \ $(ABASE)-forms.o \ $(ABASE)-forms-field_types.o \ $(ABASE)-forms-field_types-alpha.o \ $(ABASE)-forms-field_types-alphanumeric.o \ $(ABASE)-forms-field_types-intfield.o \ $(ABASE)-forms-field_types-numeric.o \ $(ABASE)-forms-field_types-regexp.o \ $(ABASE)-forms-field_types-enumeration.o \ $(ABASE)-forms-field_types-ipv4_address.o \ $(ABASE)-forms-field_types-user.o \ $(ABASE)-forms-field_types-user-choice.o \ $(ABASE)-text_io.o \ $(ABASE)-text_io-aux.o # Ada object files for generic packages. Since gnat 3.10 they are # also compiled GENOBJS=$(ABASE)-menus-menu_user_data.o \ $(ABASE)-menus-item_user_data.o \ $(ABASE)-forms-form_user_data.o \ $(ABASE)-forms-field_user_data.o \ $(ABASE)-forms-field_types-enumeration-ada.o \ $(ABASE)-panels-user_data.o \ $(ABASE)-text_io-integer_io.o \ $(ABASE)-text_io-float_io.o \ $(ABASE)-text_io-fixed_io.o \ $(ABASE)-text_io-decimal_io.o \ $(ABASE)-text_io-enumeration_io.o \ $(ABASE)-text_io-modular_io.o \ $(ABASE)-text_io-complex_io.o all :: $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) @echo done $(ADA_INCLUDE) \ $(ADA_OBJECTS) \ $(LIBDIR) \ $(BUILD_DIR_LIB) : mkdir -p $@ $(GENERATED_SOURCES) : cd ../gen; $(MAKE) $(ADA_MFLAGS) sources : $(GENERATED_SOURCES) @echo made $@ libs \ install \ install.libs :: \ $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) @echo made $(STATIC_LIBNAME) install \ install.libs :: \ $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \ $(ADA_OBJECTS) @$(INSTALL_LIB) \ $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \ $(ADA_OBJECTS) uninstall \ uninstall.libs :: @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME) mostlyclean :: rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] *.a clean :: mostlyclean rm -f $(ABASE)-trace.adb distclean :: clean rm -f Makefile realclean :: distclean BASEDEPS=$(ABASE).ads $(ABASE)-aux.ads $(ABASE).adb $(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p rm -f $@ $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ @GNATPREP_OPTS@ $(srcdir)/$(ABASE)-trace.adb_p $@ ############################################################################### # Use these definitions when building a shared library. SHARED_C_OBJS = c_varargs_to_ada.o c_threaded_variables.o ncurses_compat.o SHARED_OBJS = $(SHARED_C_OBJS) @USE_OLD_MAKERULES@$(LIBOBJS) @cf_generic_objects@ c_varargs_to_ada.o : $(srcdir)/c_varargs_to_ada.c $(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/c_varargs_to_ada.c c_threaded_variables.o : $(srcdir)/c_threaded_variables.c $(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/c_threaded_variables.c ncurses_compat.o : $(srcdir)/ncurses_compat.c $(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/ncurses_compat.c ############################################################################### # Use these definitions when building a static library. STATIC_C_OBJS = static_c_varargs_to_ada.o static_c_threaded_variables.o static_ncurses_compat.o STATIC_OBJS = $(STATIC_C_OBJS) @USE_OLD_MAKERULES@$(LIBOBJS) @cf_generic_objects@ static_c_varargs_to_ada.o : $(srcdir)/c_varargs_to_ada.c $(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/c_varargs_to_ada.c static_c_threaded_variables.o : $(srcdir)/c_threaded_variables.c $(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/c_threaded_variables.c static_ncurses_compat.o : $(srcdir)/ncurses_compat.c $(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/ncurses_compat.c ############################################################################### @USE_OLD_MAKERULES@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \ @USE_OLD_MAKERULES@ $(BUILD_DIR_LIB) \ @USE_OLD_MAKERULES@ $(STATIC_OBJS) @USE_OLD_MAKERULES@ $(AR) $(ARFLAGS) $@ $(STATIC_OBJS) $(BUILD_DIR)/static-ali : ; mkdir -p $@ $(BUILD_DIR)/static-obj : ; mkdir -p $@ STATIC_DIRS = \ $(BUILD_DIR_LIB) \ $(BUILD_DIR)/static-ali \ $(BUILD_DIR)/static-obj @USE_GNAT_PROJECTS@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \ @USE_GNAT_PROJECTS@ $(ABASE)-trace.adb \ @USE_GNAT_PROJECTS@ $(STATIC_C_OBJS) \ @USE_GNAT_PROJECTS@ $(STATIC_DIRS) @USE_GNAT_PROJECTS@ $(SHELL) $(srcdir)/library-cfg.sh $(srcdir)/library.gpr $(CFLAGS_NORMAL) >$(GNAT_PROJECT) @USE_GNAT_PROJECTS@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static @USE_GNAT_PROJECTS@ $(AR) $(ARFLAGS) $@ $(STATIC_C_OBJS) @USE_GNAT_PROJECTS@ -rm -f $(GNAT_PROJECT) @USE_GNAT_PROJECTS@ @USE_GNAT_LIBRARIES@install \ @USE_GNAT_LIBRARIES@install.libs :: \ @USE_GNAT_LIBRARIES@ $(ADA_OBJECTS) @USE_GNAT_LIBRARIES@ $(INSTALL_LIB) \ @USE_GNAT_LIBRARIES@ $(BUILD_DIR)/static-ali/*.ali \ @USE_GNAT_LIBRARIES@ $(ADA_OBJECTS) uninstall \ uninstall.libs :: @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME) @USE_GNAT_LIBRARIES@uninstall \ @USE_GNAT_LIBRARIES@uninstall.libs :: @USE_GNAT_LIBRARIES@ @$(SHELL) -c 'for name in $(BUILD_DIR)/static-ali/*.ali ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done' $(BUILD_DIR)/dynamic-ali : ; mkdir -p $@ $(BUILD_DIR)/dynamic-obj : ; mkdir -p $@ SHARED_DIRS = \ $(BUILD_DIR_LIB) \ $(BUILD_DIR)/dynamic-ali \ $(BUILD_DIR)/dynamic-obj @MAKE_ADA_SHAREDLIB@all :: $(BUILD_DIR_LIB)/$(SHARED_LIBNAME) @MAKE_ADA_SHAREDLIB@$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) :: \ @MAKE_ADA_SHAREDLIB@ $(ABASE)-trace.adb \ @MAKE_ADA_SHAREDLIB@ $(SHARED_DIRS) \ @MAKE_ADA_SHAREDLIB@ $(SHARED_OBJS) @MAKE_ADA_SHAREDLIB@ cp $(SHARED_OBJS) $(BUILD_DIR)/dynamic-obj/ @MAKE_ADA_SHAREDLIB@ $(SHELL) $(srcdir)/library-cfg.sh $(srcdir)/library.gpr $(CFLAGS_SHARED) >$(GNAT_PROJECT) @MAKE_ADA_SHAREDLIB@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic @MAKE_ADA_SHAREDLIB@ -rm -f $(GNAT_PROJECT) install \ install.libs :: $(ADA_INCLUDE) $(INSTALL_LIB) \ $(SOURCE_DIR_SRC)/*.ad[sb] \ $(ADA_INCLUDE) install \ install.libs :: $(ADA_INCLUDE) $(INSTALL_LIB) \ $(GENERATED_SOURCES) \ $(ADA_INCLUDE) uninstall \ uninstall.libs :: $(SHELL) -c 'for name in $(SOURCE_DIR_SRC)/*.ad[sb] $(GENERATED_SOURCES); do rm -f $(ADA_INCLUDE)/`basename $$name`; done' @MAKE_ADA_SHAREDLIB@install \ @MAKE_ADA_SHAREDLIB@install.libs :: $(ADA_OBJECTS) $(LIBDIR) @MAKE_ADA_SHAREDLIB@ $(INSTALL_LIB) \ @MAKE_ADA_SHAREDLIB@ $(BUILD_DIR)/dynamic-ali/* \ @MAKE_ADA_SHAREDLIB@ $(ADA_OBJECTS) @MAKE_ADA_SHAREDLIB@ $(INSTALL_LIB) \ @MAKE_ADA_SHAREDLIB@ $(BUILD_DIR_LIB)/$(SHARED_LIBNAME) \ @MAKE_ADA_SHAREDLIB@ $(LIBDIR) @MAKE_ADA_SHAREDLIB@ cd $(LIBDIR) && $(LN_S) $(SHARED_LIBNAME) $(SHARED_SYMLINK) @MAKE_ADA_SHAREDLIB@ @MAKE_ADA_SHAREDLIB@uninstall \ @MAKE_ADA_SHAREDLIB@uninstall.libs :: @MAKE_ADA_SHAREDLIB@ $(SHELL) -c 'for name in $(BUILD_DIR)/dynamic-ali/* ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done' @MAKE_ADA_SHAREDLIB@ @MAKE_ADA_SHAREDLIB@uninstall \ @MAKE_ADA_SHAREDLIB@uninstall.libs :: @MAKE_ADA_SHAREDLIB@ rm -f $(LIBDIR)/$(SHARED_SYMLINK) @MAKE_ADA_SHAREDLIB@ rm -f $(LIBDIR)/$(SHARED_LIBNAME) clean :: rm -rf $(BUILD_DIR)/*-ali rm -rf $(BUILD_DIR)/*-obj rm -rf $(BUILD_DIR_LIB) AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb0000644000175100001440000001037711542231164027460 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2004,2011 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, 1996 -- Version Control: -- $Revision: 1.11 $ -- $Date: 2011/03/22 23:36:20 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Characters.Handling; use Ada.Characters.Handling; package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is function Create (Set : Type_Set := Mixed_Case; Case_Sensitive : Boolean := False; Must_Be_Unique : Boolean := False) return Enumeration_Field is I : Enumeration_Info (T'Pos (T'Last) - T'Pos (T'First) + 1); J : Positive := 1; begin I.Case_Sensitive := Case_Sensitive; I.Match_Must_Be_Unique := Must_Be_Unique; for E in T'Range loop I.Names (J) := new String'(T'Image (E)); -- The Image attribute defaults to upper case, so we have to handle -- only the other ones... if Set /= Upper_Case then I.Names (J).all := To_Lower (I.Names (J).all); if Set = Mixed_Case then I.Names (J).all (I.Names (J).all'First) := To_Upper (I.Names (J).all (I.Names (J).all'First)); end if; end if; J := J + 1; end loop; return Create (I, True); end Create; function Value (Fld : Field; Buf : Buffer_Number := Buffer_Number'First) return T is begin return T'Value (Get_Buffer (Fld, Buf)); end Value; end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-user-choice.adb0000644000175100001440000001225712340207631026613 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.User.Choice -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.20 $ -- $Date: 2014/05/24 21:31:05 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System.Address_To_Access_Conversions; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is package Argument_Conversions is new System.Address_To_Access_Conversions (Argument); function Generic_Next (Fld : Field; Usr : System.Address) return Curses_Bool is Result : Boolean; Udf : constant User_Defined_Field_Type_With_Choice_Access := User_Defined_Field_Type_With_Choice_Access (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ); begin Result := Next (Fld, Udf.all); return Curses_Bool (Boolean'Pos (Result)); end Generic_Next; function Generic_Prev (Fld : Field; Usr : System.Address) return Curses_Bool is Result : Boolean; Udf : constant User_Defined_Field_Type_With_Choice_Access := User_Defined_Field_Type_With_Choice_Access (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ); begin Result := Previous (Fld, Udf.all); return Curses_Bool (Boolean'Pos (Result)); end Generic_Prev; -- ----------------------------------------------------------------------- -- function C_Generic_Choice return C_Field_Type is Res : Eti_Error; T : C_Field_Type; begin if M_Generic_Choice = Null_Field_Type then T := New_Fieldtype (Generic_Field_Check'Access, Generic_Char_Check'Access); if T = Null_Field_Type then raise Form_Exception; else Res := Set_Fieldtype_Arg (T, Make_Arg'Access, Copy_Arg'Access, Free_Arg'Access); Eti_Exception (Res); Res := Set_Fieldtype_Choice (T, Generic_Next'Access, Generic_Prev'Access); Eti_Exception (Res); end if; M_Generic_Choice := T; end if; pragma Assert (M_Generic_Choice /= Null_Field_Type); return M_Generic_Choice; end C_Generic_Choice; end Terminal_Interface.Curses.Forms.Field_Types.User.Choice; AdaCurses-20170708/src/c_varargs_to_ada.h0000644000175100001440000000655012560764377016622 0ustar tomusers/**************************************************************************** * Copyright (c) 2011,2015 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. * ****************************************************************************/ /* $Id: c_varargs_to_ada.h,v 1.4 2015/08/06 23:08:47 tom Exp $ */ #ifndef __C_VARARGS_TO_ADA_H #define __C_VARARGS_TO_ADA_H #ifdef HAVE_CONFIG_H #include #else #include #endif #include #include extern int set_field_type_alnum(FIELD * /* field */ , int /* minimum_width */ ); extern int set_field_type_alpha(FIELD * /* field */ , int /* minimum_width */ ); extern int set_field_type_enum(FIELD * /* field */ , char ** /* value_list */ , int /* case_sensitive */ , int /* unique_match */ ); extern int set_field_type_integer(FIELD * /* field */ , int /* precision */ , long /* minimum */ , long /* maximum */ ); extern int set_field_type_numeric(FIELD * /* field */ , int /* precision */ , double /* minimum */ , double /* maximum */ ); extern int set_field_type_regexp(FIELD * /* field */ , char * /* regular_expression */ ); extern int set_field_type_ipv4(FIELD * /* field */ ); extern int set_field_type_user(FIELD * /* field */ , FIELDTYPE * /* fieldtype */ , void * /* arg */ ); extern void *void_star_make_arg(va_list * /* list */ ); #ifdef TRACE extern void _traces(const char * /* fmt */ ,char * /* arg */ ); #endif #endif /* __C_VARARGS_TO_ADA_H */ AdaCurses-20170708/src/c_threaded_variables.h0000644000175100001440000000536012560764473017451 0ustar tomusers/**************************************************************************** * Copyright (c) 2011-2014,2015 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. * ****************************************************************************/ /* $Id: c_threaded_variables.h,v 1.3 2015/08/06 23:09:47 tom Exp $ */ #ifndef __C_THREADED_VARIABLES_H #define __C_THREADED_VARIABLES_H #include #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #include extern WINDOW *stdscr_as_function(void); extern WINDOW *curscr_as_function(void); extern int LINES_as_function(void); extern int LINES_as_function(void); extern int COLS_as_function(void); extern int TABSIZE_as_function(void); extern int COLORS_as_function(void); extern int COLOR_PAIRS_as_function(void); extern chtype acs_map_as_function(char /* index */ ); #endif /* __C_THREADED_VARIABLES_H */ AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-alpha.adb0000644000175100001440000000700412340207631025464 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.Alpha -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.13 $ -- $Date: 2014/05/24 21:31:05 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.Alpha is procedure Set_Field_Type (Fld : Field; Typ : Alpha_Field) is function Set_Fld_Type (F : Field := Fld; Arg1 : C_Int) return Eti_Error; pragma Import (C, Set_Fld_Type, "set_field_type_alpha"); begin Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width))); Wrap_Builtin (Fld, Typ); end Set_Field_Type; end Terminal_Interface.Curses.Forms.Field_Types.Alpha; AdaCurses-20170708/src/c_threaded_variables.c0000644000175100001440000000537312340210232017417 0ustar tomusers/**************************************************************************** * Copyright (c) 2011,2014 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: Nicolas Boulenguez, 2011 * ****************************************************************************/ #include "c_threaded_variables.h" #define WRAP(type, name) \ type \ name ## _as_function () \ { \ return name; \ } /* *INDENT-OFF* */ WRAP(WINDOW *, stdscr) WRAP(WINDOW *, curscr) WRAP(int, LINES) WRAP(int, COLS) WRAP(int, TABSIZE) WRAP(int, COLORS) WRAP(int, COLOR_PAIRS) chtype acs_map_as_function(char inx) { return acs_map[(unsigned char) inx]; } /* *INDENT-ON* */ AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-ipv4_address.ads0000644000175100001440000000646311315445666027034 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address); type Internet_V4_Address_Field is new Field_Type with null record; procedure Set_Field_Type (Fld : Field; Typ : Internet_V4_Address_Field); pragma Inline (Set_Field_Type); end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address; AdaCurses-20170708/src/terminal_interface-curses-text_io.ads0000644000175100001440000001365711315445471022464 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.14 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Ada.IO_Exceptions; package Terminal_Interface.Curses.Text_IO is use type Ada.Text_IO.Count; subtype Count is Ada.Text_IO.Count; subtype Positive_Count is Count range 1 .. Count'Last; subtype Field is Ada.Text_IO.Field; subtype Number_Base is Integer range 2 .. 16; type Type_Set is (Lower_Case, Upper_Case, Mixed_Case); -- For most of the routines you will see a version without a Window -- type parameter. They will operate on a default window, which can -- be set by the user. It is initially equal to Standard_Window. procedure Set_Window (Win : Window); -- Set Win as the default window function Get_Window return Window; -- Get the current default window procedure Flush (Win : Window); procedure Flush; -------------------------------------------- -- Specification of line and page lengths -- -------------------------------------------- -- There are no set routines in this package. I assume, that you allocate -- the window with an appropriate size. -- A scroll-window is interpreted as an page with unbounded page length, -- i.e. it returns the conventional 0 as page length. function Line_Length (Win : Window) return Count; function Line_Length return Count; function Page_Length (Win : Window) return Count; function Page_Length return Count; ------------------------------------ -- Column, Line, and Page Control -- ------------------------------------ procedure New_Line (Win : Window; Spacing : Positive_Count := 1); procedure New_Line (Spacing : Positive_Count := 1); procedure New_Page (Win : Window); procedure New_Page; procedure Set_Col (Win : Window; To : Positive_Count); procedure Set_Col (To : Positive_Count); procedure Set_Line (Win : Window; To : Positive_Count); procedure Set_Line (To : Positive_Count); function Col (Win : Window) return Positive_Count; function Col return Positive_Count; function Line (Win : Window) return Positive_Count; function Line return Positive_Count; ----------------------- -- Characters-Output -- ----------------------- procedure Put (Win : Window; Item : Character); procedure Put (Item : Character); -------------------- -- Strings-Output -- -------------------- procedure Put (Win : Window; Item : String); procedure Put (Item : String); procedure Put_Line (Win : Window; Item : String); procedure Put_Line (Item : String); -- Exceptions Status_Error : exception renames Ada.IO_Exceptions.Status_Error; Mode_Error : exception renames Ada.IO_Exceptions.Mode_Error; Name_Error : exception renames Ada.IO_Exceptions.Name_Error; Use_Error : exception renames Ada.IO_Exceptions.Use_Error; Device_Error : exception renames Ada.IO_Exceptions.Device_Error; End_Error : exception renames Ada.IO_Exceptions.End_Error; Data_Error : exception renames Ada.IO_Exceptions.Data_Error; Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error; end Terminal_Interface.Curses.Text_IO; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-user.ads0000644000175100001440000001221611541120451025373 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.User -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2011 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, 1996 -- Version Control: -- $Revision: 1.15 $ -- $Date: 2011/03/19 12:27:21 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; package Terminal_Interface.Curses.Forms.Field_Types.User is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.User); subtype C_Int is Interfaces.C.int; type User_Defined_Field_Type is abstract new Field_Type with null record; -- This is the root of the mechanism we use to create field types in -- Ada95. You should your own type derive from this one and implement -- the Field_Check and Character_Check functions for your own type. type User_Defined_Field_Type_Access is access all User_Defined_Field_Type'Class; function Field_Check (Fld : Field; Typ : User_Defined_Field_Type) return Boolean is abstract; -- If True is returned, the field is considered valid, otherwise it is -- invalid. function Character_Check (Ch : Character; Typ : User_Defined_Field_Type) return Boolean is abstract; -- If True is returned, the character is considered as valid for the -- field, otherwise as invalid. procedure Set_Field_Type (Fld : Field; Typ : User_Defined_Field_Type); -- This should work for all types derived from User_Defined_Field_Type. -- No need to reimplement it for your derived type. -- +---------------------------------------------------------------------- -- | Private Part. -- | Used by the Choice child package. private function C_Generic_Type return C_Field_Type; function Generic_Field_Check (Fld : Field; Usr : System.Address) return Curses_Bool; pragma Convention (C, Generic_Field_Check); -- This is the generic Field_Check_Function for the low-level fieldtype -- representing all the User_Defined_Field_Type derivatives. It routes -- the call to the Field_Check implementation for the type. function Generic_Char_Check (Ch : C_Int; Usr : System.Address) return Curses_Bool; pragma Convention (C, Generic_Char_Check); -- This is the generic Char_Check_Function for the low-level fieldtype -- representing all the User_Defined_Field_Type derivatives. It routes -- the call to the Character_Check implementation for the type. end Terminal_Interface.Curses.Forms.Field_Types.User; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-alpha.ads0000644000175100001440000000647111315445666025531 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.Alpha -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.Alpha is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Alpha); type Alpha_Field is new Field_Type with record Minimum_Field_Width : Natural := 0; end record; procedure Set_Field_Type (Fld : Field; Typ : Alpha_Field); pragma Inline (Set_Field_Type); end Terminal_Interface.Curses.Forms.Field_Types.Alpha; AdaCurses-20170708/src/terminal_interface-curses-text_io-fixed_io.adb0000644000175100001440000000742311315445471024221 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Fixed_IO -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Terminal_Interface.Curses.Text_IO.Aux; package body Terminal_Interface.Curses.Text_IO.Fixed_IO is package Aux renames Terminal_Interface.Curses.Text_IO.Aux; package FIXIO is new Ada.Text_IO.Fixed_IO (Num); procedure Put (Win : Window; Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is Buf : String (1 .. Field'Last); Len : Field := Fore + 1 + Aft; begin if Exp > 0 then Len := Len + 1 + Exp; end if; FIXIO.Put (Buf, Item, Aft, Exp); Aux.Put_Buf (Win, Buf, Len, False); end Put; procedure Put (Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is begin Put (Get_Window, Item, Fore, Aft, Exp); end Put; end Terminal_Interface.Curses.Text_IO.Fixed_IO; AdaCurses-20170708/src/terminal_interface-curses-text_io-decimal_io.adb0000644000175100001440000000742511315445471024522 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Decimal_IO -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Terminal_Interface.Curses.Text_IO.Aux; package body Terminal_Interface.Curses.Text_IO.Decimal_IO is package Aux renames Terminal_Interface.Curses.Text_IO.Aux; package DIO is new Ada.Text_IO.Decimal_IO (Num); procedure Put (Win : Window; Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is Buf : String (1 .. Field'Last); Len : Field := Fore + 1 + Aft; begin if Exp > 0 then Len := Len + 1 + Exp; end if; DIO.Put (Buf, Item, Aft, Exp); Aux.Put_Buf (Win, Buf, Len, False); end Put; procedure Put (Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is begin Put (Get_Window, Item, Fore, Aft, Exp); end Put; end Terminal_Interface.Curses.Text_IO.Decimal_IO; AdaCurses-20170708/src/ncurses_compat.c0000644000175100001440000001010312560764426016344 0ustar tomusers/**************************************************************************** * Copyright (c) 2011,2015 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 E. Dickey, 2011 * ****************************************************************************/ /* Version Control $Id: ncurses_compat.c,v 1.3 2015/08/06 23:09:10 tom Exp $ --------------------------------------------------------------------------*/ /* * Provide compatibility with older versions of ncurses. */ #include #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #include #if defined(NCURSES_VERSION_PATCH) #if NCURSES_VERSION_PATCH < 20081122 extern bool has_mouse(void); extern int _nc_has_mouse(void); bool has_mouse(void) { return (bool)_nc_has_mouse(); } #endif /* * These are provided by lib_gen.c: */ #if NCURSES_VERSION_PATCH < 20070331 extern bool (is_keypad) (const WINDOW *); extern bool (is_scrollok) (const WINDOW *); bool is_keypad(const WINDOW *win) { return ((win)->_use_keypad); } bool (is_scrollok) (const WINDOW *win) { return ((win)->_scroll); } #endif #if NCURSES_VERSION_PATCH < 20060107 extern int (getbegx) (WINDOW *); extern int (getbegy) (WINDOW *); extern int (getcurx) (WINDOW *); extern int (getcury) (WINDOW *); extern int (getmaxx) (WINDOW *); extern int (getmaxy) (WINDOW *); extern int (getparx) (WINDOW *); extern int (getpary) (WINDOW *); int (getbegy) (WINDOW *win) { return ((win) ? (win)->_begy : ERR); } int (getbegx) (WINDOW *win) { return ((win) ? (win)->_begx : ERR); } int (getcury) (WINDOW *win) { return ((win) ? (win)->_cury : ERR); } int (getcurx) (WINDOW *win) { return ((win) ? (win)->_curx : ERR); } int (getmaxy) (WINDOW *win) { return ((win) ? ((win)->_maxy + 1) : ERR); } int (getmaxx) (WINDOW *win) { return ((win) ? ((win)->_maxx + 1) : ERR); } int (getpary) (WINDOW *win) { return ((win) ? (win)->_pary : ERR); } int (getparx) (WINDOW *win) { return ((win) ? (win)->_parx : ERR); } #endif #endif AdaCurses-20170708/src/terminal_interface-curses-panels.adb0000644000175100001440000001416211315445062022236 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Panels -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2004,2009 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, 1996 -- Version Control: -- $Revision: 1.14 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Interfaces.C; package body Terminal_Interface.Curses.Panels is use type Interfaces.C.int; function Create (Win : Window) return Panel is function Newpanel (Win : Window) return Panel; pragma Import (C, Newpanel, "new_panel"); Pan : Panel; begin Pan := Newpanel (Win); if Pan = Null_Panel then raise Panel_Exception; end if; return Pan; end Create; procedure Bottom (Pan : Panel) is function Bottompanel (Pan : Panel) return C_Int; pragma Import (C, Bottompanel, "bottom_panel"); begin if Bottompanel (Pan) = Curses_Err then raise Panel_Exception; end if; end Bottom; procedure Top (Pan : Panel) is function Toppanel (Pan : Panel) return C_Int; pragma Import (C, Toppanel, "top_panel"); begin if Toppanel (Pan) = Curses_Err then raise Panel_Exception; end if; end Top; procedure Show (Pan : Panel) is function Showpanel (Pan : Panel) return C_Int; pragma Import (C, Showpanel, "show_panel"); begin if Showpanel (Pan) = Curses_Err then raise Panel_Exception; end if; end Show; procedure Hide (Pan : Panel) is function Hidepanel (Pan : Panel) return C_Int; pragma Import (C, Hidepanel, "hide_panel"); begin if Hidepanel (Pan) = Curses_Err then raise Panel_Exception; end if; end Hide; function Get_Window (Pan : Panel) return Window is function Panel_Win (Pan : Panel) return Window; pragma Import (C, Panel_Win, "panel_window"); Win : constant Window := Panel_Win (Pan); begin if Win = Null_Window then raise Panel_Exception; end if; return Win; end Get_Window; procedure Replace (Pan : Panel; Win : Window) is function Replace_Pan (Pan : Panel; Win : Window) return C_Int; pragma Import (C, Replace_Pan, "replace_panel"); begin if Replace_Pan (Pan, Win) = Curses_Err then raise Panel_Exception; end if; end Replace; procedure Move (Pan : Panel; Line : Line_Position; Column : Column_Position) is function Move (Pan : Panel; Line : C_Int; Column : C_Int) return C_Int; pragma Import (C, Move, "move_panel"); begin if Move (Pan, C_Int (Line), C_Int (Column)) = Curses_Err then raise Panel_Exception; end if; end Move; function Is_Hidden (Pan : Panel) return Boolean is function Panel_Hidden (Pan : Panel) return C_Int; pragma Import (C, Panel_Hidden, "panel_hidden"); begin if Panel_Hidden (Pan) = Curses_False then return False; else return True; end if; end Is_Hidden; procedure Delete (Pan : in out Panel) is function Del_Panel (Pan : Panel) return C_Int; pragma Import (C, Del_Panel, "del_panel"); begin if Del_Panel (Pan) = Curses_Err then raise Panel_Exception; end if; Pan := Null_Panel; end Delete; end Terminal_Interface.Curses.Panels; AdaCurses-20170708/src/terminal_interface-curses-text_io-aux.ads0000644000175100001440000000700111315445062023235 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Aux -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2006,2009 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, 1996 -- Version Control: -- $Revision: 1.14 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ private package Terminal_Interface.Curses.Text_IO.Aux is -- pragma Preelaborate (Aux); -- This routine is called from the Text_IO output routines for numeric -- and enumeration types. -- procedure Put_Buf (Win : Window; -- The output window Buf : String; -- The buffer containing the text Width : Field; -- The width of the output field Signal : Boolean := True; -- If true, we raise Layout_Error Ljust : Boolean := False); -- The Buf is left justified end Terminal_Interface.Curses.Text_IO.Aux; AdaCurses-20170708/src/terminal_interface-curses-text_io-integer_io.ads0000644000175100001440000000660411315445471024600 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Integer_IO -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type Num is range <>; package Terminal_Interface.Curses.Text_IO.Integer_IO is Default_Width : Field := Num'Width; Default_Base : Number_Base := 10; procedure Put (Win : Window; Item : Num; Width : Field := Default_Width; Base : Number_Base := Default_Base); procedure Put (Item : Num; Width : Field := Default_Width; Base : Number_Base := Default_Base); private pragma Inline (Put); end Terminal_Interface.Curses.Text_IO.Integer_IO; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-enumeration.ads0000644000175100001440000001211511315445666026762 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.Enumeration -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C.Strings; package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Enumeration); type String_Access is access String; -- Type_Set is used by the child package Ada type Type_Set is (Lower_Case, Upper_Case, Mixed_Case); type Enum_Array is array (Positive range <>) of String_Access; type Enumeration_Info (C : Positive) is record Names : Enum_Array (1 .. C); Case_Sensitive : Boolean := False; Match_Must_Be_Unique : Boolean := False; end record; type Enumeration_Field is new Field_Type with private; function Create (Info : Enumeration_Info; Auto_Release_Names : Boolean := False) return Enumeration_Field; -- Make an fieldtype from the info. Enumerations are special, because -- they normally don't copy the enum values into a private store, so -- we have to care for the lifetime of the info we provide. -- The Auto_Release_Names flag may be used to automatically releases -- the strings in the Names array of the Enumeration_Info. function Make_Enumeration_Type (Info : Enumeration_Info; Auto_Release_Names : Boolean := False) return Enumeration_Field renames Create; procedure Release (Enum : in out Enumeration_Field); -- But we may want to release the field to release the memory allocated -- by it internally. After that the Enumeration field is no longer usable. -- The next type defintions are all ncurses extensions. They are typically -- not available in other curses implementations. procedure Set_Field_Type (Fld : Field; Typ : Enumeration_Field); pragma Inline (Set_Field_Type); private type CPA_Access is access Interfaces.C.Strings.chars_ptr_array; type Enumeration_Field is new Field_Type with record Case_Sensitive : Boolean := False; Match_Must_Be_Unique : Boolean := False; Arr : CPA_Access := null; end record; end Terminal_Interface.Curses.Forms.Field_Types.Enumeration; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-intfield.ads0000644000175100001440000000657411315445666026246 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.IntField -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.IntField is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.IntField); type Integer_Field is new Field_Type with record Precision : Natural; Lower_Limit : Integer; Upper_Limit : Integer; end record; procedure Set_Field_Type (Fld : Field; Typ : Integer_Field); pragma Inline (Set_Field_Type); end Terminal_Interface.Curses.Forms.Field_Types.IntField; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types.adb0000644000175100001440000002532312405112137024403 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.28 $ -- $Date: 2014/09/13 19:00:47 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Ada.Unchecked_Deallocation; with System.Address_To_Access_Conversions; -- | -- |===================================================================== -- | man page form_fieldtype.3x -- |===================================================================== -- | package body Terminal_Interface.Curses.Forms.Field_Types is use type System.Address; package Argument_Conversions is new System.Address_To_Access_Conversions (Argument); function Get_Fieldtype (F : Field) return C_Field_Type; pragma Import (C, Get_Fieldtype, "field_type"); function Get_Arg (F : Field) return System.Address; pragma Import (C, Get_Arg, "field_arg"); -- | -- |===================================================================== -- | man page form_field_validation.3x -- |===================================================================== -- | -- | -- | function Get_Type (Fld : Field) return Field_Type_Access is Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); Arg : Argument_Access; begin if Low_Level = Null_Field_Type then return null; else if Low_Level = M_Builtin_Router or else Low_Level = M_Generic_Type or else Low_Level = M_Choice_Router or else Low_Level = M_Generic_Choice then Arg := Argument_Access (Argument_Conversions.To_Pointer (Get_Arg (Fld))); if Arg = null then raise Form_Exception; else return Arg.all.Typ; end if; else raise Form_Exception; end if; end if; end Get_Type; function Copy_Arg (Usr : System.Address) return System.Address is begin return Usr; end Copy_Arg; procedure Free_Arg (Usr : System.Address) is procedure Free_Type is new Ada.Unchecked_Deallocation (Field_Type'Class, Field_Type_Access); procedure Freeargs is new Ada.Unchecked_Deallocation (Argument, Argument_Access); To_Be_Free : Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); Low_Level : C_Field_Type; begin if To_Be_Free /= null then if To_Be_Free.all.Usr /= System.Null_Address then Low_Level := To_Be_Free.all.Cft; if Low_Level.all.Freearg /= null then Low_Level.all.Freearg (To_Be_Free.all.Usr); end if; end if; if To_Be_Free.all.Typ /= null then Free_Type (To_Be_Free.all.Typ); end if; Freeargs (To_Be_Free); end if; end Free_Arg; procedure Wrap_Builtin (Fld : Field; Typ : Field_Type'Class; Cft : C_Field_Type := C_Builtin_Router) is Usr_Arg : constant System.Address := Get_Arg (Fld); Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); Arg : Argument_Access; function Set_Fld_Type (F : Field := Fld; Cf : C_Field_Type := Cft; Arg1 : Argument_Access) return Eti_Error; pragma Import (C, Set_Fld_Type, "set_field_type_user"); begin pragma Assert (Low_Level /= Null_Field_Type); if Cft /= C_Builtin_Router and then Cft /= C_Choice_Router then raise Form_Exception; else Arg := new Argument'(Usr => System.Null_Address, Typ => new Field_Type'Class'(Typ), Cft => Get_Fieldtype (Fld)); if Usr_Arg /= System.Null_Address then if Low_Level.all.Copyarg /= null then Arg.all.Usr := Low_Level.all.Copyarg (Usr_Arg); else Arg.all.Usr := Usr_Arg; end if; end if; Eti_Exception (Set_Fld_Type (Arg1 => Arg)); end if; end Wrap_Builtin; function Field_Check_Router (Fld : Field; Usr : System.Address) return Curses_Bool is Arg : constant Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type and then Arg.all.Typ /= null); if Arg.all.Cft.all.Fcheck /= null then return Arg.all.Cft.all.Fcheck (Fld, Arg.all.Usr); else return 1; end if; end Field_Check_Router; function Char_Check_Router (Ch : C_Int; Usr : System.Address) return Curses_Bool is Arg : constant Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type and then Arg.all.Typ /= null); if Arg.all.Cft.all.Ccheck /= null then return Arg.all.Cft.all.Ccheck (Ch, Arg.all.Usr); else return 1; end if; end Char_Check_Router; function Next_Router (Fld : Field; Usr : System.Address) return Curses_Bool is Arg : constant Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type and then Arg.all.Typ /= null); if Arg.all.Cft.all.Next /= null then return Arg.all.Cft.all.Next (Fld, Arg.all.Usr); else return 1; end if; end Next_Router; function Prev_Router (Fld : Field; Usr : System.Address) return Curses_Bool is Arg : constant Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type and then Arg.all.Typ /= null); if Arg.all.Cft.all.Prev /= null then return Arg.all.Cft.all.Prev (Fld, Arg.all.Usr); else return 1; end if; end Prev_Router; -- ----------------------------------------------------------------------- -- function C_Builtin_Router return C_Field_Type is T : C_Field_Type; begin if M_Builtin_Router = Null_Field_Type then T := New_Fieldtype (Field_Check_Router'Access, Char_Check_Router'Access); if T = Null_Field_Type then raise Form_Exception; else Eti_Exception (Set_Fieldtype_Arg (T, Make_Arg'Access, Copy_Arg'Access, Free_Arg'Access)); end if; M_Builtin_Router := T; end if; pragma Assert (M_Builtin_Router /= Null_Field_Type); return M_Builtin_Router; end C_Builtin_Router; -- ----------------------------------------------------------------------- -- function C_Choice_Router return C_Field_Type is T : C_Field_Type; begin if M_Choice_Router = Null_Field_Type then T := New_Fieldtype (Field_Check_Router'Access, Char_Check_Router'Access); if T = Null_Field_Type then raise Form_Exception; else Eti_Exception (Set_Fieldtype_Arg (T, Make_Arg'Access, Copy_Arg'Access, Free_Arg'Access)); Eti_Exception (Set_Fieldtype_Choice (T, Next_Router'Access, Prev_Router'Access)); end if; M_Choice_Router := T; end if; pragma Assert (M_Choice_Router /= Null_Field_Type); return M_Choice_Router; end C_Choice_Router; end Terminal_Interface.Curses.Forms.Field_Types; AdaCurses-20170708/src/terminal_interface-curses-text_io-fixed_io.ads0000644000175100001440000000671111315445471024241 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Fixed_IO -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type Num is delta <>; package Terminal_Interface.Curses.Text_IO.Fixed_IO is Default_Fore : Field := Num'Fore; Default_Aft : Field := Num'Aft; Default_Exp : Field := 0; procedure Put (Win : Window; Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); procedure Put (Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); private pragma Inline (Put); end Terminal_Interface.Curses.Text_IO.Fixed_IO; AdaCurses-20170708/src/terminal_interface-curses-text_io-aux.adb0000644000175100001440000001242411315445062023221 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Aux -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2006,2009 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, 1996 -- Version Control: -- $Revision: 1.13 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package body Terminal_Interface.Curses.Text_IO.Aux is procedure Put_Buf (Win : Window; Buf : String; Width : Field; Signal : Boolean := True; Ljust : Boolean := False) is L : Field; Len : Field; W : Field := Width; LC : Line_Count; CC : Column_Count; Y : Line_Position; X : Column_Position; procedure Output (From, To : Field); procedure Output (From, To : Field) is begin if Len > 0 then if W = 0 then W := Len; end if; if Len > W then -- LRM A10.6 (7) says this W := Len; end if; pragma Assert (Len <= W); Get_Size (Win, LC, CC); if Column_Count (Len) > CC then if Signal then raise Layout_Error; else return; end if; else if Len < W and then not Ljust then declare Filler : constant String (1 .. (W - Len)) := (others => ' '); begin Put (Win, Filler); end; end if; Get_Cursor_Position (Win, Y, X); if (X + Column_Position (Len)) > CC then New_Line (Win); end if; Put (Win, Buf (From .. To)); if Len < W and then Ljust then declare Filler : constant String (1 .. (W - Len)) := (others => ' '); begin Put (Win, Filler); end; end if; end if; end if; end Output; begin pragma Assert (Win /= Null_Window); if Ljust then L := 1; for I in 1 .. Buf'Length loop exit when Buf (L) = ' '; L := L + 1; end loop; Len := L - 1; Output (1, Len); else -- input buffer is not left justified L := Buf'Length; for I in 1 .. Buf'Length loop exit when Buf (L) = ' '; L := L - 1; end loop; Len := Buf'Length - L; Output (L + 1, Buf'Length); end if; end Put_Buf; end Terminal_Interface.Curses.Text_IO.Aux; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads0000644000175100001440000000723007746514446027515 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control: -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type T is (<>); package Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada); function Create (Set : Type_Set := Mixed_Case; Case_Sensitive : Boolean := False; Must_Be_Unique : Boolean := False) return Enumeration_Field; function Value (Fld : Field; Buf : Buffer_Number := Buffer_Number'First) return T; -- Translate the content of the fields buffer - indicated by the -- buffer number - into an enumeration value. If the buffer is empty -- or the content is invalid, a Constraint_Error is raises. end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada; AdaCurses-20170708/src/terminal_interface-curses-forms-field_types-ipv4_address.adb0000644000175100001440000000674412340207631027000 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.13 $ -- $Date: 2014/05/24 21:31:05 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is procedure Set_Field_Type (Fld : Field; Typ : Internet_V4_Address_Field) is function Set_Fld_Type (F : Field := Fld) return Eti_Error; pragma Import (C, Set_Fld_Type, "set_field_type_ipv4"); begin Eti_Exception (Set_Fld_Type); Wrap_Builtin (Fld, Typ); end Set_Field_Type; end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address; AdaCurses-20170708/src/terminal_interface-curses-mouse.adb0000644000175100001440000002037512405113232022077 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Mouse -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2014 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, 1996 -- Version Control: -- $Revision: 1.25 $ -- $Date: 2014/09/13 19:10:18 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Interfaces.C; use Interfaces.C; use Interfaces; package body Terminal_Interface.Curses.Mouse is use type System.Bit_Order; function Has_Mouse return Boolean is function Mouse_Avail return C_Int; pragma Import (C, Mouse_Avail, "has_mouse"); begin if Has_Key (Key_Mouse) or else Mouse_Avail /= 0 then return True; else return False; end if; end Has_Mouse; function Get_Mouse return Mouse_Event is type Event_Access is access all Mouse_Event; function Getmouse (Ev : Event_Access) return C_Int; pragma Import (C, Getmouse, "getmouse"); Event : aliased Mouse_Event; begin if Getmouse (Event'Access) = Curses_Err then raise Curses_Exception; end if; return Event; end Get_Mouse; procedure Register_Reportable_Event (Button : Mouse_Button; State : Button_State; Mask : in out Event_Mask) is Button_Nr : constant Natural := Mouse_Button'Pos (Button); State_Nr : constant Natural := Button_State'Pos (State); begin if Button in Modifier_Keys and then State /= Pressed then raise Curses_Exception; else if Button in Real_Buttons then Mask := Mask or ((2 ** (6 * Button_Nr)) ** State_Nr); else Mask := Mask or (BUTTON_CTRL ** (Button_Nr - 4)); end if; end if; end Register_Reportable_Event; procedure Register_Reportable_Events (Button : Mouse_Button; State : Button_States; Mask : in out Event_Mask) is begin for S in Button_States'Range loop if State (S) then Register_Reportable_Event (Button, S, Mask); end if; end loop; end Register_Reportable_Events; function Start_Mouse (Mask : Event_Mask := All_Events) return Event_Mask is function MMask (M : Event_Mask; O : access Event_Mask) return Event_Mask; pragma Import (C, MMask, "mousemask"); R : Event_Mask; Old : aliased Event_Mask; begin R := MMask (Mask, Old'Access); if R = No_Events then Beep; end if; return Old; end Start_Mouse; procedure End_Mouse (Mask : Event_Mask := No_Events) is begin if Mask /= No_Events then Beep; end if; end End_Mouse; procedure Dispatch_Event (Mask : Event_Mask; Button : out Mouse_Button; State : out Button_State); procedure Dispatch_Event (Mask : Event_Mask; Button : out Mouse_Button; State : out Button_State) is L : Event_Mask; begin Button := Alt; -- preset to non real button; if (Mask and BUTTON1_EVENTS) /= 0 then Button := Left; elsif (Mask and BUTTON2_EVENTS) /= 0 then Button := Middle; elsif (Mask and BUTTON3_EVENTS) /= 0 then Button := Right; elsif (Mask and BUTTON4_EVENTS) /= 0 then Button := Button4; end if; if Button in Real_Buttons then L := 2 ** (6 * Mouse_Button'Pos (Button)); for I in Button_State'Range loop if (Mask and L) /= 0 then State := I; exit; end if; L := 2 * L; end loop; else State := Pressed; if (Mask and BUTTON_CTRL) /= 0 then Button := Control; elsif (Mask and BUTTON_SHIFT) /= 0 then Button := Shift; elsif (Mask and BUTTON_ALT) /= 0 then Button := Alt; end if; end if; end Dispatch_Event; procedure Get_Event (Event : Mouse_Event; Y : out Line_Position; X : out Column_Position; Button : out Mouse_Button; State : out Button_State) is Mask : constant Event_Mask := Event.Bstate; begin X := Column_Position (Event.X); Y := Line_Position (Event.Y); Dispatch_Event (Mask, Button, State); end Get_Event; procedure Unget_Mouse (Event : Mouse_Event) is function Ungetmouse (Ev : Mouse_Event) return C_Int; pragma Import (C, Ungetmouse, "ungetmouse"); begin if Ungetmouse (Event) = Curses_Err then raise Curses_Exception; end if; end Unget_Mouse; function Enclosed_In_Window (Win : Window := Standard_Window; Event : Mouse_Event) return Boolean is function Wenclose (Win : Window; Y : C_Int; X : C_Int) return Curses_Bool; pragma Import (C, Wenclose, "wenclose"); begin if Wenclose (Win, C_Int (Event.Y), C_Int (Event.X)) = Curses_Bool_False then return False; else return True; end if; end Enclosed_In_Window; function Mouse_Interval (Msec : Natural := 200) return Natural is function Mouseinterval (Msec : C_Int) return C_Int; pragma Import (C, Mouseinterval, "mouseinterval"); begin return Natural (Mouseinterval (C_Int (Msec))); end Mouse_Interval; end Terminal_Interface.Curses.Mouse; AdaCurses-20170708/src/modules0000644000175100001440000000774111411507072014546 0ustar tomusers# $Id: modules,v 1.3 2010/06/26 23:33:14 tom Exp $ ############################################################################## # Copyright (c) 2010 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 E. Dickey 2010 # # Library objects # rootname depend-spec depend-body unit $(ALIB) $(srcdir) none spec $(ABASE)-aux none $(srcdir) body $(ABASE) none . body $(ABASE)-terminfo $(srcdir) $(srcdir) body $(ABASE)-termcap $(srcdir) $(srcdir) body $(ABASE)-putwin $(srcdir) $(srcdir) body $(ABASE)-trace . . body $(ABASE)-mouse . $(srcdir) body $(ABASE)-panels . $(srcdir) body $(ABASE)-menus . $(srcdir) body $(ABASE)-forms . $(srcdir) body $(ABASE)-forms-field_types . $(srcdir) body $(ABASE)-forms-field_types-alpha $(srcdir) $(srcdir) body $(ABASE)-forms-field_types-alphanumeric $(srcdir) $(srcdir) body $(ABASE)-forms-field_types-intfield $(srcdir) $(srcdir) body $(ABASE)-forms-field_types-numeric $(srcdir) $(srcdir) body $(ABASE)-forms-field_types-regexp $(srcdir) $(srcdir) body $(ABASE)-forms-field_types-enumeration $(srcdir) $(srcdir) body $(ABASE)-forms-field_types-ipv4_address $(srcdir) $(srcdir) body $(ABASE)-forms-field_types-user $(srcdir) $(srcdir) body $(ABASE)-forms-field_types-user-choice $(srcdir) $(srcdir) body $(ABASE)-text_io $(srcdir) $(srcdir) body $(ABASE)-text_io-aux $(srcdir) $(srcdir) body $(ABASE)-menus-menu_user_data . $(srcdir) body $(ABASE)-menus-item_user_data . $(srcdir) body $(ABASE)-forms-form_user_data . $(srcdir) body $(ABASE)-forms-field_user_data . $(srcdir) body $(ABASE)-forms-field_types-enumeration-ada $(srcdir) $(srcdir) body $(ABASE)-panels-user_data . $(srcdir) body $(ABASE)-text_io-integer_io $(srcdir) $(srcdir) body $(ABASE)-text_io-float_io $(srcdir) $(srcdir) body $(ABASE)-text_io-fixed_io $(srcdir) $(srcdir) body $(ABASE)-text_io-decimal_io $(srcdir) $(srcdir) body $(ABASE)-text_io-enumeration_io $(srcdir) $(srcdir) body $(ABASE)-text_io-modular_io $(srcdir) $(srcdir) body $(ABASE)-text_io-complex_io $(srcdir) $(srcdir) body AdaCurses-20170708/src/terminal_interface-curses-text_io.adb0000644000175100001440000002304512340207742022427 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control: -- $Revision: 1.22 $ -- $Date: 2014/05/24 21:32:18 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package body Terminal_Interface.Curses.Text_IO is Default_Window : Window := Null_Window; procedure Set_Window (Win : Window) is begin Default_Window := Win; end Set_Window; function Get_Window return Window is begin if Default_Window = Null_Window then return Standard_Window; else return Default_Window; end if; end Get_Window; pragma Inline (Get_Window); procedure Flush (Win : Window) is begin Refresh (Win); end Flush; procedure Flush is begin Flush (Get_Window); end Flush; -------------------------------------------- -- Specification of line and page lengths -- -------------------------------------------- -- There are no set routines in this package. I assume, that you allocate -- the window with an appropriate size. -- A scroll-window is interpreted as an page with unbounded page length, -- i.e. it returns the conventional 0 as page length. function Line_Length (Win : Window) return Count is N_Lines : Line_Count; N_Cols : Column_Count; begin Get_Size (Win, N_Lines, N_Cols); -- if Natural (N_Cols) > Natural (Count'Last) then -- raise Layout_Error; -- end if; return Count (N_Cols); end Line_Length; function Line_Length return Count is begin return Line_Length (Get_Window); end Line_Length; function Page_Length (Win : Window) return Count is N_Lines : Line_Count; N_Cols : Column_Count; begin if Scrolling_Allowed (Win) then return 0; else Get_Size (Win, N_Lines, N_Cols); -- if Natural (N_Lines) > Natural (Count'Last) then -- raise Layout_Error; -- end if; return Count (N_Lines); end if; end Page_Length; function Page_Length return Count is begin return Page_Length (Get_Window); end Page_Length; ------------------------------------ -- Column, Line, and Page Control -- ------------------------------------ procedure New_Line (Win : Window; Spacing : Positive_Count := 1) is P_Size : constant Count := Page_Length (Win); begin if not Spacing'Valid then raise Constraint_Error; end if; for I in 1 .. Spacing loop if P_Size > 0 and then Line (Win) >= P_Size then New_Page (Win); else Add (Win, ASCII.LF); end if; end loop; end New_Line; procedure New_Line (Spacing : Positive_Count := 1) is begin New_Line (Get_Window, Spacing); end New_Line; procedure New_Page (Win : Window) is begin Clear (Win); end New_Page; procedure New_Page is begin New_Page (Get_Window); end New_Page; procedure Set_Col (Win : Window; To : Positive_Count) is Y : Line_Position; X1 : Column_Position; X2 : Column_Position; N : Natural; begin if not To'Valid then raise Constraint_Error; end if; Get_Cursor_Position (Win, Y, X1); N := Natural (To); N := N - 1; X2 := Column_Position (N); if X1 > X2 then New_Line (Win, 1); X1 := 0; end if; if X1 < X2 then declare Filler : constant String (Integer (X1) .. (Integer (X2) - 1)) := (others => ' '); begin Put (Win, Filler); end; end if; end Set_Col; procedure Set_Col (To : Positive_Count) is begin Set_Col (Get_Window, To); end Set_Col; procedure Set_Line (Win : Window; To : Positive_Count) is Y1 : Line_Position; Y2 : Line_Position; X : Column_Position; N : Natural; begin if not To'Valid then raise Constraint_Error; end if; Get_Cursor_Position (Win, Y1, X); pragma Warnings (Off, X); -- unreferenced N := Natural (To); N := N - 1; Y2 := Line_Position (N); if Y2 < Y1 then New_Page (Win); Y1 := 0; end if; if Y1 < Y2 then New_Line (Win, Positive_Count (Y2 - Y1)); end if; end Set_Line; procedure Set_Line (To : Positive_Count) is begin Set_Line (Get_Window, To); end Set_Line; function Col (Win : Window) return Positive_Count is Y : Line_Position; X : Column_Position; N : Natural; begin Get_Cursor_Position (Win, Y, X); N := Natural (X); N := N + 1; -- if N > Natural (Count'Last) then -- raise Layout_Error; -- end if; return Positive_Count (N); end Col; function Col return Positive_Count is begin return Col (Get_Window); end Col; function Line (Win : Window) return Positive_Count is Y : Line_Position; X : Column_Position; N : Natural; begin Get_Cursor_Position (Win, Y, X); N := Natural (Y); N := N + 1; -- if N > Natural (Count'Last) then -- raise Layout_Error; -- end if; return Positive_Count (N); end Line; function Line return Positive_Count is begin return Line (Get_Window); end Line; ----------------------- -- Characters Output -- ----------------------- procedure Put (Win : Window; Item : Character) is P_Size : constant Count := Page_Length (Win); Y : Line_Position; X : Column_Position; L : Line_Count; C : Column_Count; begin if P_Size > 0 then Get_Cursor_Position (Win, Y, X); Get_Size (Win, L, C); if (Y + 1) = L and then (X + 1) = C then New_Page (Win); end if; end if; Add (Win, Item); end Put; procedure Put (Item : Character) is begin Put (Get_Window, Item); end Put; -------------------- -- Strings-Output -- -------------------- procedure Put (Win : Window; Item : String) is P_Size : constant Count := Page_Length (Win); Y : Line_Position; X : Column_Position; L : Line_Count; C : Column_Count; begin if P_Size > 0 then Get_Cursor_Position (Win, Y, X); Get_Size (Win, L, C); if (Y + 1) = L and then (X + 1 + Item'Length) >= C then New_Page (Win); end if; end if; Add (Win, Item); end Put; procedure Put (Item : String) is begin Put (Get_Window, Item); end Put; procedure Put_Line (Win : Window; Item : String) is begin Put (Win, Item); New_Line (Win, 1); end Put_Line; procedure Put_Line (Item : String) is begin Put_Line (Get_Window, Item); end Put_Line; end Terminal_Interface.Curses.Text_IO; AdaCurses-20170708/src/terminal_interface-curses-terminfo.ads0000644000175100001440000001025307746514446022635 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Terminfo -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000,2003 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, 1996 -- Version Control: -- $Revision: 1.4 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; package Terminal_Interface.Curses.Terminfo is pragma Preelaborate (Terminal_Interface.Curses.Terminfo); -- |===================================================================== -- | Man page curs_terminfo.3x -- |===================================================================== -- Not implemented: setupterm, setterm, set_curterm, del_curterm, -- restartterm, tparm, putp, vidputs, vidattr, -- mvcur type Terminfo_String is new String; -- | procedure Get_String (Name : String; Value : out Terminfo_String; Result : out Boolean); function Has_String (Name : String) return Boolean; -- AKA: tigetstr() -- | function Get_Flag (Name : String) return Boolean; -- AKA: tigetflag() -- | function Get_Number (Name : String) return Integer; -- AKA: tigetnum() type putctype is access function (c : Interfaces.C.int) return Interfaces.C.int; pragma Convention (C, putctype); -- | procedure Put_String (Str : Terminfo_String; affcnt : Natural := 1; putc : putctype := null); -- AKA: tputs() end Terminal_Interface.Curses.Terminfo; AdaCurses-20170708/aclocal.m40000644000175100001440000035766113054421631014236 0ustar tomusersdnl*************************************************************************** dnl Copyright (c) 2010-2016,2017 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * dnl "Software"), to deal in the Software without restriction, including * dnl without limitation the rights to use, copy, modify, merge, publish, * dnl distribute, distribute with modifications, sublicense, and/or sell * dnl copies of the Software, and to permit persons to whom the Software is * dnl furnished to do so, subject to the following conditions: * dnl * dnl The above copyright notice and this permission notice shall be included * dnl in all copies or substantial portions of the Software. * dnl * dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * dnl * dnl Except as contained in this notice, the name(s) of the above copyright * dnl holders shall not be used in advertising or otherwise to promote the * dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl dnl $Id: aclocal.m4,v 1.118 2017/02/26 00:38:49 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on dnl this file applies to the aggregation of macros and does not affect use of dnl these macros in other applications. dnl dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49 dnl ------------------ dnl Conditionally generate script according to whether we're using a given autoconf. dnl dnl $1 = version to compare against dnl $2 = code to use if AC_ACVERSION is at least as high as $1. dnl $3 = code to use if AC_ACVERSION is older than $1. define([CF_ACVERSION_CHECK], [ ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl ifdef([m4_version_compare], [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], [CF_ACVERSION_COMPARE( AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl dnl --------------------------------------------------------------------------- dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53 dnl -------------------- dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1, dnl MAJOR2, MINOR2, TERNARY2, dnl PRINTABLE2, not FOUND, FOUND) define([CF_ACVERSION_COMPARE], [ifelse(builtin([eval], [$2 < $5]), 1, [ifelse([$8], , ,[$8])], [ifelse([$9], , ,[$9])])])dnl dnl --------------------------------------------------------------------------- dnl CF_ADA_INCLUDE_DIRS version: 8 updated: 2013/10/14 04:24:07 dnl ------------------- dnl Construct the list of include-options for the C programs in the Ada95 dnl binding. AC_DEFUN([CF_ADA_INCLUDE_DIRS], [ ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" if test "$srcdir" != "."; then ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" fi if test "$GCC" != yes; then ACPPFLAGS="$ACPPFLAGS -I\${includedir}" elif test "$includedir" != "/usr/include"; then if test "$includedir" = '${prefix}/include' ; then if test x$prefix != x/usr ; then ACPPFLAGS="$ACPPFLAGS -I\${includedir}" fi else ACPPFLAGS="$ACPPFLAGS -I\${includedir}" fi fi AC_SUBST(ACPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_ADAFLAGS version: 1 updated: 2010/06/19 15:22:18 dnl --------------- dnl Add to $ADAFLAGS, which is substituted into makefile and scripts. AC_DEFUN([CF_ADD_ADAFLAGS],[ ADAFLAGS="$ADAFLAGS $1" AC_SUBST(ADAFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_CFLAGS version: 13 updated: 2017/02/25 18:57:40 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. dnl dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily dnl confused by the quotes (which require backslashes to keep them usable). AC_DEFUN([CF_ADD_CFLAGS], [ cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $1 do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue elif test "${cf_tst_cflags}" = "\"'" ; then CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) ;; esac CF_APPEND_TEXT(cf_new_cppflags,$cf_add_cflags) ;; esac ;; (*) CF_APPEND_TEXT(cf_new_cflags,$cf_add_cflags) ;; esac ;; (yes) CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) CF_APPEND_TEXT(CFLAGS,$cf_new_cflags) fi if test -n "$cf_new_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) CF_APPEND_TEXT(CPPFLAGS,$cf_new_cppflags) fi if test -n "$cf_new_extra_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) CF_APPEND_TEXT(EXTRA_CPPFLAGS,$cf_new_extra_cppflags) fi AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_INCDIR version: 14 updated: 2015/05/25 20:53:04 dnl ------------- dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's dnl redundant. We don't normally need to add -I/usr/local/include for gcc, dnl but old versions (and some misinstalled ones) need that. To make things dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to dnl the include-path). AC_DEFUN([CF_ADD_INCDIR], [ if test -n "$1" ; then for cf_add_incdir in $1 do while test $cf_add_incdir != /usr/include do if test -d $cf_add_incdir then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" AC_TRY_COMPILE([#include ], [printf("Hello")], [], [cf_have_incdir=yes]) CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then CF_VERBOSE(adding $cf_add_incdir to include-path) ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05 dnl ---------- dnl Add a library, used to enforce consistency. dnl dnl $1 = library to add, without the "-l" dnl $2 = variable to update (default $LIBS) AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_LIBDIR version: 10 updated: 2015/04/18 08:56:57 dnl ------------- dnl Adds to the library-path dnl dnl Some machines have trouble with multiple -L options. dnl dnl $1 is the (list of) directory(s) to add dnl $2 is the optional name of the variable to update (default LDFLAGS) dnl AC_DEFUN([CF_ADD_LIBDIR], [ if test -n "$1" ; then for cf_add_libdir in $1 do if test $cf_add_libdir = /usr/lib ; then : elif test -d $cf_add_libdir then cf_have_libdir=no if test -n "$LDFLAGS$LIBS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_libdir in $LDFLAGS $LIBS ; do if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then cf_have_libdir=yes; break fi done fi if test "$cf_have_libdir" = no ; then CF_VERBOSE(adding $cf_add_libdir to library-path) ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])" fi fi done fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_LIBS version: 2 updated: 2014/07/13 14:33:27 dnl ----------- dnl Add one or more libraries, used to enforce consistency. Libraries are dnl prepended to an existing list, since their dependencies are assumed to dnl already exist in the list. dnl dnl $1 = libraries to add, with the "-l", etc. dnl $2 = variable to update (default $LIBS) AC_DEFUN([CF_ADD_LIBS],[ cf_add_libs="$1" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in [$]ifelse($2,,LIBS,[$2]) do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done ifelse($2,,LIBS,[$2])="$cf_add_libs" ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_SUBDIR_PATH version: 4 updated: 2013/10/08 17:47:05 dnl ------------------ dnl Append to a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result dnl $2 = the package name dnl $3 = the subdirectory, e.g., bin, include or lib dnl $4 = the directory under which we will test for subdirectories dnl $5 = a directory that we do not want $4 to match AC_DEFUN([CF_ADD_SUBDIR_PATH], [ test "x$4" != "x$5" && \ test -d "$4" && \ ifelse([$5],NONE,,[(test -z "$5" || test x$5 = xNONE || test "x$4" != "x$5") &&]) { test -n "$verbose" && echo " ... testing for $3-directories under $4" test -d $4/$3 && $1="[$]$1 $4/$3" test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" test -d $4/$3/$2/$3 && $1="[$]$1 $4/$3/$2/$3" test -d $4/$2/$3 && $1="[$]$1 $4/$2/$3" test -d $4/$2/$3/$2 && $1="[$]$1 $4/$2/$3/$2" } ])dnl dnl --------------------------------------------------------------------------- dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55 dnl -------------- dnl use this macro for appending text without introducing an extra blank at dnl the beginning define([CF_APPEND_TEXT], [ test -n "[$]$1" && $1="[$]$1 " $1="[$]{$1}$2" ])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 dnl -------------- dnl Allow user to disable a normally-on option. AC_DEFUN([CF_ARG_DISABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14 dnl ------------- dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus dnl values. dnl dnl Parameters: dnl $1 = option name dnl $2 = help-string dnl $3 = action to perform if option is not default dnl $4 = action if perform if option is default dnl $5 = default option value (either 'yes' or 'no') AC_DEFUN([CF_ARG_OPTION], [AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes) if test "$enableval" != "$5" ; then ifelse([$3],,[ :]dnl ,[ $3]) ifelse([$4],,,[ else $4]) fi],[enableval=$5 ifelse([$4],,,[ $4 ])dnl ])])dnl dnl --------------------------------------------------------------------------- dnl CF_AR_FLAGS version: 6 updated: 2015/10/10 15:25:05 dnl ----------- dnl Check for suitable "ar" (archiver) options for updating an archive. dnl dnl In particular, handle some obsolete cases where the "-" might be omitted, dnl as well as a workaround for breakage of make's archive rules by the GNU dnl binutils "ar" program. AC_DEFUN([CF_AR_FLAGS],[ AC_REQUIRE([CF_PROG_AR]) AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ cf_cv_ar_flags=unknown for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv do # check if $ARFLAGS already contains this choice if test "x$ARFLAGS" != "x" ; then cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then cf_cv_ar_flags= break fi fi rm -f conftest.$ac_cv_objext rm -f conftest.a cat >conftest.$ac_ext <&AC_FD_CC $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null if test -f conftest.a ; then cf_cv_ar_flags=$cf_ar_flags break fi else CF_VERBOSE(cannot compile test-program) break fi done rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext ]) if test -n "$ARFLAGS" ; then if test -n "$cf_cv_ar_flags" ; then ARFLAGS="$ARFLAGS $cf_cv_ar_flags" fi else ARFLAGS=$cf_cv_ar_flags fi AC_SUBST(ARFLAGS) ]) dnl --------------------------------------------------------------------------- dnl CF_BUILD_CC version: 7 updated: 2012/10/06 15:31:55 dnl ----------- dnl If we're cross-compiling, allow the user to override the tools and their dnl options. The configure script is oriented toward identifying the host dnl compiler, etc., but we need a build compiler to generate parts of the dnl source. dnl dnl $1 = default for $CPPFLAGS dnl $2 = default for $LIBS AC_DEFUN([CF_BUILD_CC],[ CF_ACVERSION_CHECK(2.52,, [AC_REQUIRE([CF_PROG_EXT])]) if test "$cross_compiling" = yes ; then # defaults that we might want to override : ${BUILD_CFLAGS:=''} : ${BUILD_CPPFLAGS:='ifelse([$1],,,[$1])'} : ${BUILD_LDFLAGS:=''} : ${BUILD_LIBS:='ifelse([$2],,,[$2])'} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} AC_ARG_WITH(build-cc, [ --with-build-cc=XXX the build C compiler ($BUILD_CC)], [BUILD_CC="$withval"], [AC_CHECK_PROGS(BUILD_CC, gcc cc cl)]) AC_MSG_CHECKING(for native build C compiler) AC_MSG_RESULT($BUILD_CC) AC_MSG_CHECKING(for native build C preprocessor) AC_ARG_WITH(build-cpp, [ --with-build-cpp=XXX the build C preprocessor ($BUILD_CPP)], [BUILD_CPP="$withval"], [BUILD_CPP='${BUILD_CC} -E']) AC_MSG_RESULT($BUILD_CPP) AC_MSG_CHECKING(for native build C flags) AC_ARG_WITH(build-cflags, [ --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)], [BUILD_CFLAGS="$withval"]) AC_MSG_RESULT($BUILD_CFLAGS) AC_MSG_CHECKING(for native build C preprocessor-flags) AC_ARG_WITH(build-cppflags, [ --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)], [BUILD_CPPFLAGS="$withval"]) AC_MSG_RESULT($BUILD_CPPFLAGS) AC_MSG_CHECKING(for native build linker-flags) AC_ARG_WITH(build-ldflags, [ --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)], [BUILD_LDFLAGS="$withval"]) AC_MSG_RESULT($BUILD_LDFLAGS) AC_MSG_CHECKING(for native build linker-libraries) AC_ARG_WITH(build-libs, [ --with-build-libs=XXX the build libraries (${BUILD_LIBS})], [BUILD_LIBS="$withval"]) AC_MSG_RESULT($BUILD_LIBS) # this assumes we're on Unix. BUILD_EXEEXT= BUILD_OBJEXT=o : ${BUILD_CC:='${CC}'} if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then AC_MSG_ERROR([Cross-build requires two compilers. Use --with-build-cc to specify the native compiler.]) fi else : ${BUILD_CC:='${CC}'} : ${BUILD_CPP:='${CPP}'} : ${BUILD_CFLAGS:='${CFLAGS}'} : ${BUILD_CPPFLAGS:='${CPPFLAGS}'} : ${BUILD_LDFLAGS:='${LDFLAGS}'} : ${BUILD_LIBS:='${LIBS}'} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} fi AC_SUBST(BUILD_CC) AC_SUBST(BUILD_CPP) AC_SUBST(BUILD_CFLAGS) AC_SUBST(BUILD_CPPFLAGS) AC_SUBST(BUILD_LDFLAGS) AC_SUBST(BUILD_LIBS) AC_SUBST(BUILD_EXEEXT) AC_SUBST(BUILD_OBJEXT) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CC_ENV_FLAGS version: 7 updated: 2017/02/25 18:57:40 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content dnl into CC. This will not help with broken scripts that wrap the compiler dnl with options, but eliminates a more common category of user confusion. dnl dnl In particular, it addresses the problem of being able to run the C dnl preprocessor in a consistent manner. dnl dnl Caveat: this also disallows blanks in the pathname for the compiler, but dnl the nuisance of having inconsistent settings for compiler and preprocessor dnl outweighs that limitation. AC_DEFUN([CF_CC_ENV_FLAGS], [ # This should have been defined by AC_PROG_CC : ${CC:=cc} AC_MSG_CHECKING(\$CC variable) case "$CC" in (*[[\ \ ]]-*) AC_MSG_RESULT(broken) AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) # humor him... cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'` cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr([$]0,1+length(prog))); }'` CC="$cf_prog" for cf_arg in $cf_flags do case "x$cf_arg" in (x-[[IUDfgOW]]*) CF_ADD_CFLAGS($cf_arg) ;; (*) CC="$CC $cf_arg" ;; esac done CF_VERBOSE(resulting CC: '$CC') CF_VERBOSE(resulting CFLAGS: '$CFLAGS') CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS') ;; (*) AC_MSG_RESULT(ok) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_CFG_DEFAULTS version: 11 updated: 2015/04/17 21:13:04 dnl --------------- dnl Determine the default configuration into which we'll install ncurses. This dnl can be overridden by the user's command-line options. There's two items to dnl look for: dnl 1. the prefix (e.g., /usr) dnl 2. the header files (e.g., /usr/include/ncurses) dnl We'll look for a previous installation of ncurses and use the same defaults. dnl dnl We don't use AC_PREFIX_DEFAULT, because it gets evaluated too soon, and dnl we don't use AC_PREFIX_PROGRAM, because we cannot distinguish ncurses's dnl programs from a vendor's. AC_DEFUN([CF_CFG_DEFAULTS], [ AC_MSG_CHECKING(for prefix) if test "x$prefix" = "xNONE" ; then case "$cf_cv_system_name" in # non-vendor systems don't have a conflict (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*) prefix=/usr ;; (*) prefix=$ac_default_prefix ;; esac fi AC_MSG_RESULT($prefix) if test "x$prefix" = "xNONE" ; then AC_MSG_CHECKING(for default include-directory) test -n "$verbose" && echo 1>&AC_FD_MSG for cf_symbol in \ $includedir \ $includedir/ncurses \ $prefix/include \ $prefix/include/ncurses \ /usr/local/include \ /usr/local/include/ncurses \ /usr/include \ /usr/include/ncurses do cf_dir=`eval echo $cf_symbol` if test -f $cf_dir/curses.h ; then if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then includedir="$cf_symbol" test -n "$verbose" && echo $ac_n " found " 1>&AC_FD_MSG break fi fi test -n "$verbose" && echo " tested $cf_dir" 1>&AC_FD_MSG done AC_MSG_RESULT($includedir) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03 dnl -------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. dnl dnl If we've packaged config.guess and config.sub, run that (since it does a dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM dnl which is useful in cross-compiles. dnl dnl Note: we would use $ac_config_sub, but that is one of the places where dnl autoconf 2.5x broke compatibility with autoconf 2.13 AC_DEFUN([CF_CHECK_CACHE], [ if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then ifelse([$1],,[AC_CANONICAL_HOST],[$1]) system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" if test -z "$system_name" ; then system_name="`(hostname) 2>/dev/null`" fi fi test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.]) AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) test -z "$system_name" && system_name="$cf_cv_system_name" test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) if test ".$system_name" != ".$cf_cv_system_name" ; then AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) AC_MSG_ERROR("Please remove config.cache and try again.") fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35 dnl ----------------- dnl Check if the given compiler is really clang. clang's C driver defines dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does dnl not ignore some gcc options. dnl dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from dnl the wrappers for gcc and g++ warnings. dnl dnl $1 = GCC (default) or GXX dnl $2 = CLANG_COMPILER (default) dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_CLANG_COMPILER],[ ifelse([$2],,CLANG_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments" AC_TRY_COMPILE([],[ #ifdef __clang__ #else make an error #endif ],[ifelse([$2],,CLANG_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) fi ]) dnl --------------------------------------------------------------------------- dnl CF_CURSES_HEADER version: 5 updated: 2015/04/23 20:35:30 dnl ---------------- dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common dnl variations of ncurses' installs. dnl dnl $1 = ncurses when looking for ncurses, or is empty AC_DEFUN([CF_CURSES_HEADER],[ AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[ cf_cv_ncurses_header=none for cf_header in \ ncurses.h ifelse($1,,,[$1/ncurses.h]) \ curses.h ifelse($1,,,[$1/curses.h]) ifelse($1,,[ncurses/ncurses.h ncurses/curses.h]) do AC_TRY_COMPILE([#include <${cf_header}>], [initscr(); tgoto("?", 0,0)], [cf_cv_ncurses_header=$cf_header; break],[]) done ]) if test "$cf_cv_ncurses_header" = none ; then AC_MSG_ERROR(No curses header-files found) fi # cheat, to get the right #define's for HAVE_NCURSES_H, etc. AC_CHECK_HEADERS($cf_cv_ncurses_header) ])dnl dnl --------------------------------------------------------------------------- dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52 dnl ---------- dnl "dirname" is not portable, so we fake it with a shell script. AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl dnl --------------------------------------------------------------------------- dnl CF_DISABLE_ECHO version: 13 updated: 2015/04/18 08:56:57 dnl --------------- dnl You can always use "make -n" to see the actual options, but it's hard to dnl pick out/analyze warning messages when the compile-line is long. dnl dnl Sets: dnl ECHO_LT - symbol to control if libtool is verbose dnl ECHO_LD - symbol to prefix "cc -o" lines dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o) dnl SHOW_CC - symbol to put before explicit "cc -c" lines dnl ECHO_CC - symbol to put before any "cc" line dnl AC_DEFUN([CF_DISABLE_ECHO],[ AC_MSG_CHECKING(if you want to see long compiling messages) CF_ARG_DISABLE(echo, [ --disable-echo do not display "compiling" commands], [ ECHO_LT='--silent' ECHO_LD='@echo linking [$]@;' RULE_CC='@echo compiling [$]<' SHOW_CC='@echo compiling [$]@' ECHO_CC='@' ],[ ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' ]) AC_MSG_RESULT($enableval) AC_SUBST(ECHO_LT) AC_SUBST(ECHO_LD) AC_SUBST(RULE_CC) AC_SUBST(SHOW_CC) AC_SUBST(ECHO_CC) ])dnl dnl --------------------------------------------------------------------------- dnl CF_DISABLE_GNAT_PROJECTS version: 1 updated: 2014/06/01 11:34:00 dnl ------------------------ AC_DEFUN([CF_DISABLE_GNAT_PROJECTS],[ AC_MSG_CHECKING(if we want to use GNAT projects) CF_ARG_DISABLE(gnat-projects, [ --disable-gnat-projects test: disable GNAT projects even if usable], [enable_gnat_projects=no], [enable_gnat_projects=yes]) AC_MSG_RESULT($enable_gnat_projects) ])dnl dnl --------------------------------------------------------------------------- dnl CF_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54 dnl --------------- dnl Look for a non-standard library, given parameters for AC_TRY_LINK. We dnl prefer a standard location, and use -L options only if we do not find the dnl library in the standard library location(s). dnl $1 = library name dnl $2 = library class, usually the same as library name dnl $3 = includes dnl $4 = code fragment to compile/link dnl $5 = corresponding function-name dnl $6 = flag, nonnull if failure should not cause an error-exit dnl dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had dnl to use a -L option. AC_DEFUN([CF_FIND_LIBRARY], [ eval 'cf_cv_have_lib_'$1'=no' cf_libdir="" AC_CHECK_FUNC($5, eval 'cf_cv_have_lib_'$1'=yes',[ cf_save_LIBS="$LIBS" AC_MSG_CHECKING(for $5 in -l$1) LIBS="-l$1 $LIBS" AC_TRY_LINK([$3],[$4], [AC_MSG_RESULT(yes) eval 'cf_cv_have_lib_'$1'=yes' ], [AC_MSG_RESULT(no) CF_LIBRARY_PATH(cf_search,$2) for cf_libdir in $cf_search do AC_MSG_CHECKING(for -l$1 in $cf_libdir) LIBS="-L$cf_libdir -l$1 $cf_save_LIBS" AC_TRY_LINK([$3],[$4], [AC_MSG_RESULT(yes) eval 'cf_cv_have_lib_'$1'=yes' break], [AC_MSG_RESULT(no) LIBS="$cf_save_LIBS"]) done ]) ]) eval 'cf_found_library=[$]cf_cv_have_lib_'$1 ifelse($6,,[ if test $cf_found_library = no ; then AC_MSG_ERROR(Cannot link $1 library) fi ]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_FIND_LINKAGE version: 20 updated: 2015/04/18 08:56:57 dnl --------------- dnl Find a library (specifically the linkage used in the code fragment), dnl searching for it if it is not already in the library path. dnl See also CF_ADD_SEARCHPATH. dnl dnl Parameters (4-on are optional): dnl $1 = headers for library entrypoint dnl $2 = code fragment for library entrypoint dnl $3 = the library name without the "-l" option or ".so" suffix. dnl $4 = action to perform if successful (default: update CPPFLAGS, etc) dnl $5 = action to perform if not successful dnl $6 = module name, if not the same as the library name dnl $7 = extra libraries dnl dnl Sets these variables: dnl $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found dnl $cf_cv_header_path_$3 - include-directory if needed dnl $cf_cv_library_path_$3 - library-directory if needed dnl $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3 AC_DEFUN([CF_FIND_LINKAGE],[ # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these # will be set on completion of the AC_TRY_LINK below. cf_cv_header_path_$3= cf_cv_library_path_$3= CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)]) cf_save_LIBS="$LIBS" AC_TRY_LINK([$1],[$2],[ cf_cv_find_linkage_$3=yes cf_cv_header_path_$3=/usr/include cf_cv_library_path_$3=/usr/lib ],[ LIBS="-l$3 $7 $cf_save_LIBS" AC_TRY_LINK([$1],[$2],[ cf_cv_find_linkage_$3=yes cf_cv_header_path_$3=/usr/include cf_cv_library_path_$3=/usr/lib cf_cv_library_file_$3="-l$3" ],[ cf_cv_find_linkage_$3=no LIBS="$cf_save_LIBS" CF_VERBOSE(find linkage for $3 library) CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)]) cf_save_CPPFLAGS="$CPPFLAGS" cf_test_CPPFLAGS="$CPPFLAGS" CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6])) for cf_cv_header_path_$3 in $cf_search do if test -d $cf_cv_header_path_$3 ; then CF_VERBOSE(... testing $cf_cv_header_path_$3) CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_$3" AC_TRY_COMPILE([$1],[$2],[ CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3) cf_cv_find_linkage_$3=maybe cf_test_CPPFLAGS="$CPPFLAGS" break],[ CPPFLAGS="$cf_save_CPPFLAGS" ]) fi done if test "$cf_cv_find_linkage_$3" = maybe ; then CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)]) cf_save_LIBS="$LIBS" cf_save_LDFLAGS="$LDFLAGS" ifelse([$6],,,[ CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-l$3 $7 $cf_save_LIBS" AC_TRY_LINK([$1],[$2],[ CF_VERBOSE(... found $3 library in system) cf_cv_find_linkage_$3=yes]) CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" ]) if test "$cf_cv_find_linkage_$3" != yes ; then CF_LIBRARY_PATH(cf_search,$3) for cf_cv_library_path_$3 in $cf_search do if test -d $cf_cv_library_path_$3 ; then CF_VERBOSE(... testing $cf_cv_library_path_$3) CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-l$3 $7 $cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3" AC_TRY_LINK([$1],[$2],[ CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3) cf_cv_find_linkage_$3=yes cf_cv_library_file_$3="-l$3" break],[ CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS" ]) fi done CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi else cf_cv_find_linkage_$3=no fi ],$7) ]) LIBS="$cf_save_LIBS" if test "$cf_cv_find_linkage_$3" = yes ; then ifelse([$4],,[ CF_ADD_INCDIR($cf_cv_header_path_$3) CF_ADD_LIBDIR($cf_cv_library_path_$3) CF_ADD_LIB($3) ],[$4]) else ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_FIXUP_ADAFLAGS version: 2 updated: 2015/04/17 21:13:04 dnl ----------------- dnl make ADAFLAGS consistent with CFLAGS AC_DEFUN([CF_FIXUP_ADAFLAGS],[ AC_MSG_CHECKING(optimization options for ADAFLAGS) case "$CFLAGS" in (*-g*) CF_ADD_ADAFLAGS(-g) ;; esac case "$CFLAGS" in (*-O*) cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[[ ]].*//'` CF_ADD_ADAFLAGS($cf_O_flag) ;; esac AC_MSG_RESULT($ADAFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_ATTRIBUTES version: 17 updated: 2015/04/12 15:39:00 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary dnl to documentation, unrecognized directives cause older compilers to barf. AC_DEFUN([CF_GCC_ATTRIBUTES], [ if test "$GCC" = yes then cat > conftest.i < conftest.$ac_ext <&AC_FD_CC case $cf_attribute in (printf) cf_printf_attribute=yes cat >conftest.h <conftest.h <conftest.h <>confdefs.h case $cf_attribute in (noreturn) AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc]) ;; (printf) cf_value='/* nothing */' if test "$cf_printf_attribute" != no ; then cf_value='__attribute__((format(printf,fmt,var)))' AC_DEFINE(GCC_PRINTF,1,[Define to 1 if the compiler supports gcc-like printf attribute.]) fi AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc]) ;; (scanf) cf_value='/* nothing */' if test "$cf_scanf_attribute" != no ; then cf_value='__attribute__((format(scanf,fmt,var)))' AC_DEFINE(GCC_SCANF,1,[Define to 1 if the compiler supports gcc-like scanf attribute.]) fi AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc]) ;; (unused) AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc]) ;; esac fi done else fgrep define conftest.i >>confdefs.h fi rm -rf conftest* fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33 dnl -------------- dnl Find version of gcc AC_DEFUN([CF_GCC_VERSION],[ AC_REQUIRE([AC_PROG_CC]) GCC_VERSION=none if test "$GCC" = yes ; then AC_MSG_CHECKING(version of $CC) GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown AC_MSG_RESULT($GCC_VERSION) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_WARNINGS version: 32 updated: 2015/04/12 15:39:00 dnl --------------- dnl Check if the compiler supports useful warning options. There's a few that dnl we don't use, simply because they're too noisy: dnl dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x) dnl -Wredundant-decls (system headers make this too noisy) dnl -Wtraditional (combines too many unrelated messages, only a few useful) dnl -Wwrite-strings (too noisy, but should review occasionally). This dnl is enabled for ncurses using "--enable-const". dnl -pedantic dnl dnl Parameter: dnl $1 is an optional list of gcc warning flags that a particular dnl application might want to use, e.g., "no-unused" for dnl -Wno-unused dnl Special: dnl If $with_ext_const is "yes", add a check for -Wwrite-strings dnl AC_DEFUN([CF_GCC_WARNINGS], [ AC_REQUIRE([CF_GCC_VERSION]) CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS) cat > conftest.$ac_ext </dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes ]) test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS" AC_SUBST(GNATPREP_OPTS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_GNAT_GENERICS version: 3 updated: 2015/04/17 21:13:04 dnl ---------------- AC_DEFUN([CF_GNAT_GENERICS], [ AC_REQUIRE([CF_GNAT_VERSION]) AC_MSG_CHECKING(if GNAT supports generics) case $cf_gnat_version in (3.[[1-9]]*|[[4-9]].*) cf_gnat_generics=yes ;; (*) cf_gnat_generics=no ;; esac AC_MSG_RESULT($cf_gnat_generics) if test "$cf_gnat_generics" = yes then cf_compile_generics=generics cf_generic_objects="\${GENOBJS}" else cf_compile_generics= cf_generic_objects= fi AC_SUBST(cf_compile_generics) AC_SUBST(cf_generic_objects) ])dnl dnl --------------------------------------------------------------------------- dnl CF_GNAT_PROJECTS version: 8 updated: 2015/04/17 21:13:04 dnl ---------------- dnl GNAT projects are configured with ".gpr" project files. dnl GNAT libraries are a further development, using the project feature. AC_DEFUN([CF_GNAT_PROJECTS], [ AC_REQUIRE([CF_GNAT_VERSION]) AC_REQUIRE([CF_DISABLE_GNAT_PROJECTS]) cf_gnat_libraries=no cf_gnat_projects=no if test "$enable_gnat_projects" != no ; then AC_MSG_CHECKING(if GNAT supports project files) case $cf_gnat_version in (3.[[0-9]]*) ;; (*) case $cf_cv_system_name in (cygwin*|msys*) ;; (*) mkdir conftest.src conftest.bin conftest.lib cd conftest.src rm -rf conftest* *~conftest* cat >>library.gpr <>confpackage.ads <>confpackage.adb <&AC_FD_CC 2>&1 ) ; then cf_gnat_projects=yes fi cd .. if test -f conftest.lib/confpackage.ali then cf_gnat_libraries=yes fi rm -rf conftest* *~conftest* ;; esac ;; esac AC_MSG_RESULT($cf_gnat_projects) fi # enable_gnat_projects if test $cf_gnat_projects = yes then AC_MSG_CHECKING(if GNAT supports libraries) AC_MSG_RESULT($cf_gnat_libraries) fi if test "$cf_gnat_projects" = yes then USE_OLD_MAKERULES="#" USE_GNAT_PROJECTS="" else USE_OLD_MAKERULES="" USE_GNAT_PROJECTS="#" fi if test "$cf_gnat_libraries" = yes then USE_GNAT_LIBRARIES="" else USE_GNAT_LIBRARIES="#" fi AC_SUBST(USE_OLD_MAKERULES) AC_SUBST(USE_GNAT_PROJECTS) AC_SUBST(USE_GNAT_LIBRARIES) ])dnl dnl --------------------------------------------------------------------------- dnl CF_GNAT_SIGINT version: 1 updated: 2011/03/27 20:07:59 dnl -------------- dnl Check if gnat supports SIGINT, and presumably tasking. For the latter, it dnl is noted that gnat may compile a tasking unit even for configurations which dnl fail at runtime. AC_DEFUN([CF_GNAT_SIGINT],[ AC_CACHE_CHECK(if GNAT supports SIGINT,cf_cv_gnat_sigint,[ CF_GNAT_TRY_LINK([with Ada.Interrupts.Names; package ConfTest is pragma Warnings (Off); -- the next pragma exists since 3.11p pragma Unreserve_All_Interrupts; pragma Warnings (On); protected Process is procedure Stop; function Continue return Boolean; pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT); private Done : Boolean := False; end Process; end ConfTest;], [package body ConfTest is protected body Process is procedure Stop is begin Done := True; end Stop; function Continue return Boolean is begin return not Done; end Continue; end Process; end ConfTest;], [cf_cv_gnat_sigint=yes], [cf_cv_gnat_sigint=no])]) if test $cf_cv_gnat_sigint = yes ; then USE_GNAT_SIGINT="" else USE_GNAT_SIGINT="#" fi AC_SUBST(USE_GNAT_SIGINT) ])dnl dnl --------------------------------------------------------------------------- dnl CF_GNAT_TRY_LINK version: 3 updated: 2011/03/19 14:47:45 dnl ---------------- dnl Verify that a test program compiles/links with GNAT. dnl $cf_ada_make is set to the program that compiles/links dnl $ADAFLAGS may be set to the GNAT flags. dnl dnl $1 is the text of the spec dnl $2 is the text of the body dnl $3 is the shell command to execute if successful dnl $4 is the shell command to execute if not successful AC_DEFUN([CF_GNAT_TRY_LINK], [ rm -rf conftest* *~conftest* cat >>conftest.ads <>conftest.adb <&AC_FD_CC 2>&1 ) ; then ifelse($3,, :,[ $3]) ifelse($4,,,[else $4]) fi rm -rf conftest* *~conftest* ])dnl dnl --------------------------------------------------------------------------- dnl CF_GNAT_TRY_RUN version: 5 updated: 2011/03/19 14:47:45 dnl --------------- dnl Verify that a test program compiles and runs with GNAT dnl $cf_ada_make is set to the program that compiles/links dnl $ADAFLAGS may be set to the GNAT flags. dnl dnl $1 is the text of the spec dnl $2 is the text of the body dnl $3 is the shell command to execute if successful dnl $4 is the shell command to execute if not successful AC_DEFUN([CF_GNAT_TRY_RUN], [ rm -rf conftest* *~conftest* cat >>conftest.ads <>conftest.adb <&AC_FD_CC 2>&1 ) ; then if ( ./conftest 1>&AC_FD_CC 2>&1 ) ; then ifelse($3,, :,[ $3]) ifelse($4,,,[ else $4]) fi ifelse($4,,,[else $4]) fi rm -rf conftest* *~conftest* ])dnl dnl --------------------------------------------------------------------------- dnl CF_GNAT_VERSION version: 20 updated: 2015/04/18 08:56:57 dnl --------------- dnl Verify version of GNAT. AC_DEFUN([CF_GNAT_VERSION], [ AC_MSG_CHECKING(for gnat version) cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ grep '[[0-9]].[[0-9]][[0-9]]*' |\ sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'` AC_MSG_RESULT($cf_gnat_version) case $cf_gnat_version in (3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*|20[[0-9]][[0-9]]) cf_cv_prog_gnat_correct=yes ;; (*) AC_MSG_WARN(Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding.) cf_cv_prog_gnat_correct=no ;; esac ]) dnl --------------------------------------------------------------------------- dnl CF_GNU_SOURCE version: 7 updated: 2016/08/05 05:15:37 dnl ------------- dnl Check if we must define _GNU_SOURCE to get a reasonable value for dnl _XOPEN_SOURCE, upon which many POSIX definitions depend. This is a defect dnl (or misfeature) of glibc2, which breaks portability of many applications, dnl since it is interwoven with GNU extensions. dnl dnl Well, yes we could work around it... AC_DEFUN([CF_GNU_SOURCE], [ AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[ AC_TRY_COMPILE([#include ],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_cv_gnu_source=no], [cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" AC_TRY_COMPILE([#include ],[ #ifdef _XOPEN_SOURCE make an error #endif], [cf_cv_gnu_source=no], [cf_cv_gnu_source=yes]) CPPFLAGS="$cf_save" ]) ]) if test "$cf_cv_gnu_source" = yes then AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" AC_TRY_COMPILE([#include ],[ #ifdef _DEFAULT_SOURCE make an error #endif], [cf_cv_default_source=no], [cf_cv_default_source=yes]) ]) test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE" fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_HEADER_PATH version: 13 updated: 2015/04/15 19:08:48 dnl -------------- dnl Construct a search-list of directories for a nonstandard header-file dnl dnl Parameters dnl $1 = the variable to return as result dnl $2 = the package name AC_DEFUN([CF_HEADER_PATH], [ $1= # collect the current set of include-directories from compiler flags cf_header_path_list="" if test -n "${CFLAGS}${CPPFLAGS}" ; then for cf_header_path in $CPPFLAGS $CFLAGS do case $cf_header_path in (-I*) cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE) cf_header_path_list="$cf_header_path_list [$]$1" ;; esac done fi # add the variations for the package we are looking for CF_SUBDIR_PATH($1,$2,include) test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { test -d $includedir && $1="[$]$1 $includedir" test -d $includedir/$2 && $1="[$]$1 $includedir/$2" } test "$oldincludedir" != NONE && \ test "$oldincludedir" != "/usr/include" && \ test -d "$oldincludedir" && { test -d $oldincludedir && $1="[$]$1 $oldincludedir" test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2" } $1="[$]$1 $cf_header_path_list" ])dnl dnl --------------------------------------------------------------------------- dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23 dnl --------------- dnl Insert text into the help-message, for readability, from AC_ARG_WITH. AC_DEFUN([CF_HELP_MESSAGE], [AC_DIVERT_HELP([$1])dnl ])dnl dnl --------------------------------------------------------------------------- dnl CF_INCLUDE_DIRS version: 10 updated: 2014/09/19 20:58:42 dnl --------------- dnl Construct the list of include-options according to whether we're building dnl in the source directory or using '--srcdir=DIR' option. AC_DEFUN([CF_INCLUDE_DIRS], [ if test "$srcdir" != "."; then CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS" fi CPPFLAGS="-I../include $CPPFLAGS" if test "$srcdir" != "."; then CPPFLAGS="-I\${srcdir} $CPPFLAGS" fi CPPFLAGS="-I. $CPPFLAGS" AC_SUBST(CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_INTEL_COMPILER version: 7 updated: 2015/04/12 15:39:00 dnl ----------------- dnl Check if the given compiler is really the Intel compiler for Linux. It dnl tries to imitate gcc, but does not return an error when it finds a mismatch dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK. dnl dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from dnl the wrappers for gcc and g++ warnings. dnl dnl $1 = GCC (default) or GXX dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_INTEL_COMPILER],[ AC_REQUIRE([AC_CANONICAL_HOST]) ifelse([$2],,INTEL_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then case $host_os in (linux*|gnu*) AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc" AC_TRY_COMPILE([],[ #ifdef __INTEL_COMPILER #else make an error #endif ],[ifelse([$2],,INTEL_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) ;; esac fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_LARGEFILE version: 10 updated: 2017/01/21 11:06:25 dnl ------------ dnl Add checks for large file support. AC_DEFUN([CF_LARGEFILE],[ ifdef([AC_FUNC_FSEEKO],[ AC_SYS_LARGEFILE if test "$enable_largefile" != no ; then AC_FUNC_FSEEKO # Normally we would collect these definitions in the config.h, # but (like _XOPEN_SOURCE), some environments rely on having these # defined before any of the system headers are included. Another # case comes up with C++, e.g., on AIX the compiler compiles the # header files by themselves before looking at the body files it is # told to compile. For ncurses, those header files do not include # the config.h test "$ac_cv_sys_large_files" != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES " test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE " test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits " AC_CACHE_CHECK(whether to use struct dirent64, cf_cv_struct_dirent64,[ AC_TRY_COMPILE([ #pragma GCC diagnostic error "-Wincompatible-pointer-types" #include #include ],[ /* if transitional largefile support is setup, this is true */ extern struct dirent64 * readdir(DIR *); struct dirent64 *x = readdir((DIR *)0); struct dirent *y = readdir((DIR *)0); int z = x - y; ], [cf_cv_struct_dirent64=yes], [cf_cv_struct_dirent64=no]) ]) test "$cf_cv_struct_dirent64" = yes && AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Define to 1 if we have struct dirent64]) fi ]) ]) dnl --------------------------------------------------------------------------- dnl CF_LD_RPATH_OPT version: 7 updated: 2016/02/20 18:01:19 dnl --------------- dnl For the given system and compiler, find the compiler flags to pass to the dnl loader to use the "rpath" feature. AC_DEFUN([CF_LD_RPATH_OPT], [ AC_REQUIRE([CF_CHECK_CACHE]) LD_RPATH_OPT= AC_MSG_CHECKING(for an rpath option) case $cf_cv_system_name in (irix*) if test "$GCC" = yes; then LD_RPATH_OPT="-Wl,-rpath," else LD_RPATH_OPT="-rpath " fi ;; (linux*|gnu*|k*bsd*-gnu|freebsd*) LD_RPATH_OPT="-Wl,-rpath," ;; (openbsd[[2-9]].*|mirbsd*) LD_RPATH_OPT="-Wl,-rpath," ;; (dragonfly*) LD_RPATH_OPT="-rpath " ;; (netbsd*) LD_RPATH_OPT="-Wl,-rpath," ;; (osf*|mls+*) LD_RPATH_OPT="-rpath " ;; (solaris2*) LD_RPATH_OPT="-R" ;; (*) ;; esac AC_MSG_RESULT($LD_RPATH_OPT) case "x$LD_RPATH_OPT" in (x-R*) AC_MSG_CHECKING(if we need a space after rpath option) cf_save_LIBS="$LIBS" CF_ADD_LIBS(${LD_RPATH_OPT}$libdir) AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes) LIBS="$cf_save_LIBS" AC_MSG_RESULT($cf_rpath_space) test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_LIBRARY_PATH version: 10 updated: 2015/04/15 19:08:48 dnl --------------- dnl Construct a search-list of directories for a nonstandard library-file dnl dnl Parameters dnl $1 = the variable to return as result dnl $2 = the package name AC_DEFUN([CF_LIBRARY_PATH], [ $1= cf_library_path_list="" if test -n "${LDFLAGS}${LIBS}" ; then for cf_library_path in $LDFLAGS $LIBS do case $cf_library_path in (-L*) cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'` CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE) cf_library_path_list="$cf_library_path_list [$]$1" ;; esac done fi CF_SUBDIR_PATH($1,$2,lib) $1="$cf_library_path_list [$]$1" ])dnl dnl --------------------------------------------------------------------------- dnl CF_LIB_PREFIX version: 12 updated: 2015/10/17 19:03:33 dnl ------------- dnl Compute the library-prefix for the given host system dnl $1 = variable to set define([CF_LIB_PREFIX], [ case $cf_cv_system_name in (OS/2*|os2*) if test "$DFT_LWR_MODEL" = libtool; then LIB_PREFIX='lib' else LIB_PREFIX='' fi ;; (*) LIB_PREFIX='lib' ;; esac ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- dnl CF_LIB_SUFFIX version: 25 updated: 2015/04/17 21:13:04 dnl ------------- dnl Compute the library file-suffix from the given model name dnl $1 = model name dnl $2 = variable to set (the nominal library suffix) dnl $3 = dependency variable to set (actual filename) dnl The variable $LIB_SUFFIX, if set, prepends the variable to set. AC_DEFUN([CF_LIB_SUFFIX], [ case X$1 in (Xlibtool) $2='.la' $3=[$]$2 ;; (Xdebug) $2='_g.a' $3=[$]$2 ;; (Xprofile) $2='_p.a' $3=[$]$2 ;; (Xshared) case $cf_cv_system_name in (aix[[5-7]]*) $2='.so' $3=[$]$2 ;; (cygwin*|msys*|mingw*) $2='.dll' $3='.dll.a' ;; (darwin*) $2='.dylib' $3=[$]$2 ;; (hpux*) case $target in (ia64*) $2='.so' $3=[$]$2 ;; (*) $2='.sl' $3=[$]$2 ;; esac ;; (*) $2='.so' $3=[$]$2 ;; esac ;; (*) $2='.a' $3=[$]$2 ;; esac if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}" then $2="${LIB_SUFFIX}${EXTRA_SUFFIX}[$]{$2}" $3="${LIB_SUFFIX}${EXTRA_SUFFIX}[$]{$3}" fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_LIB_TYPE version: 5 updated: 2015/04/17 21:13:04 dnl ----------- dnl Compute the string to append to -library from the given model name dnl $1 = model name dnl $2 = variable to set dnl The variable $LIB_SUFFIX, if set, prepends the variable to set. AC_DEFUN([CF_LIB_TYPE], [ case $1 in (libtool) $2='' ;; (normal) $2='' ;; (debug) $2='_g' ;; (profile) $2='_p' ;; (shared) $2='' ;; esac test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" ])dnl dnl --------------------------------------------------------------------------- dnl CF_LINK_DATAONLY version: 11 updated: 2017/01/21 11:06:25 dnl ---------------- dnl Some systems have a non-ANSI linker that doesn't pull in modules that have dnl only data (i.e., no functions), for example NeXT. On those systems we'll dnl have to provide wrappers for global tables to ensure they're linked dnl properly. AC_DEFUN([CF_LINK_DATAONLY], [ AC_MSG_CHECKING([if data-only library module links]) AC_CACHE_VAL(cf_cv_link_dataonly,[ rm -f conftest.a cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null fi rm -f conftest.$ac_ext func.o ( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null cf_saveLIBS="$LIBS" LIBS="conftest.a $LIBS" AC_TRY_RUN([ int main(void) { extern int testfunc(); ${cf_cv_main_return:-return} (!testfunc()); } ], [cf_cv_link_dataonly=yes], [cf_cv_link_dataonly=no], [cf_cv_link_dataonly=unknown]) LIBS="$cf_saveLIBS" ]) AC_MSG_RESULT($cf_cv_link_dataonly) if test "$cf_cv_link_dataonly" = no ; then AC_DEFINE(BROKEN_LINKER,1,[if data-only library module does not link]) BROKEN_LINKER=1 fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_MAKEFLAGS version: 17 updated: 2015/08/05 20:44:28 dnl ------------ dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' dnl options to lower-levels. It's very useful for "make -n" -- if we have it. dnl (GNU 'make' does both, something POSIX 'make', which happens to make the dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-) AC_DEFUN([CF_MAKEFLAGS], [ AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[ cf_cv_makeflags='' for cf_option in '-${MAKEFLAGS}' '${MFLAGS}' do cat >cf_makeflags.tmp </dev/null | fgrep -v "ing directory" | sed -e 's,[[ ]]*$,,'` case "$cf_result" in (.*k|.*kw) cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in (.*CC=*) cf_cv_makeflags= ;; (*) cf_cv_makeflags=$cf_option ;; esac break ;; (.-) ;; (*) echo "given option \"$cf_option\", no match \"$cf_result\"" ;; esac done rm -f cf_makeflags.tmp ]) AC_SUBST(cf_cv_makeflags) ])dnl dnl --------------------------------------------------------------------------- dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32 dnl ------------ dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have dnl a monocase filesystem. AC_DEFUN([CF_MAKE_TAGS],[ AC_REQUIRE([CF_MIXEDCASE_FILENAMES]) AC_CHECK_PROGS(CTAGS, exctags ctags) AC_CHECK_PROGS(ETAGS, exetags etags) AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no) if test "$cf_cv_mixedcase" = yes ; then AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no) else MAKE_UPPER_TAGS=no fi if test "$MAKE_UPPER_TAGS" = yes ; then MAKE_UPPER_TAGS= else MAKE_UPPER_TAGS="#" fi if test "$MAKE_LOWER_TAGS" = yes ; then MAKE_LOWER_TAGS= else MAKE_LOWER_TAGS="#" fi AC_SUBST(CTAGS) AC_SUBST(ETAGS) AC_SUBST(MAKE_UPPER_TAGS) AC_SUBST(MAKE_LOWER_TAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_MIXEDCASE_FILENAMES version: 7 updated: 2015/04/12 15:39:00 dnl ---------------------- dnl Check if the file-system supports mixed-case filenames. If we're able to dnl create a lowercase name and see it as uppercase, it doesn't support that. AC_DEFUN([CF_MIXEDCASE_FILENAMES], [ AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[ if test "$cross_compiling" = yes ; then case $target_alias in (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) cf_cv_mixedcase=no ;; (*) cf_cv_mixedcase=yes ;; esac else rm -f conftest CONFTEST echo test >conftest if test -f CONFTEST ; then cf_cv_mixedcase=no else cf_cv_mixedcase=yes fi rm -f conftest CONFTEST fi ]) test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_MKSTEMP version: 10 updated: 2017/01/21 11:12:16 dnl ---------- dnl Check for a working mkstemp. This creates two files, checks that they are dnl successfully created and distinct (AmigaOS apparently fails on the last). AC_DEFUN([CF_MKSTEMP],[ AC_CHECK_HEADERS( \ unistd.h \ ) AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ rm -rf conftest* AC_TRY_RUN([ #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include int main(void) { char *tmpl = "conftestXXXXXX"; char name[2][80]; int n; int result = 0; int fd; struct stat sb; umask(077); for (n = 0; n < 2; ++n) { strcpy(name[n], tmpl); if ((fd = mkstemp(name[n])) >= 0) { if (!strcmp(name[n], tmpl) || stat(name[n], &sb) != 0 || (sb.st_mode & S_IFMT) != S_IFREG || (sb.st_mode & 077) != 0) { result = 1; } close(fd); } } if (result == 0 && !strcmp(name[0], name[1])) result = 1; ${cf_cv_main_return:-return}(result); } ],[cf_cv_func_mkstemp=yes ],[cf_cv_func_mkstemp=no ],[cf_cv_func_mkstemp=maybe]) ]) if test "x$cf_cv_func_mkstemp" = xmaybe ; then AC_CHECK_FUNC(mkstemp) fi if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then AC_DEFINE(HAVE_MKSTEMP,1,[Define to 1 if mkstemp() is available and working.]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 dnl ---------- dnl Write a debug message to config.log, along with the line number in the dnl configure script. AC_DEFUN([CF_MSG_LOG],[ echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_ADDON version: 5 updated: 2015/04/26 18:06:58 dnl ---------------- dnl Configure an ncurses add-on, built outside the ncurses tree. AC_DEFUN([CF_NCURSES_ADDON],[ AC_REQUIRE([CF_NCURSES_CONFIG]) AC_PROVIDE([CF_SUBST_NCURSES_VERSION]) AC_MSG_CHECKING(if you want wide-character code) AC_ARG_ENABLE(widec, [ --enable-widec compile with wide-char/UTF-8 code], [with_widec=$enableval], [with_widec=no]) AC_MSG_RESULT($with_widec) if test "$with_widec" = yes ; then CF_UTF8_LIB CF_NCURSES_CONFIG(ncursesw) else CF_NCURSES_CONFIG(ncurses) fi if test "$NCURSES_CONFIG_PKG" != none ; then cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null` NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'` NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[[0-9]][[0-9]]*\.//' -e 's/\..*//'` NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.//'` cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null` if test -z "$cf_cv_abi_version" then cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null` fi elif test "$NCURSES_CONFIG" != none ; then cf_version=`$NCURSES_CONFIG --version 2>/dev/null` NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'` NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[[0-9]][[0-9]]*\.//' -e 's/\..*//'` NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.//'` # ABI version is not available from headers cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null` else for cf_name in MAJOR MINOR PATCH do cat >conftest.$ac_ext < AUTOCONF_$cf_name NCURSES_VERSION_$cf_name CF_EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out" AC_TRY_EVAL(cf_try) if test -f conftest.out ; then cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[[ ]][[ ]]*//"` eval NCURSES_$cf_name=\"$cf_result\" # cat conftest.$ac_ext # cat conftest.out fi done cf_cv_abi_version=${NCURSES_MAJOR} fi cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} dnl Show the computed version, for logging cf_cv_timestamp=`date` AC_MSG_RESULT(Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)) dnl We need these values in the generated headers AC_SUBST(NCURSES_MAJOR) AC_SUBST(NCURSES_MINOR) AC_SUBST(NCURSES_PATCH) dnl We need these values in the generated makefiles AC_SUBST(cf_cv_rel_version) AC_SUBST(cf_cv_abi_version) dnl FIXME - not needed for Ada95 AC_SUBST(cf_cv_builtin_bool) AC_SUBST(cf_cv_header_stdbool_h) AC_SUBST(cf_cv_type_of_bool)dnl ]) dnl --------------------------------------------------------------------------- dnl CF_NCURSES_CC_CHECK version: 4 updated: 2007/07/29 10:39:05 dnl ------------------- dnl Check if we can compile with ncurses' header file dnl $1 is the cache variable to set dnl $2 is the header-file to include dnl $3 is the root name (ncurses or ncursesw) AC_DEFUN([CF_NCURSES_CC_CHECK],[ AC_TRY_COMPILE([ ]ifelse($3,ncursesw,[ #define _XOPEN_SOURCE_EXTENDED #undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */ #define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */ ])[ #include <$2>],[ #ifdef NCURSES_VERSION ]ifelse($3,ncursesw,[ #ifndef WACS_BSSB make an error #endif ])[ printf("%s\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\n"); #else make an error #endif #endif ] ,[$1=$2] ,[$1=no]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_CONFIG version: 17 updated: 2015/07/07 04:22:07 dnl ----------------- dnl Tie together the configure-script macros for ncurses, preferring these in dnl order: dnl a) ".pc" files for pkg-config, using $NCURSES_CONFIG_PKG dnl b) the "-config" script from ncurses, using $NCURSES_CONFIG dnl c) just plain libraries dnl dnl $1 is the root library name (default: "ncurses") AC_DEFUN([CF_NCURSES_CONFIG],[ AC_REQUIRE([CF_PKG_CONFIG]) cf_ncuconfig_root=ifelse($1,,ncurses,$1) cf_have_ncuconfig=no if test "x${PKG_CONFIG:=none}" != xnone; then AC_MSG_CHECKING(pkg-config for $cf_ncuconfig_root) if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then AC_MSG_RESULT(yes) AC_MSG_CHECKING(if the $cf_ncuconfig_root package files work) cf_have_ncuconfig=unknown cf_save_CPPFLAGS="$CPPFLAGS" cf_save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`" CF_ADD_LIBS(`$PKG_CONFIG --libs $cf_ncuconfig_root`) AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);], [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}> int main(void) { char *xx = curses_version(); return (xx == 0); }], [cf_have_ncuconfig=yes], [cf_have_ncuconfig=no], [cf_have_ncuconfig=maybe])], [cf_have_ncuconfig=no]) AC_MSG_RESULT($cf_have_ncuconfig) test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes if test "$cf_have_ncuconfig" != "yes" then CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" NCURSES_CONFIG_PKG=none else AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries]) NCURSES_CONFIG_PKG=$cf_ncuconfig_root fi else AC_MSG_RESULT(no) NCURSES_CONFIG_PKG=none fi else NCURSES_CONFIG_PKG=none fi if test "x$cf_have_ncuconfig" = "xno"; then echo "Looking for ${cf_ncuconfig_root}-config" CF_ACVERSION_CHECK(2.52, [AC_CHECK_TOOLS(NCURSES_CONFIG, ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)], [AC_PATH_PROGS(NCURSES_CONFIG, ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)]) if test "$NCURSES_CONFIG" != none ; then CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`" CF_ADD_LIBS(`$NCURSES_CONFIG --libs`) # even with config script, some packages use no-override for curses.h CF_CURSES_HEADER(ifelse($1,,ncurses,$1)) dnl like CF_NCURSES_CPPFLAGS AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries]) dnl like CF_NCURSES_LIBS CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root) AC_DEFINE_UNQUOTED($cf_nculib_ROOT) dnl like CF_NCURSES_VERSION cf_cv_ncurses_version=`$NCURSES_CONFIG --version` else CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1)) CF_NCURSES_LIBS(ifelse($1,,ncurses,$1)) fi else NCURSES_CONFIG=none fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_CPPFLAGS version: 21 updated: 2012/10/06 08:57:51 dnl ------------------- dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting dnl the CPPFLAGS variable so we can include its header. dnl dnl The header files may be installed as either curses.h, or ncurses.h (would dnl be obsolete, except that some packagers prefer this name to distinguish it dnl from a "native" curses implementation). If not installed for overwrite, dnl the curses.h file would be in an ncurses subdirectory (e.g., dnl /usr/include/ncurses), but someone may have installed overwriting the dnl vendor's curses. Only very old versions (pre-1.9.2d, the first autoconf'd dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in dnl the header. dnl dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header dnl is already in the include-path, don't even bother with this, since we cannot dnl easily determine which file it is. In this case, it has to be . dnl dnl The optional parameter gives the root name of the library, in case it is dnl not installed as the default curses library. That is how the dnl wide-character version of ncurses is installed. AC_DEFUN([CF_NCURSES_CPPFLAGS], [AC_REQUIRE([CF_WITH_CURSES_DIR]) AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl cf_ncuhdr_root=ifelse($1,,ncurses,$1) test -n "$cf_cv_curses_dir" && \ test "$cf_cv_curses_dir" != "no" && { \ CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root) } AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[ cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" for cf_header in $cf_header_list do CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1) test "$cf_cv_ncurses_h" != no && break done ]) CF_NCURSES_HEADER CF_TERM_HEADER # some applications need this, but should check for NCURSES_VERSION AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries]) CF_NCURSES_VERSION ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_HEADER version: 4 updated: 2015/04/15 19:08:48 dnl ----------------- dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common dnl variations of ncurses' installs. dnl dnl See also CF_CURSES_HEADER, which sets the same cache variable. AC_DEFUN([CF_NCURSES_HEADER],[ if test "$cf_cv_ncurses_h" != no ; then cf_cv_ncurses_header=$cf_cv_ncurses_h else AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[ test -n "$verbose" && echo CF_HEADER_PATH(cf_search,$cf_ncuhdr_root) test -n "$verbose" && echo search path $cf_search cf_save2_CPPFLAGS="$CPPFLAGS" for cf_incdir in $cf_search do CF_ADD_INCDIR($cf_incdir) for cf_header in \ ncurses.h \ curses.h do CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1) if test "$cf_cv_ncurses_h2" != no ; then cf_cv_ncurses_h2=$cf_incdir/$cf_header test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&AC_FD_MSG break fi test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG done CPPFLAGS="$cf_save2_CPPFLAGS" test "$cf_cv_ncurses_h2" != no && break done test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found) ]) CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2) cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header fi CF_ADD_INCDIR($cf_1st_incdir) fi # Set definitions to allow ifdef'ing for ncurses.h case $cf_cv_ncurses_header in (*ncurses.h) AC_DEFINE(HAVE_NCURSES_H,1,[Define to 1 if we have ncurses.h]) ;; esac case $cf_cv_ncurses_header in (ncurses/curses.h|ncurses/ncurses.h) AC_DEFINE(HAVE_NCURSES_NCURSES_H,1,[Define to 1 if we have ncurses/ncurses.h]) ;; (ncursesw/curses.h|ncursesw/ncurses.h) AC_DEFINE(HAVE_NCURSESW_NCURSES_H,1,[Define to 1 if we have ncursesw/ncurses.h]) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_LIBS version: 17 updated: 2015/04/15 19:08:48 dnl --------------- dnl Look for the ncurses library. This is a little complicated on Linux, dnl because it may be linked with the gpm (general purpose mouse) library. dnl Some distributions have gpm linked with (bsd) curses, which makes it dnl unusable with ncurses. However, we don't want to link with gpm unless dnl ncurses has a dependency, since gpm is normally set up as a shared library, dnl and the linker will record a dependency. dnl dnl The optional parameter gives the root name of the library, in case it is dnl not installed as the default curses library. That is how the dnl wide-character version of ncurses is installed. AC_DEFUN([CF_NCURSES_LIBS], [AC_REQUIRE([CF_NCURSES_CPPFLAGS]) cf_nculib_root=ifelse($1,,ncurses,$1) # This works, except for the special case where we find gpm, but # ncurses is in a nonstandard location via $LIBS, and we really want # to link gpm. cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" AC_CHECK_LIB(gpm,Gpm_Open, [AC_CHECK_LIB(gpm,initscr, [LIBS="$cf_ncurses_SAVE"], [cf_ncurses_LIBS="-lgpm"])]) case $host_os in (freebsd*) # This is only necessary if you are linking against an obsolete # version of ncurses (but it should do no harm, since it's static). if test "$cf_nculib_root" = ncurses ; then AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"]) fi ;; esac CF_ADD_LIBS($cf_ncurses_LIBS) if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) then CF_ADD_LIBS(-l$cf_nculib_root) else CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root, [#include <${cf_cv_ncurses_header:-curses.h}>], [initscr()], initscr) fi if test -n "$cf_ncurses_LIBS" ; then AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS) cf_ncurses_SAVE="$LIBS" for p in $cf_ncurses_LIBS ; do q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` if test "$q" != "$LIBS" ; then LIBS="$q" fi done AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) LIBS="$cf_ncurses_SAVE"]) fi CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root) AC_DEFINE_UNQUOTED($cf_nculib_ROOT) ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_VERSION version: 14 updated: 2012/10/06 08:57:51 dnl ------------------ dnl Check for the version of ncurses, to aid in reporting bugs, etc. dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't use dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi. AC_DEFUN([CF_NCURSES_VERSION], [ AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[ cf_cv_ncurses_version=no cf_tempfile=out$$ rm -f $cf_tempfile AC_TRY_RUN([ #include <${cf_cv_ncurses_header:-curses.h}> #include int main() { FILE *fp = fopen("$cf_tempfile", "w"); #ifdef NCURSES_VERSION # ifdef NCURSES_VERSION_PATCH fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); # else fprintf(fp, "%s\n", NCURSES_VERSION); # endif #else # ifdef __NCURSES_H fprintf(fp, "old\n"); # else make an error # endif #endif ${cf_cv_main_return:-return}(0); }],[ cf_cv_ncurses_version=`cat $cf_tempfile`],,[ # This will not work if the preprocessor splits the line after the # Autoconf token. The 'unproto' program does that. cat > conftest.$ac_ext < #undef Autoconf #ifdef NCURSES_VERSION Autoconf NCURSES_VERSION #else #ifdef __NCURSES_H Autoconf "old" #endif ; #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out" AC_TRY_EVAL(cf_try) if test -f conftest.out ; then cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" rm -f conftest.out fi ]) rm -f $cf_tempfile ]) test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_OBJ_SUBDIR version: 7 updated: 2015/04/17 21:13:04 dnl ------------- dnl Compute the object-directory name from the given model name AC_DEFUN([CF_OBJ_SUBDIR], [ case $1 in (libtool) $2='obj_lo' ;; (normal) $2='objects' ;; (debug) $2='obj_g' ;; (profile) $2='obj_p' ;; (shared) case $cf_cv_system_name in (cygwin|msys) $2='objects' ;; (*) $2='obj_s' ;; esac esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_PATHSEP version: 7 updated: 2015/04/12 15:39:00 dnl ---------- dnl Provide a value for the $PATH and similar separator (or amend the value dnl as provided in autoconf 2.5x). AC_DEFUN([CF_PATHSEP], [ AC_MSG_CHECKING(for PATH separator) case $cf_cv_system_name in (os2*) PATH_SEPARATOR=';' ;; (*) ${PATH_SEPARATOR:=':'} ;; esac ifelse([$1],,,[$1=$PATH_SEPARATOR]) AC_SUBST(PATH_SEPARATOR) AC_MSG_RESULT($PATH_SEPARATOR) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PATH_SYNTAX version: 16 updated: 2015/04/18 08:56:57 dnl -------------- dnl Check the argument to see that it looks like a pathname. Rewrite it if it dnl begins with one of the prefix/exec_prefix variables, and then again if the dnl result begins with 'NONE'. This is necessary to work around autoconf's dnl delayed evaluation of those symbols. AC_DEFUN([CF_PATH_SYNTAX],[ if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".[$]$1" in (.\[$]\(*\)*|.\'*\'*) ;; (..|./*|.\\*) ;; (.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX ;; (.\[$]{*prefix}*|.\[$]{*dir}*) eval $1="[$]$1" case ".[$]$1" in (.NONE/*) $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (.no|.NONE/*) $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; (*) ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_PKG_CONFIG version: 10 updated: 2015/04/26 18:06:58 dnl ------------- dnl Check for the package-config program, unless disabled by command-line. AC_DEFUN([CF_PKG_CONFIG], [ AC_MSG_CHECKING(if you want to use pkg-config) AC_ARG_WITH(pkg-config, [ --with-pkg-config{=path} enable/disable use of pkg-config], [cf_pkg_config=$withval], [cf_pkg_config=yes]) AC_MSG_RESULT($cf_pkg_config) case $cf_pkg_config in (no) PKG_CONFIG=none ;; (yes) CF_ACVERSION_CHECK(2.52, [AC_PATH_TOOL(PKG_CONFIG, pkg-config, none)], [AC_PATH_PROG(PKG_CONFIG, pkg-config, none)]) ;; (*) PKG_CONFIG=$withval ;; esac test -z "$PKG_CONFIG" && PKG_CONFIG=none if test "$PKG_CONFIG" != none ; then CF_PATH_SYNTAX(PKG_CONFIG) elif test "x$cf_pkg_config" != xno ; then AC_MSG_WARN(pkg-config is not installed) fi AC_SUBST(PKG_CONFIG) ])dnl dnl --------------------------------------------------------------------------- dnl CF_POSIX_C_SOURCE version: 9 updated: 2015/04/12 15:39:00 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl dnl POSIX.1-1990 _POSIX_SOURCE dnl POSIX.1-1990 and _POSIX_SOURCE and dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2 dnl Bindings Option dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L dnl X/Open 2000 _POSIX_C_SOURCE=200112L dnl dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], [ cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE) CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE) AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ CF_MSG_LOG(if the symbol is already defined go no further) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE make an error #endif], [cf_cv_posix_c_source=no], [cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[[12]]??*) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; (.2) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; (.*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then AC_TRY_COMPILE([#include ],[ #ifdef _POSIX_SOURCE make an error #endif],[], cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE") fi CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" CF_MSG_LOG(if the second compile does not leave our definition intact error) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE make an error #endif],, [cf_cv_posix_c_source=no]) CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" ]) ]) if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" CF_ADD_CFLAGS($cf_cv_posix_c_source) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22 dnl ---------- dnl Check for archiver "ar". AC_DEFUN([CF_PROG_AR],[ AC_CHECK_TOOL(AR, ar, ar) ]) dnl --------------------------------------------------------------------------- dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59 dnl ----------- dnl Check for awk, ensure that the check found something. AC_DEFUN([CF_PROG_AWK], [ AC_PROG_AWK test -z "$AWK" && AC_MSG_ERROR(No awk program found) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_CC version: 4 updated: 2014/07/12 18:57:58 dnl ---------- dnl standard check for CC, plus followup sanity checks dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name AC_DEFUN([CF_PROG_CC],[ ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)]) CF_GCC_VERSION CF_ACVERSION_CHECK(2.52, [AC_PROG_CC_STDC], [CF_ANSI_CC_REQD]) CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_CC_C_O version: 5 updated: 2017/01/21 11:06:25 dnl -------------- dnl Analogous to AC_PROG_CC_C_O, but more useful: tests only $CC, ensures that dnl the output file can be renamed, and allows for a shell variable that can dnl be used later. The parameter is either CC or CXX. The result is the dnl cache variable: dnl $cf_cv_prog_CC_c_o dnl $cf_cv_prog_CXX_c_o dnl dnl $1 = compiler dnl $2 = compiler options, if any AC_DEFUN([CF_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])dnl AC_MSG_CHECKING([whether [$]$1 understands -c and -o together]) AC_CACHE_VAL(cf_cv_prog_$1_c_o, [ cat > conftest.$ac_ext </dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) test -z "$EGREP" && AC_MSG_ERROR(No egrep program found) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_EXT version: 13 updated: 2015/04/18 09:03:58 dnl ----------- dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX. AC_DEFUN([CF_PROG_EXT], [ AC_REQUIRE([CF_CHECK_CACHE]) case $cf_cv_system_name in (os2*) CFLAGS="$CFLAGS -Zmt" CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" CXXFLAGS="$CXXFLAGS -Zmt" # autoconf's macro sets -Zexe and suffix both, which conflict:w LDFLAGS="$LDFLAGS -Zmt -Zcrtdll" ac_cv_exeext=.exe ;; esac AC_EXEEXT AC_OBJEXT PROG_EXT="$EXEEXT" AC_SUBST(PROG_EXT) test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT",[Define to the program extension (normally blank)]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_GNAT version: 3 updated: 2015/04/18 08:56:57 dnl ------------ dnl Check for gnatmake, ensure that it is complete. AC_DEFUN([CF_PROG_GNAT],[ cf_ada_make=gnatmake AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= cf_cv_prog_gnat_correct=no else CF_GNAT_VERSION AC_CHECK_PROG(M4_exists, m4, yes, no) if test "$ac_cv_prog_M4_exists" = no; then cf_cv_prog_gnat_correct=no echo Ada95 binding required program m4 not found. Ada95 binding disabled. fi if test "$cf_cv_prog_gnat_correct" = yes; then AC_MSG_CHECKING(if GNAT works) CF_GNAT_TRY_RUN([procedure conftest;], [with Text_IO; with GNAT.OS_Lib; procedure conftest is begin Text_IO.Put ("Hello World"); Text_IO.New_Line; GNAT.OS_Lib.OS_Exit (0); end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no]) AC_MSG_RESULT($cf_cv_prog_gnat_correct) fi fi AC_SUBST(cf_ada_make) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37 dnl ------------ dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f" dnl option if it is supported. AC_DEFUN([CF_PROG_LN_S],[ AC_PROG_LN_S AC_MSG_CHECKING(if $LN_S -f options work) rm -f conf$$.src conf$$dst echo >conf$$.dst echo first >conf$$.src if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then cf_prog_ln_sf=yes else cf_prog_ln_sf=no fi rm -f conf$$.dst conf$$src AC_MSG_RESULT($cf_prog_ln_sf) test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 dnl ---------------- dnl Remove all -U and -D options that refer to the given symbol from a list dnl of C compiler options. This works around the problem that not all dnl compilers process -U and -D options from left-to-right, so a -U option dnl cannot be used to cancel the effect of a preceding -D option. dnl dnl $1 = target (which could be the same as the source variable) dnl $2 = source (including '$') dnl $3 = symbol to remove define([CF_REMOVE_DEFINE], [ $1=`echo "$2" | \ sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_LIB version: 1 updated: 2007/02/17 14:11:52 dnl ------------- dnl Remove the given library from the symbol dnl dnl $1 = target (which could be the same as the source variable) dnl $2 = source (including '$') dnl $3 = library to remove define([CF_REMOVE_LIB], [ # remove $3 library from $2 $1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_SHARED_OPTS version: 90 updated: 2017/02/11 14:48:57 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared dnl library. dnl dnl Notes: dnl a) ${LOCAL_LDFLAGS} is used to link executables that will run within dnl the build-tree, i.e., by making use of the libraries that are compiled in dnl $rel_builddir/lib We avoid compiling-in a $rel_builddir/lib path for the dnl shared library since that can lead to unexpected results at runtime. dnl b) ${LOCAL_LDFLAGS2} has the same intention but assumes that the shared dnl libraries are compiled in ../../lib dnl dnl The variable 'cf_cv_do_symlinks' is used to control whether we configure dnl to install symbolic links to the rel/abi versions of shared libraries. dnl dnl The variable 'cf_cv_shlib_version' controls whether we use the rel or abi dnl version when making symbolic links. dnl dnl The variable 'cf_cv_shlib_version_infix' controls whether shared library dnl version numbers are infix (ex: libncurses..dylib) or postfix dnl (ex: libncurses.so.). dnl dnl Some loaders leave 'so_locations' lying around. It's nice to clean up. AC_DEFUN([CF_SHARED_OPTS], [ AC_REQUIRE([CF_LD_RPATH_OPT]) RM_SHARED_OPTS= LOCAL_LDFLAGS= LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" : ${rel_builddir:=.} shlibdir=$libdir AC_SUBST(shlibdir) MAKE_DLLS="#" AC_SUBST(MAKE_DLLS) cf_cv_do_symlinks=no cf_ld_rpath_opt= test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" AC_MSG_CHECKING(if release/abi version should be used for shared libs) AC_ARG_WITH(shlib-version, [ --with-shlib-version=X Specify rel or abi version for shared libs], [test -z "$withval" && withval=auto case $withval in (yes) cf_cv_shlib_version=auto ;; (rel|abi|auto) cf_cv_shlib_version=$withval ;; (*) AC_MSG_RESULT($withval) AC_MSG_ERROR([option value must be one of: rel, abi, or auto]) ;; esac ],[cf_cv_shlib_version=auto]) AC_MSG_RESULT($cf_cv_shlib_version) cf_cv_rm_so_locs=no cf_try_cflags= # Some less-capable ports of gcc support only -fpic CC_SHARED_OPTS= cf_try_fPIC=no if test "$GCC" = yes then cf_try_fPIC=yes else case $cf_cv_system_name in (*linux*) # e.g., PGI compiler cf_try_fPIC=yes ;; esac fi if test "$cf_try_fPIC" = yes then AC_MSG_CHECKING(which $CC option to use) cf_save_CFLAGS="$CFLAGS" for CC_SHARED_OPTS in -fPIC -fpic '' do CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" AC_TRY_COMPILE([#include ],[int x = 1],[break],[]) done AC_MSG_RESULT($CC_SHARED_OPTS) CFLAGS="$cf_save_CFLAGS" fi cf_cv_shlib_version_infix=no case $cf_cv_system_name in (aix4.[3-9]*|aix[[5-7]]*) if test "$GCC" = yes; then CC_SHARED_OPTS='-Wl,-brtl' MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o [$]@' else CC_SHARED_OPTS='-brtl' # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall" MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o [$]@' fi ;; (beos*) MK_SHARED_LIB='${CC} ${CFLAGS} -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0' ;; (cygwin*) CC_SHARED_OPTS= MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a" cf_cv_shlib_version=cygdll cf_cv_shlib_version_infix=cygdll shlibdir=$bindir MAKE_DLLS= cat >mk_shared_lib.sh <<-CF_EOF #!$SHELL SHARED_LIB=\[$]1 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/cyg/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\` shift cat <<-EOF Linking shared library ** SHARED_LIB \[$]SHARED_LIB ** IMPORT_LIB \[$]IMPORT_LIB EOF exec \[$]* -shared -Wl,--out-implib=\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o \[$]{SHARED_LIB} CF_EOF chmod +x mk_shared_lib.sh ;; (msys*) CC_SHARED_OPTS= MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a" cf_cv_shlib_version=msysdll cf_cv_shlib_version_infix=msysdll shlibdir=$bindir MAKE_DLLS= cat >mk_shared_lib.sh <<-CF_EOF #!$SHELL SHARED_LIB=\[$]1 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/msys-/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\` shift cat <<-EOF Linking shared library ** SHARED_LIB \[$]SHARED_LIB ** IMPORT_LIB \[$]IMPORT_LIB EOF exec \[$]* -shared -Wl,--out-implib=\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o \[$]{SHARED_LIB} CF_EOF chmod +x mk_shared_lib.sh ;; (darwin*) cf_try_cflags="no-cpp-precomp" CC_SHARED_OPTS="-dynamic" MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi cf_cv_shlib_version_infix=yes AC_CACHE_CHECK([if ld -search_paths_first works], cf_cv_ldflags_search_paths_first, [ cf_save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" AC_TRY_LINK(, [int i;], cf_cv_ldflags_search_paths_first=yes, cf_cv_ldflags_search_paths_first=no) LDFLAGS=$cf_save_LDFLAGS]) if test $cf_cv_ldflags_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi ;; (hpux[[7-8]]*) # HP-UX 8.07 ld lacks "+b" option used for libdir search-list if test "$GCC" != yes; then CC_SHARED_OPTS='+Z' fi MK_SHARED_LIB='${LD} -b -o $[@]' INSTALL_LIB="-m 555" ;; (hpux*) # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}' else CC_SHARED_OPTS='+Z' LD_SHARED_OPTS='-Wl,+b,${libdir}' fi MK_SHARED_LIB='${LD} +b ${libdir} -b -o $[@]' # HP-UX shared libraries must be executable, and should be # readonly to exploit a quirk in the memory manager. INSTALL_LIB="-m 555" ;; (interix*) test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel if test "$cf_cv_shlib_version" = rel; then cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}' else cf_shared_soname='`basename $@`' fi CC_SHARED_OPTS= MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@' ;; (irix*) if test "$cf_cv_enable_rpath" = yes ; then EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS" fi # tested with IRIX 5.2 and 'cc'. if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $[@]` -o $[@]' else MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $[@]` -o $[@]' fi cf_cv_rm_so_locs=yes ;; (linux*|gnu*|k*bsd*-gnu) if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_enable_rpath" = yes ; then EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; (mingw*) cf_cv_shlib_version=mingw cf_cv_shlib_version_infix=mingw shlibdir=$bindir MAKE_DLLS= if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-Wl,--enable-auto-import" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS" fi CC_SHARED_OPTS= MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a" cat >mk_shared_lib.sh <<-CF_EOF #!$SHELL SHARED_LIB=\[$]1 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/[[0-9]]*\.dll[$]/.dll.a/'\` shift cat <<-EOF Linking shared library ** SHARED_LIB \[$]SHARED_LIB ** IMPORT_LIB \[$]IMPORT_LIB EOF exec \[$]* -shared -Wl,--enable-auto-import,--out-implib=\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o \[$]{SHARED_LIB} CF_EOF chmod +x mk_shared_lib.sh ;; (openbsd[[2-9]].*|mirbsd*) if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_enable_rpath" = yes ; then EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS" fi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; (nto-qnx*|openbsd*|freebsd[[12]].*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='${LD} -Bshareable -o $[@]' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; (dragonfly*|freebsd*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS" EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; (netbsd*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS" if test "$cf_cv_shlib_version" = auto; then if test -f /usr/libexec/ld.elf_so; then cf_cv_shlib_version=abi else cf_cv_shlib_version=rel fi fi CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]' else MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $[@]' fi ;; (osf*|mls+*) # tested with OSF/1 V3.2 and 'cc' # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $[@]`' case $host_os in (osf4*) MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]' if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi cf_cv_rm_so_locs=yes ;; (sco3.2v5*) # also uw2* and UW7: hops 13-Apr-98 # tested with osr5.0.5 if test "$GCC" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='${LD} -dy -G -h `basename $[@] .${REL_VERSION}`.${ABI_VERSION} -o [$]@' if test "$cf_cv_enable_rpath" = yes ; then # only way is to set LD_RUN_PATH but no switch for it RUN_PATH=$libdir fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel LINK_PROGS='LD_RUN_PATH=${libdir}' LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' ;; (sunos4*) # tested with SunOS 4.1.1 and gcc 2.7.0 if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='${LD} -assert pure-text -o $[@]' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; (solaris2*) # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_enable_rpath" = yes ; then EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME if test "$GCC" != yes; then cf_save_CFLAGS="$CFLAGS" for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O do CFLAGS="$cf_shared_opts $cf_save_CFLAGS" AC_TRY_COMPILE([#include ],[printf("Hello\n");],[break]) done CFLAGS="$cf_save_CFLAGS" CC_SHARED_OPTS=$cf_shared_opts MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $[@]' else MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]' fi ;; (sysv5uw7*|unix_sv*) # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='${LD} -d y -G -o [$]@' ;; (*) CC_SHARED_OPTS='unknown' MK_SHARED_LIB='echo unknown' ;; esac # This works if the last tokens in $MK_SHARED_LIB are the -o target. case "$cf_cv_shlib_version" in (rel|abi) case "$MK_SHARED_LIB" in (*'-o $[@]') test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes ;; (*) AC_MSG_WARN(ignored --with-shlib-version) ;; esac ;; esac if test -n "$cf_try_cflags" then cat > conftest.$ac_ext < int main(int argc, char *argv[[]]) { printf("hello\n"); return (argv[[argc-1]] == 0) ; } EOF cf_save_CFLAGS="$CFLAGS" for cf_opt in $cf_try_cflags do CFLAGS="$cf_save_CFLAGS -$cf_opt" AC_MSG_CHECKING(if CFLAGS option -$cf_opt works) if AC_TRY_EVAL(ac_compile); then AC_MSG_RESULT(yes) cf_save_CFLAGS="$CFLAGS" else AC_MSG_RESULT(no) fi done CFLAGS="$cf_save_CFLAGS" fi # RPATH_LIST is a colon-separated list of directories test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}" test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}" test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations" CF_VERBOSE(CC_SHARED_OPTS: $CC_SHARED_OPTS) CF_VERBOSE(MK_SHARED_LIB: $MK_SHARED_LIB) AC_SUBST(CC_SHARED_OPTS) AC_SUBST(LD_RPATH_OPT) AC_SUBST(LD_SHARED_OPTS) AC_SUBST(MK_SHARED_LIB) AC_SUBST(RM_SHARED_OPTS) AC_SUBST(LINK_PROGS) AC_SUBST(LINK_TESTS) AC_SUBST(EXTRA_LDFLAGS) AC_SUBST(LOCAL_LDFLAGS) AC_SUBST(LOCAL_LDFLAGS2) AC_SUBST(INSTALL_LIB) AC_SUBST(RPATH_LIST) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SHARED_SONAME version: 3 updated: 2008/09/08 18:34:43 dnl ---------------- dnl utility macro for CF_SHARED_OPTS, constructs "$cf_cv_shared_soname" for dnl substitution into MK_SHARED_LIB string for the "-soname" (or similar) dnl option. dnl dnl $1 is the default that should be used for "$cf_cv_shlib_version". dnl If missing, use "rel". define([CF_SHARED_SONAME], [ test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=ifelse($1,,rel,$1) if test "$cf_cv_shlib_version" = rel; then cf_cv_shared_soname='`basename $[@] .${REL_VERSION}`.${ABI_VERSION}' else cf_cv_shared_soname='`basename $[@]`' fi ]) dnl --------------------------------------------------------------------------- dnl CF_STRIP_G_OPT version: 3 updated: 2002/12/21 19:25:52 dnl -------------- dnl Remove "-g" option from the compiler options AC_DEFUN([CF_STRIP_G_OPT], [$1=`echo ${$1} | sed -e 's%-g %%' -e 's%-g$%%'`])dnl dnl --------------------------------------------------------------------------- dnl CF_SUBDIR_PATH version: 7 updated: 2014/12/04 04:33:06 dnl -------------- dnl Construct a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result dnl $2 = the package name dnl $3 = the subdirectory, e.g., bin, include or lib AC_DEFUN([CF_SUBDIR_PATH], [ $1= CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ [$]HOME do CF_ADD_SUBDIR_PATH($1,$2,$3,$cf_subdir_prefix,$prefix) done ])dnl dnl --------------------------------------------------------------------------- dnl CF_TERM_HEADER version: 4 updated: 2015/04/15 19:08:48 dnl -------------- dnl Look for term.h, which is part of X/Open curses. It defines the interface dnl to terminfo database. Usually it is in the same include-path as curses.h, dnl but some packagers change this, breaking various applications. AC_DEFUN([CF_TERM_HEADER],[ AC_CACHE_CHECK(for terminfo header, cf_cv_term_header,[ case ${cf_cv_ncurses_header} in (*/ncurses.h|*/ncursesw.h) cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[[^.]]*\.h$%term.h%'` ;; (*) cf_term_header=term.h ;; esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do AC_TRY_COMPILE([#include #include <${cf_cv_ncurses_header:-curses.h}> #include <$cf_test> ],[int x = auto_left_margin],[ cf_cv_term_header="$cf_test"],[ cf_cv_term_header=unknown ]) test "$cf_cv_term_header" != unknown && break done ]) # Set definitions to allow ifdef'ing to accommodate subdirectories case $cf_cv_term_header in (*term.h) AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h]) ;; esac case $cf_cv_term_header in (ncurses/term.h) AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h]) ;; (ncursesw/term.h) AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h]) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_TOP_BUILDDIR version: 2 updated: 2013/07/27 17:38:32 dnl --------------- dnl Define a top_builddir symbol, for applications that need an absolute path. AC_DEFUN([CF_TOP_BUILDDIR], [ top_builddir=ifelse($1,,`pwd`,$1) AC_SUBST(top_builddir) ])dnl dnl --------------------------------------------------------------------------- dnl CF_TRY_XOPEN_SOURCE version: 1 updated: 2011/10/30 17:09:50 dnl ------------------- dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we dnl can define it successfully. AC_DEFUN([CF_TRY_XOPEN_SOURCE],[ AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ AC_TRY_COMPILE([ #include #include #include ],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" AC_TRY_COMPILE([ #include #include #include ],[ #ifdef _XOPEN_SOURCE make an error #endif], [cf_cv_xopen_source=no], [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) CPPFLAGS="$cf_save" ]) ]) if test "$cf_cv_xopen_source" != no ; then CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" CF_ADD_CFLAGS($cf_temp_xopen_source) fi ]) dnl --------------------------------------------------------------------------- dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59 dnl -------- dnl Make an uppercase version of a variable dnl $1=uppercase($2) AC_DEFUN([CF_UPPER], [ $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- dnl CF_UTF8_LIB version: 8 updated: 2012/10/06 08:57:51 dnl ----------- dnl Check for multibyte support, and if not found, utf8 compatibility library AC_DEFUN([CF_UTF8_LIB], [ AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[ cf_save_LIBS="$LIBS" AC_TRY_LINK([ #include ],[putwc(0,0);], [cf_cv_utf8_lib=yes], [CF_FIND_LINKAGE([ #include ],[putwc(0,0);],utf8, [cf_cv_utf8_lib=add-on], [cf_cv_utf8_lib=no]) ])]) # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between # ncurses/ncursesw: if test "$cf_cv_utf8_lib" = "add-on" ; then AC_DEFINE(HAVE_LIBUTF8_H,1,[Define to 1 if we should include libutf8.h]) CF_ADD_INCDIR($cf_cv_header_path_utf8) CF_ADD_LIBDIR($cf_cv_library_path_utf8) CF_ADD_LIBS($cf_cv_library_file_utf8) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 dnl ---------- dnl Use AC_VERBOSE w/o the warnings AC_DEFUN([CF_VERBOSE], [test -n "$verbose" && echo " $1" 1>&AC_FD_MSG CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WEAK_SYMBOLS version: 1 updated: 2008/08/16 19:18:06 dnl --------------- dnl Check for compiler-support for weak symbols. dnl This works with "recent" gcc. AC_DEFUN([CF_WEAK_SYMBOLS],[ AC_CACHE_CHECK(if $CC supports weak symbols,cf_cv_weak_symbols,[ AC_TRY_COMPILE([ #include ], [ #if defined(__GNUC__) # if defined __USE_ISOC99 # define _cat_pragma(exp) _Pragma(#exp) # define _weak_pragma(exp) _cat_pragma(weak name) # else # define _weak_pragma(exp) # endif # define _declare(name) __extension__ extern __typeof__(name) name # define weak_symbol(name) _weak_pragma(name) _declare(name) __attribute__((weak)) #endif weak_symbol(fopen); ],[cf_cv_weak_symbols=yes],[cf_cv_weak_symbols=no]) ]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_ADA_COMPILER version: 2 updated: 2010/06/26 17:35:58 dnl -------------------- dnl Command-line option to specify the Ada95 compiler. AC_DEFUN([CF_WITH_ADA_COMPILER],[ AC_MSG_CHECKING(for ada-compiler) AC_ARG_WITH(ada-compiler, [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], [cf_ada_compiler=$withval], [cf_ada_compiler=gnatmake]) AC_SUBST(cf_ada_compiler) AC_MSG_RESULT($cf_ada_compiler) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_ADA_INCLUDE version: 2 updated: 2010/06/26 17:35:58 dnl ------------------- dnl Command-line option to specify where Ada includes will install. AC_DEFUN([CF_WITH_ADA_INCLUDE],[ AC_MSG_CHECKING(for ada-include) CF_WITH_PATH(ada-include, [ --with-ada-include=DIR Ada includes are in DIR], ADA_INCLUDE, PREFIX/share/ada/adainclude, [$]prefix/share/ada/adainclude) AC_SUBST(ADA_INCLUDE) AC_MSG_RESULT($ADA_INCLUDE) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_ADA_OBJECTS version: 2 updated: 2010/06/26 17:35:58 dnl ------------------- dnl Command-line option to specify where Ada objects will install. AC_DEFUN([CF_WITH_ADA_OBJECTS],[ AC_MSG_CHECKING(for ada-objects) CF_WITH_PATH(ada-objects, [ --with-ada-objects=DIR Ada objects are in DIR], ADA_OBJECTS, PREFIX/lib/ada/adalib, [$]prefix/lib/ada/adalib) AC_SUBST(ADA_OBJECTS) AC_MSG_RESULT($ADA_OBJECTS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_ADA_SHAREDLIB version: 4 updated: 2014/05/31 21:08:37 dnl --------------------- dnl Command-line option to specify if an Ada95 shared-library should be built, dnl and optionally what its soname should be. AC_DEFUN([CF_WITH_ADA_SHAREDLIB],[ AC_MSG_CHECKING(if an Ada95 shared-library should be built) AC_ARG_WITH(ada-sharedlib, [ --with-ada-sharedlib=soname build shared-library (requires GNAT projects)], [with_ada_sharedlib=$withval], [with_ada_sharedlib=no]) AC_MSG_RESULT($with_ada_sharedlib) ADA_SHAREDLIB='lib$(LIB_NAME).so.1' MAKE_ADA_SHAREDLIB="#" if test "x$with_ada_sharedlib" != xno then MAKE_ADA_SHAREDLIB= if test "x$with_ada_sharedlib" != xyes then ADA_SHAREDLIB="$with_ada_sharedlib" fi fi AC_SUBST(ADA_SHAREDLIB) AC_SUBST(MAKE_ADA_SHAREDLIB) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_CURSES_DIR version: 3 updated: 2010/11/20 17:02:38 dnl ------------------ dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses dnl libraries. AC_DEFUN([CF_WITH_CURSES_DIR],[ AC_MSG_CHECKING(for specific curses-directory) AC_ARG_WITH(curses-dir, [ --with-curses-dir=DIR directory in which (n)curses is installed], [cf_cv_curses_dir=$withval], [cf_cv_curses_dir=no]) AC_MSG_RESULT($cf_cv_curses_dir) if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) then CF_PATH_SYNTAX(withval) if test -d "$cf_cv_curses_dir" then CF_ADD_INCDIR($cf_cv_curses_dir/include) CF_ADD_LIBDIR($cf_cv_curses_dir/lib) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_LIB_PREFIX version: 1 updated: 2012/01/21 19:28:10 dnl ------------------ dnl Allow the library-prefix to be overridden. OS/2 EMX originally had no dnl "lib" prefix, e.g., because it used the dll naming convention. dnl dnl $1 = variable to set AC_DEFUN([CF_WITH_LIB_PREFIX], [ AC_MSG_CHECKING(if you want to have a library-prefix) AC_ARG_WITH(lib-prefix, [ --with-lib-prefix override library-prefix], [with_lib_prefix=$withval], [with_lib_prefix=auto]) AC_MSG_RESULT($with_lib_prefix) if test $with_lib_prefix = auto then CF_LIB_PREFIX($1) elif test $with_lib_prefix = no then LIB_PREFIX= else LIB_PREFIX=$with_lib_prefix fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_PATH version: 11 updated: 2012/09/29 15:04:19 dnl ------------ dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just dnl defaulting to yes/no. dnl dnl $1 = option name dnl $2 = help-text dnl $3 = environment variable to set dnl $4 = default value, shown in the help-message, must be a constant dnl $5 = default value, if it's an expression & cannot be in the help-message dnl AC_DEFUN([CF_WITH_PATH], [AC_ARG_WITH($1,[$2 ](default: ifelse([$4],,empty,[$4])),, ifelse([$4],,[withval="${$3}"],[withval="${$3:-ifelse([$5],,[$4],[$5])}"]))dnl if ifelse([$5],,true,[test -n "$5"]) ; then CF_PATH_SYNTAX(withval) fi eval $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_PKG_CONFIG_LIBDIR version: 10 updated: 2015/08/22 17:10:56 dnl ------------------------- dnl Allow the choice of the pkg-config library directory to be overridden. AC_DEFUN([CF_WITH_PKG_CONFIG_LIBDIR],[ case $PKG_CONFIG in (no|none|yes) AC_MSG_CHECKING(for pkg-config library directory) ;; (*) AC_MSG_CHECKING(for $PKG_CONFIG library directory) ;; esac PKG_CONFIG_LIBDIR=no AC_ARG_WITH(pkg-config-libdir, [ --with-pkg-config-libdir=XXX use given directory for installing pc-files], [PKG_CONFIG_LIBDIR=$withval], [test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes]) case x$PKG_CONFIG_LIBDIR in (x/*) ;; (xyes) # Look for the library directory using the same prefix as the executable if test "x$PKG_CONFIG" = xnone then cf_path=$prefix else cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'` fi # If you don't like using the default architecture, you have to specify the # intended library directory and corresponding compiler/linker options. # # This case allows for Debian's 2014-flavor of multiarch, along with the # most common variations before that point. Some other variants spell the # directory differently, e.g., "pkg-config", and put it in unusual places. # pkg-config has always been poorly standardized, which is ironic... case x`(arch) 2>/dev/null` in (*64) cf_search_path="\ $cf_path/lib/*64-linux-gnu \ $cf_path/share \ $cf_path/lib64 \ $cf_path/lib32 \ $cf_path/lib" ;; (*) cf_search_path="\ $cf_path/lib/*-linux-gnu \ $cf_path/share \ $cf_path/lib32 \ $cf_path/lib \ $cf_path/libdata" ;; esac CF_VERBOSE(list...) for cf_config in $cf_search_path do CF_VERBOSE(checking $cf_config/pkgconfig) if test -d $cf_config/pkgconfig then PKG_CONFIG_LIBDIR=$cf_config/pkgconfig AC_MSG_CHECKING(done) break fi done ;; (*) ;; esac if test "x$PKG_CONFIG_LIBDIR" != xno ; then AC_MSG_RESULT($PKG_CONFIG_LIBDIR) fi AC_SUBST(PKG_CONFIG_LIBDIR) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_PTHREAD version: 7 updated: 2015/04/18 08:56:57 dnl --------------- dnl Check for POSIX thread library. AC_DEFUN([CF_WITH_PTHREAD], [ AC_MSG_CHECKING(if you want to link with the pthread library) AC_ARG_WITH(pthread, [ --with-pthread use POSIX thread library], [with_pthread=$withval], [with_pthread=no]) AC_MSG_RESULT($with_pthread) if test "$with_pthread" != no ; then AC_CHECK_HEADER(pthread.h,[ AC_DEFINE(HAVE_PTHREADS_H,1,[Define to 1 if we have pthreads.h header]) for cf_lib_pthread in pthread c_r do AC_MSG_CHECKING(if we can link with the $cf_lib_pthread library) cf_save_LIBS="$LIBS" CF_ADD_LIB($cf_lib_pthread) AC_TRY_LINK([ #include ],[ int rc = pthread_create(0,0,0,0); int r2 = pthread_mutexattr_settype(0, 0); ],[with_pthread=yes],[with_pthread=no]) LIBS="$cf_save_LIBS" AC_MSG_RESULT($with_pthread) test "$with_pthread" = yes && break done if test "$with_pthread" = yes ; then CF_ADD_LIB($cf_lib_pthread) AC_DEFINE(HAVE_LIBPTHREADS,1,[Define to 1 if we have pthreads library]) else AC_MSG_ERROR(Cannot link with pthread library) fi ]) fi ]) dnl --------------------------------------------------------------------------- dnl CF_WITH_SYSTYPE version: 1 updated: 2013/01/26 16:26:12 dnl --------------- dnl For testing, override the derived host system-type which is used to decide dnl things such as the linker commands used to build shared libraries. This is dnl normally chosen automatically based on the type of system which you are dnl building on. We use it for testing the configure script. dnl dnl This is different from the --host option: it is used only for testing parts dnl of the configure script which would not be reachable with --host since that dnl relies on the build environment being real, rather than mocked up. AC_DEFUN([CF_WITH_SYSTYPE],[ CF_CHECK_CACHE([AC_CANONICAL_SYSTEM]) AC_ARG_WITH(system-type, [ --with-system-type=XXX test: override derived host system-type], [AC_MSG_WARN(overriding system type to $withval) cf_cv_system_name=$withval host_os=$withval ]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_XOPEN_SOURCE version: 52 updated: 2016/08/27 12:21:42 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, dnl without losing the common non-POSIX features. dnl dnl Parameters: dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ AC_REQUIRE([AC_CANONICAL_HOST]) cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) cf_xopen_source= case $host_os in (aix[[4-7]]*) cf_xopen_source="-D_ALL_SOURCE" ;; (msys) cf_XOPEN_SOURCE=600 ;; (darwin[[0-8]].*) cf_xopen_source="-D_APPLE_C_SOURCE" ;; (darwin*) cf_xopen_source="-D_DARWIN_C_SOURCE" cf_XOPEN_SOURCE= ;; (freebsd*|dragonfly*) # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;; (hpux11*) cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; (hpux*) cf_xopen_source="-D_HPUX_SOURCE" ;; (irix[[56]].*) cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) CF_GNU_SOURCE ;; (minix*) cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this... ;; (mirbsd*) # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks and other headers which use u_int / u_short types cf_XOPEN_SOURCE= CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; (netbsd*) cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; (openbsd[[4-9]]*) # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=600 ;; (openbsd*) # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; (osf[[45]]*) cf_xopen_source="-D_OSF_SOURCE" ;; (nto-qnx*) cf_xopen_source="-D_QNX_SOURCE" ;; (sco*) # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; (solaris2.*) cf_xopen_source="-D__EXTENSIONS__" cf_cv_xopen_source=broken ;; (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2) cf_XOPEN_SOURCE= cf_POSIX_C_SOURCE= ;; (*) CF_TRY_XOPEN_SOURCE CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; esac if test -n "$cf_xopen_source" ; then CF_ADD_CFLAGS($cf_xopen_source,true) fi dnl In anything but the default case, we may have system-specific setting dnl which is still not guaranteed to provide all of the entrypoints that dnl _XOPEN_SOURCE would yield. if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then AC_MSG_CHECKING(if _XOPEN_SOURCE really is set) AC_TRY_COMPILE([#include ],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_XOPEN_SOURCE_set=yes], [cf_XOPEN_SOURCE_set=no]) AC_MSG_RESULT($cf_XOPEN_SOURCE_set) if test $cf_XOPEN_SOURCE_set = yes then AC_TRY_COMPILE([#include ],[ #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE make an error #endif], [cf_XOPEN_SOURCE_set_ok=yes], [cf_XOPEN_SOURCE_set_ok=no]) if test $cf_XOPEN_SOURCE_set_ok = no then AC_MSG_WARN(_XOPEN_SOURCE is lower than requested) fi else CF_TRY_XOPEN_SOURCE fi fi ]) AdaCurses-20170708/README0000644000175100001440000000440607746514446013262 0ustar tomusers------------------------------------------------------------------------------- -- Copyright (c) 1998,2003 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, 1996 The documentation is provided in HTML format in the ./html subdirectory. The main document is named index.html AdaCurses-20170708/samples/0000755000175100001440000000000013130303161014010 5ustar tomusersAdaCurses-20170708/samples/ncurses2-slk_test.ads0000644000175100001440000000567107212274052020116 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.slk_test; AdaCurses-20170708/samples/sample-form_demo-aux.ads0000644000175100001440000001163211541117334020536 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Form_Demo.Aux -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2011 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, 1996 -- Version Control -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; package Sample.Form_Demo.Aux is procedure Geometry (F : Form; L : out Line_Count; C : out Column_Count; Y : out Line_Position; X : out Column_Position); -- Calculate the geometry for a panel being able to be used to display -- the menu. function Create (F : Form; Title : String; Lin : Line_Position; Col : Column_Position) return Panel; -- Create a panel decorated with a frame and the title at the specified -- position. The dimension of the panel is derived from the menus layout. procedure Destroy (F : Form; P : in out Panel); -- Destroy all the windowing structures associated with this menu and -- panel. function Get_Request (F : Form; P : Panel; Handle_CRLF : Boolean := True) return Key_Code; -- Centralized request driver for all menus in this sample. This -- gives us a common key binding for all menus. function Make (Top : Line_Position; Left : Column_Position; Text : String) return Field; -- create a label function Make (Height : Line_Count := 1; Width : Column_Count; Top : Line_Position; Left : Column_Position; Off_Screen : Natural := 0) return Field; -- create a editable field function Default_Driver (F : Form; K : Key_Code; P : Panel) return Boolean; function Count_Active (F : Form) return Natural; -- Count the number of active fields in the form end Sample.Form_Demo.Aux; AdaCurses-20170708/samples/sample-curses_demo-attributes.adb0000644000175100001440000001302007746514446022461 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Curses_Demo.Attributes -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.13 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Sample.Manifest; use Sample.Manifest; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Explanation; use Sample.Explanation; package body Sample.Curses_Demo.Attributes is procedure Demo is P : Panel := Create (Standard_Window); K : Real_Key_Code; begin Set_Meta_Mode; Set_KeyPad_Mode; Top (P); Push_Environment ("ATTRIBDEMO"); Default_Labels; Notepad ("ATTRIB-PAD00"); Set_Character_Attributes (Attr => (others => False)); Add (Line => 1, Column => Columns / 2 - 10, Str => "This is NORMAL"); Set_Character_Attributes (Attr => (Stand_Out => True, others => False)); Add (Line => 2, Column => Columns / 2 - 10, Str => "This is Stand_Out"); Set_Character_Attributes (Attr => (Under_Line => True, others => False)); Add (Line => 3, Column => Columns / 2 - 10, Str => "This is Under_Line"); Set_Character_Attributes (Attr => (Reverse_Video => True, others => False)); Add (Line => 4, Column => Columns / 2 - 10, Str => "This is Reverse_Video"); Set_Character_Attributes (Attr => (Blink => True, others => False)); Add (Line => 5, Column => Columns / 2 - 10, Str => "This is Blink"); Set_Character_Attributes (Attr => (Dim_Character => True, others => False)); Add (Line => 6, Column => Columns / 2 - 10, Str => "This is Dim_Character"); Set_Character_Attributes (Attr => (Bold_Character => True, others => False)); Add (Line => 7, Column => Columns / 2 - 10, Str => "This is Bold_Character"); Refresh_Without_Update; Update_Panels; Update_Screen; loop K := Get_Key; if K in Special_Key_Code'Range then case K is when QUIT_CODE => exit; when HELP_CODE => Explain_Context; when EXPLAIN_CODE => Explain ("ATTRIBKEYS"); when others => null; end case; end if; end loop; Pop_Environment; Clear; Refresh_Without_Update; Delete (P); Update_Panels; Update_Screen; end Demo; end Sample.Curses_Demo.Attributes; AdaCurses-20170708/samples/rain.ads0000644000175100001440000000602407746514446015466 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Rain -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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: Laurent Pautet -- Modified by: Juergen Pfeifer, 1997 -- Version Control -- $Revision: 1.7 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- -- procedure Rain; AdaCurses-20170708/samples/ncurses2-demo_pad.adb0000644000175100001440000005764112405113232020011 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2011,2014 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.9 $ -- $Date: 2014/09/13 19:10:18 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Interfaces.C; with System.Storage_Elements; with System.Address_To_Access_Conversions; with Ada.Text_IO; -- with Ada.Real_Time; use Ada.Real_Time; -- TODO is there a way to use Real_Time or Ada.Calendar in place of -- gettimeofday? -- Demonstrate pads. procedure ncurses2.demo_pad is type timestruct is record seconds : Integer; microseconds : Integer; end record; type myfunc is access function (w : Window) return Key_Code; function gettime return timestruct; procedure do_h_line (y : Line_Position; x : Column_Position; c : Attributed_Character; to : Column_Position); procedure do_v_line (y : Line_Position; x : Column_Position; c : Attributed_Character; to : Line_Position); function padgetch (win : Window) return Key_Code; function panner_legend (line : Line_Position) return Boolean; procedure panner_legend (line : Line_Position); procedure panner_h_cleanup (from_y : Line_Position; from_x : Column_Position; to_x : Column_Position); procedure panner_v_cleanup (from_y : Line_Position; from_x : Column_Position; to_y : Line_Position); procedure panner (pad : Window; top_xp : Column_Position; top_yp : Line_Position; portyp : Line_Position; portxp : Column_Position; pgetc : myfunc); function gettime return timestruct is retval : timestruct; use Interfaces.C; type timeval is record tv_sec : long; tv_usec : long; end record; pragma Convention (C, timeval); -- TODO function from_timeval is new Ada.Unchecked_Conversion( -- timeval_a, System.Storage_Elements.Integer_Address); -- should Interfaces.C.Pointers be used here? package myP is new System.Address_To_Access_Conversions (timeval); use myP; t : constant Object_Pointer := new timeval; function gettimeofday (TP : System.Storage_Elements.Integer_Address; TZP : System.Storage_Elements.Integer_Address) return int; pragma Import (C, gettimeofday, "gettimeofday"); tmp : int; begin tmp := gettimeofday (System.Storage_Elements.To_Integer (myP.To_Address (t)), System.Storage_Elements.To_Integer (myP.To_Address (null))); if tmp < 0 then retval.seconds := 0; retval.microseconds := 0; else retval.seconds := Integer (t.all.tv_sec); retval.microseconds := Integer (t.all.tv_usec); end if; return retval; end gettime; -- in C, The behavior of mvhline, mvvline for negative/zero length is -- unspecified, though we can rely on negative x/y values to stop the -- macro. Except Ada makes Line_Position(-1) = Natural - 1 so forget it. procedure do_h_line (y : Line_Position; x : Column_Position; c : Attributed_Character; to : Column_Position) is begin if to > x then Move_Cursor (Line => y, Column => x); Horizontal_Line (Line_Size => Natural (to - x), Line_Symbol => c); end if; end do_h_line; procedure do_v_line (y : Line_Position; x : Column_Position; c : Attributed_Character; to : Line_Position) is begin if to > y then Move_Cursor (Line => y, Column => x); Vertical_Line (Line_Size => Natural (to - y), Line_Symbol => c); end if; end do_v_line; function padgetch (win : Window) return Key_Code is c : Key_Code; c2 : Character; begin c := Getchar (win); c2 := Code_To_Char (c); case c2 is when '!' => ShellOut (False); return Key_Refresh; when Character'Val (Character'Pos ('r') mod 16#20#) => -- CTRL('r') End_Windows; Refresh; return Key_Refresh; when Character'Val (Character'Pos ('l') mod 16#20#) => -- CTRL('l') return Key_Refresh; when 'U' => return Key_Cursor_Up; when 'D' => return Key_Cursor_Down; when 'R' => return Key_Cursor_Right; when 'L' => return Key_Cursor_Left; when '+' => return Key_Insert_Line; when '-' => return Key_Delete_Line; when '>' => return Key_Insert_Char; when '<' => return Key_Delete_Char; -- when ERR=> /* FALLTHRU */ when 'q' => return (Key_Exit); when others => return (c); end case; end padgetch; show_panner_legend : Boolean := True; function panner_legend (line : Line_Position) return Boolean is legend : constant array (0 .. 3) of String (1 .. 61) := ( "Use arrow keys (or U,D,L,R) to pan, q to quit (?,t,s flags) ", "Use ! to shell-out. Toggle legend:?, timer:t, scroll mark:s.", "Use +,- (or j,k) to grow/shrink the panner vertically. ", "Use <,> (or h,l) to grow/shrink the panner horizontally. "); legendsize : constant := 4; n : constant Integer := legendsize - Integer (Lines - line); begin if line < Lines and n >= 0 then Move_Cursor (Line => line, Column => 0); if show_panner_legend then Add (Str => legend (n)); end if; Clear_To_End_Of_Line; return show_panner_legend; end if; return False; end panner_legend; procedure panner_legend (line : Line_Position) is begin if not panner_legend (line) then Beep; end if; end panner_legend; procedure panner_h_cleanup (from_y : Line_Position; from_x : Column_Position; to_x : Column_Position) is begin if not panner_legend (from_y) then do_h_line (from_y, from_x, Blank2, to_x); end if; end panner_h_cleanup; procedure panner_v_cleanup (from_y : Line_Position; from_x : Column_Position; to_y : Line_Position) is begin if not panner_legend (from_y) then do_v_line (from_y, from_x, Blank2, to_y); end if; end panner_v_cleanup; procedure panner (pad : Window; top_xp : Column_Position; top_yp : Line_Position; portyp : Line_Position; portxp : Column_Position; pgetc : myfunc) is function f (y : Line_Position) return Line_Position; function f (x : Column_Position) return Column_Position; function greater (y1, y2 : Line_Position) return Integer; function greater (x1, x2 : Column_Position) return Integer; top_x : Column_Position := top_xp; top_y : Line_Position := top_yp; porty : Line_Position := portyp; portx : Column_Position := portxp; -- f[x] returns max[x - 1, 0] function f (y : Line_Position) return Line_Position is begin if y > 0 then return y - 1; else return y; -- 0 end if; end f; function f (x : Column_Position) return Column_Position is begin if x > 0 then return x - 1; else return x; -- 0 end if; end f; function greater (y1, y2 : Line_Position) return Integer is begin if y1 > y2 then return 1; else return 0; end if; end greater; function greater (x1, x2 : Column_Position) return Integer is begin if x1 > x2 then return 1; else return 0; end if; end greater; pymax : Line_Position; basey : Line_Position := 0; pxmax : Column_Position; basex : Column_Position := 0; c : Key_Code; scrollers : Boolean := True; before, after : timestruct; timing : Boolean := True; package floatio is new Ada.Text_IO.Float_IO (Long_Float); begin Get_Size (pad, pymax, pxmax); Allow_Scrolling (Mode => False); -- we don't want stdscr to scroll! c := Key_Refresh; loop -- During shell-out, the user may have resized the window. Adjust -- the port size of the pad to accommodate this. Ncurses -- automatically resizes all of the normal windows to fit on the -- new screen. if top_x > Columns then top_x := Columns; end if; if portx > Columns then portx := Columns; end if; if top_y > Lines then top_y := Lines; end if; if porty > Lines then porty := Lines; end if; case c is when Key_Refresh | Character'Pos ('?') => if c = Key_Refresh then Erase; else -- '?' show_panner_legend := not show_panner_legend; end if; panner_legend (Lines - 4); panner_legend (Lines - 3); panner_legend (Lines - 2); panner_legend (Lines - 1); when Character'Pos ('t') => timing := not timing; if not timing then panner_legend (Lines - 1); end if; when Character'Pos ('s') => scrollers := not scrollers; -- Move the top-left corner of the pad, keeping the -- bottom-right corner fixed. when Character'Pos ('h') => -- increase-columns: move left edge to left if top_x = 0 then Beep; else panner_v_cleanup (top_y, top_x, porty); top_x := top_x - 1; end if; when Character'Pos ('j') => -- decrease-lines: move top-edge down if top_y >= porty then Beep; else if top_y /= 0 then panner_h_cleanup (top_y - 1, f (top_x), portx); end if; top_y := top_y + 1; end if; when Character'Pos ('k') => -- increase-lines: move top-edge up if top_y = 0 then Beep; else top_y := top_y - 1; panner_h_cleanup (top_y, top_x, portx); end if; when Character'Pos ('l') => -- decrease-columns: move left-edge to right if top_x >= portx then Beep; else if top_x /= 0 then panner_v_cleanup (f (top_y), top_x - 1, porty); end if; top_x := top_x + 1; end if; -- Move the bottom-right corner of the pad, keeping the -- top-left corner fixed. when Key_Insert_Char => -- increase-columns: move right-edge to right if portx >= pxmax or portx >= Columns then Beep; else panner_v_cleanup (f (top_y), portx - 1, porty); portx := portx + 1; -- C had ++portx instead of portx++, weird. end if; when Key_Insert_Line => -- increase-lines: move bottom-edge down if porty >= pymax or porty >= Lines then Beep; else panner_h_cleanup (porty - 1, f (top_x), portx); porty := porty + 1; end if; when Key_Delete_Char => -- decrease-columns: move bottom edge up if portx <= top_x then Beep; else portx := portx - 1; panner_v_cleanup (f (top_y), portx, porty); end if; when Key_Delete_Line => -- decrease-lines if porty <= top_y then Beep; else porty := porty - 1; panner_h_cleanup (porty, f (top_x), portx); end if; when Key_Cursor_Left => -- pan leftwards if basex > 0 then basex := basex - 1; else Beep; end if; when Key_Cursor_Right => -- pan rightwards -- if (basex + portx - (pymax > porty) < pxmax) if basex + portx - Column_Position (greater (pymax, porty)) < pxmax then -- if basex + portx < pxmax or -- (pymax > porty and basex + portx - 1 < pxmax) then basex := basex + 1; else Beep; end if; when Key_Cursor_Up => -- pan upwards if basey > 0 then basey := basey - 1; else Beep; end if; when Key_Cursor_Down => -- pan downwards -- same as if (basey + porty - (pxmax > portx) < pymax) if basey + porty - Line_Position (greater (pxmax, portx)) < pymax then -- if (basey + porty < pymax) or -- (pxmax > portx and basey + porty - 1 < pymax) then basey := basey + 1; else Beep; end if; when Character'Pos ('H') | Key_Home | Key_Find => basey := 0; when Character'Pos ('E') | Key_End | Key_Select => if pymax < porty then basey := 0; else basey := pymax - porty; end if; when others => Beep; end case; -- more writing off the screen. -- Interestingly, the exception is not handled if -- we put a block around this. -- delcare --begin if top_y /= 0 and top_x /= 0 then Add (Line => top_y - 1, Column => top_x - 1, Ch => ACS_Map (ACS_Upper_Left_Corner)); end if; if top_x /= 0 then do_v_line (top_y, top_x - 1, ACS_Map (ACS_Vertical_Line), porty); end if; if top_y /= 0 then do_h_line (top_y - 1, top_x, ACS_Map (ACS_Horizontal_Line), portx); end if; -- exception when Curses_Exception => null; end; -- in C was ... pxmax > portx - 1 if scrollers and pxmax >= portx then declare length : constant Column_Position := portx - top_x - 1; lowend, highend : Column_Position; begin -- Instead of using floats, I'll use integers only. lowend := top_x + (basex * length) / pxmax; highend := top_x + ((basex + length) * length) / pxmax; do_h_line (porty - 1, top_x, ACS_Map (ACS_Horizontal_Line), lowend); if highend < portx then Switch_Character_Attribute (Attr => (Reverse_Video => True, others => False), On => True); do_h_line (porty - 1, lowend, Blank2, highend + 1); Switch_Character_Attribute (Attr => (Reverse_Video => True, others => False), On => False); do_h_line (porty - 1, highend + 1, ACS_Map (ACS_Horizontal_Line), portx); end if; end; else do_h_line (porty - 1, top_x, ACS_Map (ACS_Horizontal_Line), portx); end if; if scrollers and pymax >= porty then declare length : constant Line_Position := porty - top_y - 1; lowend, highend : Line_Position; begin lowend := top_y + (basey * length) / pymax; highend := top_y + ((basey + length) * length) / pymax; do_v_line (top_y, portx - 1, ACS_Map (ACS_Vertical_Line), lowend); if highend < porty then Switch_Character_Attribute (Attr => (Reverse_Video => True, others => False), On => True); do_v_line (lowend, portx - 1, Blank2, highend + 1); Switch_Character_Attribute (Attr => (Reverse_Video => True, others => False), On => False); do_v_line (highend + 1, portx - 1, ACS_Map (ACS_Vertical_Line), porty); end if; end; else do_v_line (top_y, portx - 1, ACS_Map (ACS_Vertical_Line), porty); end if; if top_y /= 0 then Add (Line => top_y - 1, Column => portx - 1, Ch => ACS_Map (ACS_Upper_Right_Corner)); end if; if top_x /= 0 then Add (Line => porty - 1, Column => top_x - 1, Ch => ACS_Map (ACS_Lower_Left_Corner)); end if; declare begin -- Here is another place where it is possible -- to write to the corner of the screen. Add (Line => porty - 1, Column => portx - 1, Ch => ACS_Map (ACS_Lower_Right_Corner)); exception when Curses_Exception => null; end; before := gettime; Refresh_Without_Update; declare -- the C version allows the panel to have a zero height -- wich raise the exception begin Refresh_Without_Update ( pad, basey, basex, top_y, top_x, porty - Line_Position (greater (pxmax, portx)) - 1, portx - Column_Position (greater (pymax, porty)) - 1); exception when Curses_Exception => null; end; Update_Screen; if timing then declare s : String (1 .. 7); elapsed : Long_Float; begin after := gettime; elapsed := (Long_Float (after.seconds - before.seconds) + Long_Float (after.microseconds - before.microseconds) / 1.0e6); Move_Cursor (Line => Lines - 1, Column => Columns - 20); floatio.Put (s, elapsed, Aft => 3, Exp => 0); Add (Str => s); Refresh; end; end if; c := pgetc (pad); exit when c = Key_Exit; end loop; Allow_Scrolling (Mode => True); end panner; Gridsize : constant := 3; Gridcount : Integer := 0; Pad_High : constant Line_Count := 200; Pad_Wide : constant Column_Count := 200; panpad : Window := New_Pad (Pad_High, Pad_Wide); begin if panpad = Null_Window then Cannot ("cannot create requested pad"); return; end if; for i in 0 .. Pad_High - 1 loop for j in 0 .. Pad_Wide - 1 loop if i mod Gridsize = 0 and j mod Gridsize = 0 then if i = 0 or j = 0 then Add (panpad, '+'); else -- depends on ASCII? Add (panpad, Ch => Character'Val (Character'Pos ('A') + Gridcount mod 26)); Gridcount := Gridcount + 1; end if; elsif i mod Gridsize = 0 then Add (panpad, '-'); elsif j mod Gridsize = 0 then Add (panpad, '|'); else declare -- handle the write to the lower right corner error begin Add (panpad, ' '); exception when Curses_Exception => null; end; end if; end loop; end loop; panner_legend (Lines - 4); panner_legend (Lines - 3); panner_legend (Lines - 2); panner_legend (Lines - 1); Set_KeyPad_Mode (panpad, True); -- Make the pad (initially) narrow enough that a trace file won't wrap. -- We'll still be able to widen it during a test, since that's required -- for testing boundaries. panner (panpad, 2, 2, Lines - 5, Columns - 15, padgetch'Access); Delete (panpad); End_Windows; -- Hmm, Erase after End_Windows Erase; end ncurses2.demo_pad; AdaCurses-20170708/samples/sample-keyboard_handler.ads0000644000175100001440000000665107746514446021317 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Keyboard_Handler -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; -- This package contains a centralized keyboard handler used throughout -- this example. The handler establishes a timeout mechanism that provides -- periodical updates of the common header lines used in this example. -- package Sample.Keyboard_Handler is function Get_Key (Win : Window := Standard_Window) return Real_Key_Code; -- The central routine for handling keystrokes. procedure Init_Keyboard_Handler; -- Initialize the keyboard end Sample.Keyboard_Handler; AdaCurses-20170708/samples/ncurses2-attr_test.ads0000644000175100001440000000573310447516250020301 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000,2006 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.2 $ -- $Date: 2006/06/25 14:24:40 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.attr_test; AdaCurses-20170708/samples/ncurses2-acs_display.adb0000644000175100001440000002470611042670506020540 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2006,2008 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.6 $ -- $Date: 2008/07/26 18:47:34 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with ncurses2.genericPuts; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Ada.Strings.Unbounded; with Ada.Strings.Fixed; procedure ncurses2.acs_display is use Int_IO; procedure show_upper_chars (first : Integer); function show_1_acs (N : Integer; name : String; code : Attributed_Character) return Integer; procedure show_acs_chars; procedure show_upper_chars (first : Integer) is C1 : constant Boolean := (first = 128); last : constant Integer := first + 31; package p is new ncurses2.genericPuts (200); use p; use p.BS; use Ada.Strings.Unbounded; tmpa : Unbounded_String; tmpb : BS.Bounded_String; begin Erase; Switch_Character_Attribute (Attr => (Bold_Character => True, others => False)); Move_Cursor (Line => 0, Column => 20); tmpa := To_Unbounded_String ("Display of "); if C1 then tmpa := tmpa & "C1"; else tmpa := tmpa & "GR"; end if; tmpa := tmpa & " Character Codes "; myPut (tmpb, first); Append (tmpa, To_String (tmpb)); Append (tmpa, " to "); myPut (tmpb, last); Append (tmpa, To_String (tmpb)); Add (Str => To_String (tmpa)); Switch_Character_Attribute (On => False, Attr => (Bold_Character => True, others => False)); Refresh; for code in first .. last loop declare row : constant Line_Position := Line_Position (4 + ((code - first) mod 16)); col : constant Column_Position := Column_Position (((code - first) / 16) * Integer (Columns) / 2); tmp3 : String (1 .. 3); tmpx : String (1 .. Integer (Columns / 4)); reply : Key_Code; begin Put (tmp3, code); myPut (tmpb, code, 16); tmpa := To_Unbounded_String (tmp3 & " (" & To_String (tmpb) & ')'); Ada.Strings.Fixed.Move (To_String (tmpa), tmpx, Justify => Ada.Strings.Right); Add (Line => row, Column => col, Str => tmpx & ' ' & ':' & ' '); if C1 then Set_NoDelay_Mode (Mode => True); end if; Add_With_Immediate_Echo (Ch => Code_To_Char (Key_Code (code))); -- TODO check this if C1 then reply := Getchar; while reply /= Key_None loop Add (Ch => Code_To_Char (reply)); Nap_Milli_Seconds (10); reply := Getchar; end loop; Set_NoDelay_Mode (Mode => False); end if; end; end loop; end show_upper_chars; function show_1_acs (N : Integer; name : String; code : Attributed_Character) return Integer is height : constant Integer := 16; row : constant Line_Position := Line_Position (4 + (N mod height)); col : constant Column_Position := Column_Position ((N / height) * Integer (Columns) / 2); tmpx : String (1 .. Integer (Columns) / 3); begin Ada.Strings.Fixed.Move (name, tmpx, Justify => Ada.Strings.Right, Drop => Ada.Strings.Left); Add (Line => row, Column => col, Str => tmpx & ' ' & ':' & ' '); -- we need more room than C because our identifiers are longer -- 22 chars actually Add (Ch => code); return N + 1; end show_1_acs; procedure show_acs_chars is n : Integer; begin Erase; Switch_Character_Attribute (Attr => (Bold_Character => True, others => False)); Add (Line => 0, Column => 20, Str => "Display of the ACS Character Set"); Switch_Character_Attribute (On => False, Attr => (Bold_Character => True, others => False)); Refresh; -- the following is useful to generate the below -- grep '^[ ]*ACS_' ../src/terminal_interface-curses.ads | -- awk '{print "n := show_1_acs(n, \""$1"\", ACS_Map("$1"));"}' n := show_1_acs (0, "ACS_Upper_Left_Corner", ACS_Map (ACS_Upper_Left_Corner)); n := show_1_acs (n, "ACS_Lower_Left_Corner", ACS_Map (ACS_Lower_Left_Corner)); n := show_1_acs (n, "ACS_Upper_Right_Corner", ACS_Map (ACS_Upper_Right_Corner)); n := show_1_acs (n, "ACS_Lower_Right_Corner", ACS_Map (ACS_Lower_Right_Corner)); n := show_1_acs (n, "ACS_Left_Tee", ACS_Map (ACS_Left_Tee)); n := show_1_acs (n, "ACS_Right_Tee", ACS_Map (ACS_Right_Tee)); n := show_1_acs (n, "ACS_Bottom_Tee", ACS_Map (ACS_Bottom_Tee)); n := show_1_acs (n, "ACS_Top_Tee", ACS_Map (ACS_Top_Tee)); n := show_1_acs (n, "ACS_Horizontal_Line", ACS_Map (ACS_Horizontal_Line)); n := show_1_acs (n, "ACS_Vertical_Line", ACS_Map (ACS_Vertical_Line)); n := show_1_acs (n, "ACS_Plus_Symbol", ACS_Map (ACS_Plus_Symbol)); n := show_1_acs (n, "ACS_Scan_Line_1", ACS_Map (ACS_Scan_Line_1)); n := show_1_acs (n, "ACS_Scan_Line_9", ACS_Map (ACS_Scan_Line_9)); n := show_1_acs (n, "ACS_Diamond", ACS_Map (ACS_Diamond)); n := show_1_acs (n, "ACS_Checker_Board", ACS_Map (ACS_Checker_Board)); n := show_1_acs (n, "ACS_Degree", ACS_Map (ACS_Degree)); n := show_1_acs (n, "ACS_Plus_Minus", ACS_Map (ACS_Plus_Minus)); n := show_1_acs (n, "ACS_Bullet", ACS_Map (ACS_Bullet)); n := show_1_acs (n, "ACS_Left_Arrow", ACS_Map (ACS_Left_Arrow)); n := show_1_acs (n, "ACS_Right_Arrow", ACS_Map (ACS_Right_Arrow)); n := show_1_acs (n, "ACS_Down_Arrow", ACS_Map (ACS_Down_Arrow)); n := show_1_acs (n, "ACS_Up_Arrow", ACS_Map (ACS_Up_Arrow)); n := show_1_acs (n, "ACS_Board_Of_Squares", ACS_Map (ACS_Board_Of_Squares)); n := show_1_acs (n, "ACS_Lantern", ACS_Map (ACS_Lantern)); n := show_1_acs (n, "ACS_Solid_Block", ACS_Map (ACS_Solid_Block)); n := show_1_acs (n, "ACS_Scan_Line_3", ACS_Map (ACS_Scan_Line_3)); n := show_1_acs (n, "ACS_Scan_Line_7", ACS_Map (ACS_Scan_Line_7)); n := show_1_acs (n, "ACS_Less_Or_Equal", ACS_Map (ACS_Less_Or_Equal)); n := show_1_acs (n, "ACS_Greater_Or_Equal", ACS_Map (ACS_Greater_Or_Equal)); n := show_1_acs (n, "ACS_PI", ACS_Map (ACS_PI)); n := show_1_acs (n, "ACS_Not_Equal", ACS_Map (ACS_Not_Equal)); n := show_1_acs (n, "ACS_Sterling", ACS_Map (ACS_Sterling)); if n = 0 then raise Constraint_Error; end if; end show_acs_chars; c1 : Key_Code; c : Character := 'a'; begin loop case c is when 'a' => show_acs_chars; when '0' | '1' | '2' | '3' => show_upper_chars (ctoi (c) * 32 + 128); when others => null; end case; Add (Line => Lines - 3, Column => 0, Str => "Note: ANSI terminals may not display C1 characters."); Add (Line => Lines - 2, Column => 0, Str => "Select: a=ACS, 0=C1, 1,2,3=GR characters, q=quit"); Refresh; c1 := Getchar; c := Code_To_Char (c1); exit when c = 'q' or c = 'x'; end loop; Pause; Erase; End_Windows; end ncurses2.acs_display; AdaCurses-20170708/samples/sample-menu_demo-aux.ads0000644000175100001440000001016511541117367020545 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Menu_Demo.Aux -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2011 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, 1996 -- Version Control -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; package Sample.Menu_Demo.Aux is procedure Geometry (M : Menu; L : out Line_Count; C : out Column_Count; Y : out Line_Position; X : out Column_Position); -- Calculate the geometry for a panel being able to be used to display -- the menu. function Create (M : Menu; Title : String; Lin : Line_Position; Col : Column_Position) return Panel; -- Create a panel decorated with a frame and the title at the specified -- position. The dimension of the panel is derived from the menus layout. procedure Destroy (M : Menu; P : in out Panel); -- Destroy all the windowing structures associated with this menu and -- panel. function Get_Request (M : Menu; P : Panel) return Key_Code; -- Centralized request driver for all menus in this sample. This -- gives us a common key binding for all menus. end Sample.Menu_Demo.Aux; AdaCurses-20170708/samples/ncurses2-overlap_test.ads0000644000175100001440000000567507212274051021000 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.overlap_test; AdaCurses-20170708/samples/sample-curses_demo.ads0000644000175100001440000000571607746514446020333 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Curses_Demo -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Curses_Demo is procedure Demo; end Sample.Curses_Demo; AdaCurses-20170708/samples/ncurses2-test_sgr_attributes.adb0000644000175100001440000001750110447516250022343 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000,2006 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.2 $ -- $Date: 2006/06/25 14:24:40 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with ncurses2.util; use ncurses2.util; -- Graphic-rendition test (adapted from vttest) procedure ncurses2.test_sgr_attributes is procedure xAdd (l : Line_Position; c : Column_Position; s : String); procedure xAdd (l : Line_Position; c : Column_Position; s : String) is begin Add (Line => l, Column => c, Str => s); end xAdd; normal, current : Attributed_Character; begin for pass in reverse Boolean loop if pass then normal := (Ch => ' ', Attr => Normal_Video, Color => 0); else normal := (Ch => ' ', Attr => (Reverse_Video => True, others => False), Color => 0); end if; -- Use non-default colors if possible to exercise bce a little if Has_Colors then Init_Pair (1, White, Blue); normal.Color := 1; end if; Set_Background (Ch => normal); Erase; xAdd (1, 20, "Graphic rendition test pattern:"); xAdd (4, 1, "vanilla"); current := normal; current.Attr.Bold_Character := not current.Attr.Bold_Character; Set_Background (Ch => current); xAdd (4, 40, "bold"); current := normal; current.Attr.Under_Line := not current.Attr.Under_Line; Set_Background (Ch => current); xAdd (6, 6, "underline"); current := normal; current.Attr.Bold_Character := not current.Attr.Bold_Character; current.Attr.Under_Line := not current.Attr.Under_Line; Set_Background (Ch => current); xAdd (6, 45, "bold underline"); current := normal; current.Attr.Blink := not current.Attr.Blink; Set_Background (Ch => current); xAdd (8, 1, "blink"); current := normal; current.Attr.Blink := not current.Attr.Blink; current.Attr.Bold_Character := not current.Attr.Bold_Character; Set_Background (Ch => current); xAdd (8, 40, "bold blink"); current := normal; current.Attr.Under_Line := not current.Attr.Under_Line; current.Attr.Blink := not current.Attr.Blink; Set_Background (Ch => current); xAdd (10, 6, "underline blink"); current := normal; current.Attr.Bold_Character := not current.Attr.Bold_Character; current.Attr.Under_Line := not current.Attr.Under_Line; current.Attr.Blink := not current.Attr.Blink; Set_Background (Ch => current); xAdd (10, 45, "bold underline blink"); current := normal; current.Attr.Reverse_Video := not current.Attr.Reverse_Video; Set_Background (Ch => current); xAdd (12, 1, "negative"); current := normal; current.Attr.Bold_Character := not current.Attr.Bold_Character; current.Attr.Reverse_Video := not current.Attr.Reverse_Video; Set_Background (Ch => current); xAdd (12, 40, "bold negative"); current := normal; current.Attr.Under_Line := not current.Attr.Under_Line; current.Attr.Reverse_Video := not current.Attr.Reverse_Video; Set_Background (Ch => current); xAdd (14, 6, "underline negative"); current := normal; current.Attr.Bold_Character := not current.Attr.Bold_Character; current.Attr.Under_Line := not current.Attr.Under_Line; current.Attr.Reverse_Video := not current.Attr.Reverse_Video; Set_Background (Ch => current); xAdd (14, 45, "bold underline negative"); current := normal; current.Attr.Blink := not current.Attr.Blink; current.Attr.Reverse_Video := not current.Attr.Reverse_Video; Set_Background (Ch => current); xAdd (16, 1, "blink negative"); current := normal; current.Attr.Bold_Character := not current.Attr.Bold_Character; current.Attr.Blink := not current.Attr.Blink; current.Attr.Reverse_Video := not current.Attr.Reverse_Video; Set_Background (Ch => current); xAdd (16, 40, "bold blink negative"); current := normal; current.Attr.Under_Line := not current.Attr.Under_Line; current.Attr.Blink := not current.Attr.Blink; current.Attr.Reverse_Video := not current.Attr.Reverse_Video; Set_Background (Ch => current); xAdd (18, 6, "underline blink negative"); current := normal; current.Attr.Bold_Character := not current.Attr.Bold_Character; current.Attr.Under_Line := not current.Attr.Under_Line; current.Attr.Blink := not current.Attr.Blink; current.Attr.Reverse_Video := not current.Attr.Reverse_Video; Set_Background (Ch => current); xAdd (18, 45, "bold underline blink negative"); Set_Background (Ch => normal); Move_Cursor (Line => Lines - 2, Column => 1); if pass then Add (Str => "Dark"); else Add (Str => "Light"); end if; Add (Str => " background. "); Clear_To_End_Of_Line; Pause; end loop; Set_Background (Ch => Blank2); Erase; End_Windows; end ncurses2.test_sgr_attributes; AdaCurses-20170708/samples/sample-function_key_setting.adb0000644000175100001440000001730211542241134022202 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Function_Key_Setting -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2011 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, 1996 -- Version Control -- $Revision: 1.15 $ -- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; with Sample.Manifest; use Sample.Manifest; -- This package implements a simple stack of function key label environments. -- package body Sample.Function_Key_Setting is Max_Label_Length : constant Positive := 8; Number_Of_Keys : Label_Number := Label_Number'Last; Justification : Label_Justification := Left; subtype Label is String (1 .. Max_Label_Length); type Label_Array is array (Label_Number range <>) of Label; type Key_Environment (N : Label_Number := Label_Number'Last); type Env_Ptr is access Key_Environment; pragma Controlled (Env_Ptr); type String_Access is access String; pragma Controlled (String_Access); Active_Context : String_Access := new String'("MAIN"); Active_Notepad : Panel := Null_Panel; type Key_Environment (N : Label_Number := Label_Number'Last) is record Prev : Env_Ptr; Help : String_Access; Notepad : Panel; Labels : Label_Array (1 .. N); end record; procedure Release_String is new Ada.Unchecked_Deallocation (String, String_Access); procedure Release_Environment is new Ada.Unchecked_Deallocation (Key_Environment, Env_Ptr); Top_Of_Stack : Env_Ptr := null; procedure Push_Environment (Key : String; Reset : Boolean := True) is P : constant Env_Ptr := new Key_Environment (Number_Of_Keys); begin -- Store the current labels in the environment for I in 1 .. Number_Of_Keys loop Get_Soft_Label_Key (I, P.all.Labels (I)); if Reset then Set_Soft_Label_Key (I, " "); end if; end loop; P.all.Prev := Top_Of_Stack; -- now store active help context and notepad P.all.Help := Active_Context; P.all.Notepad := Active_Notepad; -- The notepad must now vanish and the new notepad is empty. if P.all.Notepad /= Null_Panel then Hide (P.all.Notepad); Update_Panels; end if; Active_Notepad := Null_Panel; Active_Context := new String'(Key); Top_Of_Stack := P; if Reset then Refresh_Soft_Label_Keys_Without_Update; end if; end Push_Environment; procedure Pop_Environment is P : Env_Ptr := Top_Of_Stack; begin if Top_Of_Stack = null then raise Function_Key_Stack_Error; else for I in 1 .. Number_Of_Keys loop Set_Soft_Label_Key (I, P.all.Labels (I), Justification); end loop; pragma Assert (Active_Context /= null); Release_String (Active_Context); Active_Context := P.all.Help; Refresh_Soft_Label_Keys_Without_Update; Notepad_To_Context (P.all.Notepad); Top_Of_Stack := P.all.Prev; Release_Environment (P); end if; end Pop_Environment; function Context return String is begin if Active_Context /= null then return Active_Context.all; else return ""; end if; end Context; function Find_Context (Key : String) return Boolean is P : Env_Ptr := Top_Of_Stack; begin if Active_Context.all = Key then return True; else loop exit when P = null; if P.all.Help.all = Key then return True; else P := P.all.Prev; end if; end loop; return False; end if; end Find_Context; procedure Notepad_To_Context (Pan : Panel) is W : Window; begin if Active_Notepad /= Null_Panel then W := Get_Window (Active_Notepad); Clear (W); Delete (Active_Notepad); Delete (W); end if; Active_Notepad := Pan; if Pan /= Null_Panel then Top (Pan); end if; Update_Panels; Update_Screen; end Notepad_To_Context; procedure Initialize (Mode : Soft_Label_Key_Format := PC_Style; Just : Label_Justification := Left) is begin case Mode is when PC_Style .. PC_Style_With_Index => Number_Of_Keys := 12; when others => Number_Of_Keys := 8; end case; Init_Soft_Label_Keys (Mode); Justification := Just; end Initialize; procedure Default_Labels is begin Set_Soft_Label_Key (FKEY_QUIT, "Quit"); Set_Soft_Label_Key (FKEY_HELP, "Help"); Set_Soft_Label_Key (FKEY_EXPLAIN, "Keys"); Refresh_Soft_Label_Keys_Without_Update; end Default_Labels; function Notepad_Window return Window is begin if Active_Notepad /= Null_Panel then return Get_Window (Active_Notepad); else return Null_Window; end if; end Notepad_Window; end Sample.Function_Key_Setting; AdaCurses-20170708/samples/ncurses2-util.adb0000644000175100001440000001541212340207742017214 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses2.util -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2008,2014 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.9 $ -- $Date: 2014/05/24 21:32:18 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; use Ada.Text_IO; with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; with Interfaces.C; with Interfaces.C.Strings; with Ada.Characters.Handling; with ncurses2.genericPuts; package body ncurses2.util is -- #defines from C -- #define CTRL(x) ((x) & 0x1f) function CTRL (c : Character) return Key_Code is begin return Character'Pos (c) mod 16#20#; -- uses a property of ASCII -- A = 16#41#; a = 16#61#; ^A = 1 or 16#1# end CTRL; function CTRL (c : Character) return Character is begin return Character'Val (Character'Pos (c) mod 16#20#); -- uses a property of ASCII -- A = 16#41#; a = 16#61#; ^A = 1 or 16#1# end CTRL; save_trace : Trace_Attribute_Set; -- Common function to allow ^T to toggle trace-mode in the middle of a test -- so that trace-files can be made smaller. function Getchar (win : Window := Standard_Window) return Key_Code is c : Key_Code; begin -- #ifdef TRACE c := Get_Keystroke (win); while c = CTRL ('T') loop -- if _nc_tracing in C if Current_Trace_Setting /= Trace_Disable then save_trace := Current_Trace_Setting; Trace_Put ("TOGGLE-TRACING OFF"); Current_Trace_Setting := Trace_Disable; else Current_Trace_Setting := save_trace; end if; Trace_On (Current_Trace_Setting); if Current_Trace_Setting /= Trace_Disable then Trace_Put ("TOGGLE-TRACING ON"); end if; end loop; -- #else c := Get_Keystroke; return c; end Getchar; procedure Getchar (win : Window := Standard_Window) is begin if Getchar (win) < 0 then Beep; end if; end Getchar; procedure Pause is begin Move_Cursor (Line => Lines - 1, Column => 0); Add (Str => "Press any key to continue... "); Getchar; end Pause; procedure Cannot (s : String) is use Interfaces.C; use Interfaces.C.Strings; function getenv (x : char_array) return chars_ptr; pragma Import (C, getenv, "getenv"); tmp1 : char_array (0 .. 10); package p is new ncurses2.genericPuts (1024); use p; use p.BS; tmpb : BS.Bounded_String; Length : size_t; begin To_C ("TERM", tmp1, Length); Fill_String (getenv (tmp1), tmpb); Add (Ch => newl); myAdd (Str => "This " & tmpb & " terminal " & s); Pause; end Cannot; procedure ShellOut (message : Boolean) is use Interfaces.C; Txt : char_array (0 .. 10); Length : size_t; procedure system (x : char_array); pragma Import (C, system, "system"); begin To_C ("sh", Txt, Length); if message then Add (Str => "Shelling out..."); end if; Save_Curses_Mode (Mode => Curses); End_Windows; system (Txt); if message then Add (Str => "returned from shellout."); Add (Ch => newl); end if; Refresh; end ShellOut; function Is_Digit (c : Key_Code) return Boolean is begin if c >= 16#100# then return False; else return Ada.Characters.Handling.Is_Digit (Character'Val (c)); end if; end Is_Digit; procedure P (s : String) is begin Add (Str => s); Add (Ch => newl); end P; function Code_To_Char (c : Key_Code) return Character is begin if c > Character'Pos (Character'Last) then return Character'Val (0); -- maybe raise exception? else return Character'Val (c); end if; end Code_To_Char; -- This was untestable due to a bug in GNAT (3.12p) -- Hmm, what bug? I don't remember. function ctoi (c : Character) return Integer is begin return Character'Pos (c) - Character'Pos ('0'); end ctoi; end ncurses2.util; AdaCurses-20170708/samples/sample-form_demo-handler.adb0000644000175100001440000001067711315445062021346 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Form_Demo.Handler -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2004,2009 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, 1996 -- Version Control -- $Revision: 1.14 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample.Form_Demo.Aux; package body Sample.Form_Demo.Handler is package Aux renames Sample.Form_Demo.Aux; procedure Drive_Me (F : Form; Title : String := "") is L : Line_Count; C : Column_Count; Y : Line_Position; X : Column_Position; begin Aux.Geometry (F, L, C, Y, X); Drive_Me (F, Y, X, Title); end Drive_Me; procedure Drive_Me (F : Form; Lin : Line_Position; Col : Column_Position; Title : String := "") is Pan : Panel := Aux.Create (F, Title, Lin, Col); V : Cursor_Visibility := Normal; Handle_CRLF : Boolean := True; begin Set_Cursor_Visibility (V); if Aux.Count_Active (F) = 1 then Handle_CRLF := False; end if; loop declare K : constant Key_Code := Aux.Get_Request (F, Pan, Handle_CRLF); R : Driver_Result; begin if (K = 13 or else K = 10) and then not Handle_CRLF then R := Unknown_Request; else R := Driver (F, K); end if; case R is when Form_Ok => null; when Unknown_Request => if My_Driver (F, K, Pan) then exit; end if; when others => Beep; end case; end; end loop; Set_Cursor_Visibility (V); Aux.Destroy (F, Pan); end Drive_Me; end Sample.Form_Demo.Handler; AdaCurses-20170708/samples/sample-function_key_setting.ads0000644000175100001440000001077511541117303022231 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Function_Key_Setting -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2011 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, 1996 -- Version Control -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; -- This package implements a simple stack of function key label environments. -- package Sample.Function_Key_Setting is procedure Push_Environment (Key : String; Reset : Boolean := True); -- Push the definition of the current function keys on an internal -- stack. If the reset flag is true, all labels are reset while -- pushed, so the new environment can assume a tabula rasa. -- The Key defines the new Help Context associated with the new -- Environment. This saves also the currently active Notepad. procedure Pop_Environment; -- Pop the Definitions from the stack and make them the current ones. -- This also restores the Help context and the previous Notepad. procedure Initialize (Mode : Soft_Label_Key_Format := PC_Style; Just : Label_Justification := Left); -- Initialize the environment function Context return String; -- Return the current context identifier function Find_Context (Key : String) return Boolean; -- Look for a context, return true if it is in the stack, -- false otherwise. procedure Notepad_To_Context (Pan : Panel); -- Add a panel representing a notepad to the current context. Function_Key_Stack_Error : exception; procedure Default_Labels; -- Set the default labels used in all environments function Notepad_Window return Window; -- Return the current notepad window or Null_Window if there is none. end Sample.Function_Key_Setting; AdaCurses-20170708/samples/explain.txt0000644000175100001440000001721511541115445016231 0ustar tomusers#VERSION This is Version 00.90.00 of the demo package. #MENUKEYS In a menu you can use the following Keys in the whole application: - CTRL-X eXit the menu - CTRL-N Go to next item - CTRL-P Go to previous item - CTRL-U Scroll up one line - CTRL-D Scroll down one line - CTRL-F Scroll down one page - PAGE DOWN Scroll down one page - PAGE UP Scroll back one page - CTRL-B Scroll back one page - CTRL-Y Clear pattern - CTRL-H Delete last character from pattern - Backspace Delete last character from pattern - CTRL-A Next pattern match - CTRL-E Previous pattern match - CTRL-T Toggle item in a multi-selection menu - CR or LF Select an item - HOME Key Go to the first item - F3 Quit the menu - Cursor Down Down one item - Cursor Up Up one item - Cursor Left Left one item - Cursor Right Right one item - END Key Go to last item #FORMKEYS - CTRL-X eXit the form - CTRL-F Go forward to the next field - CTRL-B Go backward to the previous field - CTRL-L Go to the field left of the current one - CTRL-R Go to the field right of the current one - CTRL-U Go to the field above the current one - CTRL-D Go to the field below the current one - CTRL-W Go to the next word in the field - CTRL-T Go to the previous word in the field - CTRL-A Go to the beginning of the field - CTRL-E Go to the end of the field - CTRL-I Insert a blank character at the current position - CTRL-O Insert a line - CTRL-V Delete a character - CTRL-H Delete previous character - CTRL-Y Delete a line - CTRL-G Delete a word - CTRL-K Clear to end of field - CTRL-N Next choice in a choice field (Enumerations etc.) - CTRL-P Previous choice in a choice field. #HELP #HELPKEYS You may scroll with the Cursor Up/Down Keys. You may leave the help with the Function Key labeled 'Quit'. #INHELP You are already in the help system. You may leave the help with the Function Key labeled 'Quit'. #MAIN This is the main menu of the sample program for the ncurses Ada95 binding. The main intention of the demo is not to demonstrate or test all the features of ncurses and it's subsystems, but to provide to you some sample code how to use the binding with Ada95. You may select this options: * Look at some ncurses core functions * Look at some features of the menu subsystem * Look at some features of the form subsystem * Look at the output of the Ada.Text_IO like functions for ncurses. #MAINPAD You may press at any place in this demo CTRL-C. This will give you a command window. You can just type in the Label-String of a function key, then this key will be simulated. This should help you to run the application even if you run it on a terminal with no or only a few function keys. With CTRL-N and CTRL-P you may browse through the possible values in the command window. #MENU00 Here we give you a selection of various menu demonstrations. #MENU-PAD00 This menu itself is a demo for a single valued, 1-column menu with descriptions for the items, a marker and a padding character between the item name and the description. #MENU01 This is a demo of the some of the menu layout options. One of them is the spacing functionality. Just press the Key labeled "Flip" to flip between the non-spaced and a spaced version of the menu. Please note that this functionality is unique for ncurses and is not found in the SVr4 menu implementation. This is a menu that sometimes does not fit into it's window and therefore it becomes a scroll menu. You can also see here very nicely the pattern matching functionality of menus. Type for example a 'J' and you will be positioned to the next item after the current starting with a 'J'. Any more characters you type in make the pattern more specific. With CTRL-A and CTRL-Z (for more details press the Key labeled "Keys") you can browse through all the items matching the pattern. You may change the format of the menu. Just press one of the keys labeled "4x1", "4x2" or "4x3" to get a menu with that many rows and columns. With the Keys "O-Row" or "O-Col" (they occupy the same label and switch on selection) you can change the major order scheme for the menu. If "O-Col" is visible, the menu is currently major ordered by rows, you can switch to major column order by pressing the key. If "O-Row" is visible, it's just the reverse situation. This Key is not visible in "4x1" layout mode, because in this case the functionality makes no sense. With the Keys "Multi" or "Singl" (they occupy the same label and switch on selection) you can change whether or not the menu allows multiple or only single selection. With the Keys "+Desc" or "-Desc" (they occupy the same label and switch on selection) you can change whether or not the descriptions for each item should be displayed. Please not that this key is not visible in the "4x3" layout mode, because in this case the menu would not fit on a typical 80x24 screen. With the Keys "Disab" or "Enab" (they occupy the same label and switch on selection) you can dis- or enable the selectability of the month with 31 days. #MENU-PAD01 You may press "Flip" to see the effect of ncurses unique menu-spacing. The Keys "4x1", "4x2" and "4x3" will change the format of the menu. Please note that this is a scrolling menu. You may also play with the pattern matching functionality or try to change the format of the menu. For more details press the Key labeled "Help". #FORM00 This is a demo of the forms package. #FORM-PAD00 Please note that this demo is far from being complete. It really shows only a small part of the functionality of the forms package. Let's hope the next version will have a richer demo (You want to contribute ?). #NOTIMPL Sorry this functionality of the demo is not implemented at the moment. Remember this is a freeware project, so I can use only my very rare free time to continue coding. If you would like to contribute, you are very welcome ! #CURSES00 This is a menu where you can select some different demos of the ncurses functionality. #CURSES-PAD00 Please note that this demo is far from being complete. It really shows only a small part of the functionality of the curses package. Let's hope the next version will have a richer demo (You want to contribute ?). #MOUSEKEYS In this demo you may use this keys: - Key labeled "Help" to get a help - Key labeled "Keys" is what you are reading now - Key labeled "Quit" to leave the demo You may click the mouse buttons at any location at the screen and look at the protocol window ! #MOUSE00 A rather simple use of a mouse as demo. It's there just to test the code and to provide the sample source. It might be of interest, that the output into the protocol window is done by the (n)curses Text_IO subpackages. Especially the output of the button and state names is done by Ads's enumeration IO, which allows you to print the names of enumeration literals. That's really nice. #MOUSE-PAD00 This is a very simple demo of the mouse features of ncurses. It's there just to test whether or not the generated code for the binding really works on the different architectures (seems so). #ATTRIBDEMO Again this is a more than simple demo and just here to give you the sourcecode. #ATTRIBKEYS You may press one of the three well known standard keys of this demo. #ATTRIB-PAD00 Again this is a more than simple demo and just here to give you the source code. Feel free to contribute more. #TEXTIO #TEXTIOKEYS #TEXTIO-PAD00 #END AdaCurses-20170708/samples/ncurses2-color_test.adb0000644000175100001440000001471511042670465020425 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2006,2008 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.3 $ -- $Date: 2008/07/26 18:47:17 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Ada.Strings.Fixed; procedure ncurses2.color_test is use Int_IO; procedure show_color_name (y, x : Integer; color : Integer); color_names : constant array (0 .. 15) of String (1 .. 7) := ( "black ", "red ", "green ", "yellow ", "blue ", "magenta", "cyan ", "white ", "BLACK ", "RED ", "GREEN ", "YELLOW ", "BLUE ", "MAGENTA", "CYAN ", "WHITE " ); procedure show_color_name (y, x : Integer; color : Integer) is tmp5 : String (1 .. 5); begin if Number_Of_Colors > 8 then Put (tmp5, color); Add (Line => Line_Position (y), Column => Column_Position (x), Str => tmp5); else Add (Line => Line_Position (y), Column => Column_Position (x), Str => color_names (color)); end if; end show_color_name; top, width : Integer; hello : String (1 .. 5); -- tmp3 : String (1 .. 3); -- tmp2 : String (1 .. 2); begin Refresh; Add (Str => "There are "); -- Put(tmp3, Number_Of_Colors*Number_Of_Colors); Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors * Number_Of_Colors), Ada.Strings.Left)); Add (Str => " color pairs"); Add (Ch => newl); if Number_Of_Colors > 8 then width := 4; else width := 8; end if; if Number_Of_Colors > 8 then hello := "Test "; else hello := "Hello"; end if; for Bright in Boolean loop if Number_Of_Colors > 8 then top := 0; else top := Boolean'Pos (Bright) * (Number_Of_Colors + 3); end if; Clear_To_End_Of_Screen; Move_Cursor (Line => Line_Position (top) + 1, Column => 0); -- Put(tmp2, Number_Of_Colors); Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors), Ada.Strings.Left)); Add (Ch => 'x'); Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors), Ada.Strings.Left)); Add (Str => " matrix of foreground/background colors, bright *"); if Bright then Add (Str => "on"); else Add (Str => "off"); end if; Add (Ch => '*'); for i in 0 .. Number_Of_Colors - 1 loop show_color_name (top + 2, (i + 1) * width, i); end loop; for i in 0 .. Number_Of_Colors - 1 loop show_color_name (top + 3 + i, 0, i); end loop; for i in 1 .. Number_Of_Color_Pairs - 1 loop Init_Pair (Color_Pair (i), Color_Number (i mod Number_Of_Colors), Color_Number (i / Number_Of_Colors)); -- attron((attr_t) COLOR_PAIR(i)) -- Huh? Set_Color (Pair => Color_Pair (i)); if Bright then Switch_Character_Attribute (Attr => (Bold_Character => True, others => False)); end if; Add (Line => Line_Position (top + 3 + (i / Number_Of_Colors)), Column => Column_Position ((i mod Number_Of_Colors + 1) * width), Str => hello); Set_Character_Attributes; end loop; if Number_Of_Colors > 8 or Bright then Pause; end if; end loop; Erase; End_Windows; end ncurses2.color_test; AdaCurses-20170708/samples/ncurses2-trace_set.ads0000644000175100001440000000567207212274053020241 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses2.trace_set -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.trace_set; AdaCurses-20170708/samples/sample-text_io_demo.ads0000644000175100001440000000572007746514446020475 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Text_IO_Demo -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Text_IO_Demo is procedure Demo; end Sample.Text_IO_Demo; AdaCurses-20170708/samples/ncurses2-attr_test.adb0000644000175100001440000003355411042670476020265 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2007,2008 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.9 $ -- $Date: 2008/07/26 18:47:26 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Terminfo; use Terminal_Interface.Curses.Terminfo; with Ada.Characters.Handling; with Ada.Strings.Fixed; procedure ncurses2.attr_test is function subset (super, sub : Character_Attribute_Set) return Boolean; function intersect (b, a : Character_Attribute_Set) return Boolean; function has_A_COLOR (attr : Attributed_Character) return Boolean; function show_attr (row : Line_Position; skip : Natural; attr : Character_Attribute_Set; name : String; once : Boolean) return Line_Position; procedure attr_getc (skip : in out Integer; fg, bg : in out Color_Number; result : out Boolean); function subset (super, sub : Character_Attribute_Set) return Boolean is begin if (super.Stand_Out or not sub.Stand_Out) and (super.Under_Line or not sub.Under_Line) and (super.Reverse_Video or not sub.Reverse_Video) and (super.Blink or not sub.Blink) and (super.Dim_Character or not sub.Dim_Character) and (super.Bold_Character or not sub.Bold_Character) and (super.Alternate_Character_Set or not sub.Alternate_Character_Set) and (super.Invisible_Character or not sub.Invisible_Character) -- and -- (super.Protected_Character or not sub.Protected_Character) and -- (super.Horizontal or not sub.Horizontal) and -- (super.Left or not sub.Left) and -- (super.Low or not sub.Low) and -- (super.Right or not sub.Right) and -- (super.Top or not sub.Top) and -- (super.Vertical or not sub.Vertical) then return True; else return False; end if; end subset; function intersect (b, a : Character_Attribute_Set) return Boolean is begin if (a.Stand_Out and b.Stand_Out) or (a.Under_Line and b.Under_Line) or (a.Reverse_Video and b.Reverse_Video) or (a.Blink and b.Blink) or (a.Dim_Character and b.Dim_Character) or (a.Bold_Character and b.Bold_Character) or (a.Alternate_Character_Set and b.Alternate_Character_Set) or (a.Invisible_Character and b.Invisible_Character) -- or -- (a.Protected_Character and b.Protected_Character) or -- (a.Horizontal and b.Horizontal) or -- (a.Left and b.Left) or -- (a.Low and b.Low) or -- (a.Right and b.Right) or -- (a.Top and b.Top) or -- (a.Vertical and b.Vertical) then return True; else return False; end if; end intersect; function has_A_COLOR (attr : Attributed_Character) return Boolean is begin if attr.Color /= Color_Pair (0) then return True; else return False; end if; end has_A_COLOR; -- Print some text with attributes. function show_attr (row : Line_Position; skip : Natural; attr : Character_Attribute_Set; name : String; once : Boolean) return Line_Position is function make_record (n : Integer) return Character_Attribute_Set; function make_record (n : Integer) return Character_Attribute_Set is -- unsupported means true a : Character_Attribute_Set := (others => False); m : Integer; rest : Integer; begin -- ncv is a bitmap with these fields -- A_STANDOUT, -- A_UNDERLINE, -- A_REVERSE, -- A_BLINK, -- A_DIM, -- A_BOLD, -- A_INVIS, -- A_PROTECT, -- A_ALTCHARSET -- It means no_color_video, -- video attributes that can't be used with colors -- see man terminfo.5 m := n mod 2; rest := n / 2; if 1 = m then a.Stand_Out := True; end if; m := rest mod 2; rest := rest / 2; if 1 = m then a.Under_Line := True; end if; m := rest mod 2; rest := rest / 2; if 1 = m then a.Reverse_Video := True; end if; m := rest mod 2; rest := rest / 2; if 1 = m then a.Blink := True; end if; m := rest mod 2; rest := rest / 2; if 1 = m then a.Bold_Character := True; end if; m := rest mod 2; rest := rest / 2; if 1 = m then a.Invisible_Character := True; end if; m := rest mod 2; rest := rest / 2; if 1 = m then a.Protected_Character := True; end if; m := rest mod 2; rest := rest / 2; if 1 = m then a.Alternate_Character_Set := True; end if; return a; end make_record; ncv : constant Integer := Get_Number ("ncv"); begin Move_Cursor (Line => row, Column => 8); Add (Str => name & " mode:"); Move_Cursor (Line => row, Column => 24); Add (Ch => '|'); if skip /= 0 then -- printw("%*s", skip, " ") Add (Str => Ada.Strings.Fixed."*" (skip, ' ')); end if; if once then Switch_Character_Attribute (Attr => attr); else Set_Character_Attributes (Attr => attr); end if; Add (Str => "abcde fghij klmno pqrst uvwxy z"); if once then Switch_Character_Attribute (Attr => attr, On => False); end if; if skip /= 0 then Add (Str => Ada.Strings.Fixed."*" (skip, ' ')); end if; Add (Ch => '|'); if attr /= Normal_Video then declare begin if not subset (super => Supported_Attributes, sub => attr) then Add (Str => " (N/A)"); elsif ncv > 0 and has_A_COLOR (Get_Background) then declare Color_Supported_Attributes : constant Character_Attribute_Set := make_record (ncv); begin if intersect (Color_Supported_Attributes, attr) then Add (Str => " (NCV) "); end if; end; end if; end; end if; return row + 2; end show_attr; procedure attr_getc (skip : in out Integer; fg, bg : in out Color_Number; result : out Boolean) is ch : constant Key_Code := Getchar; nc : constant Color_Number := Color_Number (Number_Of_Colors); begin result := True; if Ada.Characters.Handling.Is_Digit (Character'Val (ch)) then skip := ctoi (Code_To_Char (ch)); elsif ch = CTRL ('L') then Touch; Touch (Current_Window); Refresh; elsif Has_Colors then case ch is -- Note the mathematical elegance compared to the C version. when Character'Pos ('f') => fg := (fg + 1) mod nc; when Character'Pos ('F') => fg := (fg - 1) mod nc; when Character'Pos ('b') => bg := (bg + 1) mod nc; when Character'Pos ('B') => bg := (bg - 1) mod nc; when others => result := False; end case; else result := False; end if; end attr_getc; -- pairs could be defined as array ( Color_Number(0) .. colors - 1) of -- array (Color_Number(0).. colors - 1) of Boolean; pairs : array (Color_Pair'Range) of Boolean := (others => False); fg, bg : Color_Number := Black; -- = 0; xmc : constant Integer := Get_Number ("xmc"); skip : Integer := xmc; n : Integer; use Int_IO; begin pairs (0) := True; if skip < 0 then skip := 0; end if; n := skip; loop declare row : Line_Position := 2; normal : Attributed_Character := Blank2; -- ??? begin -- row := 2; -- weird, row is set to 0 without this. -- TODO delete the above line, it was a gdb quirk that confused me if Has_Colors then declare pair : constant Color_Pair := Color_Pair (fg * Color_Number (Number_Of_Colors) + bg); begin -- Go though each color pair. Assume that the number of -- Redefinable_Color_Pairs is 8*8 with predefined Colors 0..7 if not pairs (pair) then Init_Pair (pair, fg, bg); pairs (pair) := True; end if; normal.Color := pair; end; end if; Set_Background (Ch => normal); Erase; Add (Line => 0, Column => 20, Str => "Character attribute test display"); row := show_attr (row, n, (Stand_Out => True, others => False), "STANDOUT", True); row := show_attr (row, n, (Reverse_Video => True, others => False), "REVERSE", True); row := show_attr (row, n, (Bold_Character => True, others => False), "BOLD", True); row := show_attr (row, n, (Under_Line => True, others => False), "UNDERLINE", True); row := show_attr (row, n, (Dim_Character => True, others => False), "DIM", True); row := show_attr (row, n, (Blink => True, others => False), "BLINK", True); -- row := show_attr (row, n, (Protected_Character => True, -- others => False), "PROTECT", True); row := show_attr (row, n, (Invisible_Character => True, others => False), "INVISIBLE", True); row := show_attr (row, n, Normal_Video, "NORMAL", False); Move_Cursor (Line => row, Column => 8); if xmc > -1 then Add (Str => "This terminal does have the magic-cookie glitch"); else Add (Str => "This terminal does not have the magic-cookie glitch"); end if; Move_Cursor (Line => row + 1, Column => 8); Add (Str => "Enter a digit to set gaps on each side of " & "displayed attributes"); Move_Cursor (Line => row + 2, Column => 8); Add (Str => "^L = repaint"); if Has_Colors then declare tmp1 : String (1 .. 1); begin Add (Str => ". f/F/b/F toggle colors ("); Put (tmp1, Integer (fg)); Add (Str => tmp1); Add (Ch => '/'); Put (tmp1, Integer (bg)); Add (Str => tmp1); Add (Ch => ')'); end; end if; Refresh; end; declare result : Boolean; begin attr_getc (n, fg, bg, result); exit when not result; end; end loop; Set_Background (Ch => Blank2); Erase; End_Windows; end ncurses2.attr_test; AdaCurses-20170708/samples/ncurses2-demo_pad.ads0000644000175100001440000000567107212274077020045 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.demo_pad; AdaCurses-20170708/samples/tour.adb0000644000175100001440000000571007746514446015506 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- tour -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample; use Sample; procedure Tour is begin Whow; end Tour; AdaCurses-20170708/samples/sample-menu_demo-handler.adb0000644000175100001440000001173011315445062021336 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Menu_Demo.Handler -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2004,2009 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, 1996 -- Version Control -- $Revision: 1.16 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample.Menu_Demo.Aux; with Sample.Manifest; use Sample.Manifest; with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; package body Sample.Menu_Demo.Handler is package Aux renames Sample.Menu_Demo.Aux; procedure Drive_Me (M : Menu; Title : String := "") is L : Line_Count; C : Column_Count; Y : Line_Position; X : Column_Position; begin Aux.Geometry (M, L, C, Y, X); Drive_Me (M, Y, X, Title); end Drive_Me; procedure Drive_Me (M : Menu; Lin : Line_Position; Col : Column_Position; Title : String := "") is Mask : Event_Mask := No_Events; Old : Event_Mask; Pan : Panel := Aux.Create (M, Title, Lin, Col); V : Cursor_Visibility := Invisible; begin -- We are only interested in Clicks with the left button Register_Reportable_Events (Left, All_Clicks, Mask); Old := Start_Mouse (Mask); Set_Cursor_Visibility (V); loop declare K : Key_Code := Aux.Get_Request (M, Pan); R : constant Driver_Result := Driver (M, K); begin case R is when Menu_Ok => null; when Unknown_Request => declare I : constant Item := Current (M); O : Item_Option_Set; begin if K = Key_Mouse then K := SELECT_ITEM; end if; Get_Options (I, O); if K = SELECT_ITEM and then not O.Selectable then Beep; else if My_Driver (M, K, Pan) then exit; end if; end if; end; when others => Beep; end case; end; end loop; End_Mouse (Old); Aux.Destroy (M, Pan); end Drive_Me; end Sample.Menu_Demo.Handler; AdaCurses-20170708/samples/ncurses2-genericputs.ads0000644000175100001440000000772011315445062020613 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2006,2009 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.3 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Bounded; use Ada.Strings.Bounded; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with Terminal_Interface.Curses; generic Max : Natural; -- type mystring is private; -- type myint is package ncurses2.genericPuts is package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (Max); use BS; procedure myGet (Win : Terminal_Interface.Curses.Window := Terminal_Interface.Curses.Standard_Window; Str : out BS.Bounded_String; Len : Integer := -1); procedure myPut (Str : out BS.Bounded_String; i : Integer; Base : Number_Base := 10); -- the default should be Ada.Text_IO.Integer_IO.Default_Base -- but Default_Base is hidden in the generic so doesn't exist! procedure myAdd (Str : BS.Bounded_String); procedure Fill_String (Cp : chars_ptr; Str : out BS.Bounded_String); end ncurses2.genericPuts; AdaCurses-20170708/samples/sample-menu_demo.adb0000644000175100001440000003500611542241134017721 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Menu_Demo -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2008,2011 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, 1996 -- Version Control -- $Revision: 1.19 $ -- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; with Terminal_Interface.Curses.Menus.Menu_User_Data; with Terminal_Interface.Curses.Menus.Item_User_Data; with Sample.Manifest; use Sample.Manifest; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Menu_Demo.Handler; with Sample.Helpers; use Sample.Helpers; with Sample.Explanation; use Sample.Explanation; package body Sample.Menu_Demo is package Spacing_Demo is procedure Spacing_Test; end Spacing_Demo; package body Spacing_Demo is procedure Spacing_Test is function My_Driver (M : Menu; K : Key_Code; P : Panel) return Boolean; procedure Set_Option_Key; procedure Set_Select_Key; procedure Set_Description_Key; procedure Set_Hide_Key; package Mh is new Sample.Menu_Demo.Handler (My_Driver); I : Item_Array_Access := new Item_Array' (New_Item ("January", "31 Days"), New_Item ("February", "28/29 Days"), New_Item ("March", "31 Days"), New_Item ("April", "30 Days"), New_Item ("May", "31 Days"), New_Item ("June", "30 Days"), New_Item ("July", "31 Days"), New_Item ("August", "31 Days"), New_Item ("September", "30 Days"), New_Item ("October", "31 Days"), New_Item ("November", "30 Days"), New_Item ("December", "31 Days"), Null_Item); M : Menu := New_Menu (I); Flip_State : Boolean := True; Hide_Long : Boolean := False; type Format_Code is (Four_By_1, Four_By_2, Four_By_3); type Operations is (Flip, Reorder, Reformat, Reselect, Describe); type Change is array (Operations) of Boolean; pragma Pack (Change); No_Change : constant Change := Change'(others => False); Current_Format : Format_Code := Four_By_1; To_Change : Change := No_Change; function My_Driver (M : Menu; K : Key_Code; P : Panel) return Boolean is begin if M = Null_Menu then raise Menu_Exception; end if; if P = Null_Panel then raise Panel_Exception; end if; To_Change := No_Change; if K in User_Key_Code'Range then if K = QUIT then return True; end if; end if; if K in Special_Key_Code'Range then case K is when Key_F4 => To_Change (Flip) := True; return True; when Key_F5 => To_Change (Reformat) := True; Current_Format := Four_By_1; return True; when Key_F6 => To_Change (Reformat) := True; Current_Format := Four_By_2; return True; when Key_F7 => To_Change (Reformat) := True; Current_Format := Four_By_3; return True; when Key_F8 => To_Change (Reorder) := True; return True; when Key_F9 => To_Change (Reselect) := True; return True; when Key_F10 => if Current_Format /= Four_By_3 then To_Change (Describe) := True; return True; else return False; end if; when Key_F11 => Hide_Long := not Hide_Long; declare O : Item_Option_Set; begin for J in I'Range loop Get_Options (I.all (J), O); O.Selectable := True; if Hide_Long then case J is when 1 | 3 | 5 | 7 | 8 | 10 | 12 => O.Selectable := False; when others => null; end case; end if; Set_Options (I.all (J), O); end loop; end; return False; when others => null; end case; end if; return False; end My_Driver; procedure Set_Option_Key is O : Menu_Option_Set; begin if Current_Format = Four_By_1 then Set_Soft_Label_Key (8, ""); else Get_Options (M, O); if O.Row_Major_Order then Set_Soft_Label_Key (8, "O-Col"); else Set_Soft_Label_Key (8, "O-Row"); end if; end if; Refresh_Soft_Label_Keys_Without_Update; end Set_Option_Key; procedure Set_Select_Key is O : Menu_Option_Set; begin Get_Options (M, O); if O.One_Valued then Set_Soft_Label_Key (9, "Multi"); else Set_Soft_Label_Key (9, "Singl"); end if; Refresh_Soft_Label_Keys_Without_Update; end Set_Select_Key; procedure Set_Description_Key is O : Menu_Option_Set; begin if Current_Format = Four_By_3 then Set_Soft_Label_Key (10, ""); else Get_Options (M, O); if O.Show_Descriptions then Set_Soft_Label_Key (10, "-Desc"); else Set_Soft_Label_Key (10, "+Desc"); end if; end if; Refresh_Soft_Label_Keys_Without_Update; end Set_Description_Key; procedure Set_Hide_Key is begin if Hide_Long then Set_Soft_Label_Key (11, "Enab"); else Set_Soft_Label_Key (11, "Disab"); end if; Refresh_Soft_Label_Keys_Without_Update; end Set_Hide_Key; begin Push_Environment ("MENU01"); Notepad ("MENU-PAD01"); Default_Labels; Set_Soft_Label_Key (4, "Flip"); Set_Soft_Label_Key (5, "4x1"); Set_Soft_Label_Key (6, "4x2"); Set_Soft_Label_Key (7, "4x3"); Set_Option_Key; Set_Select_Key; Set_Description_Key; Set_Hide_Key; Set_Format (M, 4, 1); loop Mh.Drive_Me (M); exit when To_Change = No_Change; if To_Change (Flip) then if Flip_State then Flip_State := False; Set_Spacing (M, 3, 2, 0); else Flip_State := True; Set_Spacing (M); end if; elsif To_Change (Reformat) then case Current_Format is when Four_By_1 => Set_Format (M, 4, 1); when Four_By_2 => Set_Format (M, 4, 2); when Four_By_3 => declare O : Menu_Option_Set; begin Get_Options (M, O); O.Show_Descriptions := False; Set_Options (M, O); Set_Format (M, 4, 3); end; end case; Set_Option_Key; Set_Description_Key; elsif To_Change (Reorder) then declare O : Menu_Option_Set; begin Get_Options (M, O); O.Row_Major_Order := not O.Row_Major_Order; Set_Options (M, O); Set_Option_Key; end; elsif To_Change (Reselect) then declare O : Menu_Option_Set; begin Get_Options (M, O); O.One_Valued := not O.One_Valued; Set_Options (M, O); Set_Select_Key; end; elsif To_Change (Describe) then declare O : Menu_Option_Set; begin Get_Options (M, O); O.Show_Descriptions := not O.Show_Descriptions; Set_Options (M, O); Set_Description_Key; end; else null; end if; end loop; Set_Spacing (M); Pop_Environment; pragma Assert (Get_Index (Items (M, 1)) = Get_Index (I (1))); Delete (M); Free (I, True); end Spacing_Test; end Spacing_Demo; procedure Demo is -- We use this datatype only to test the instantiation of -- the Menu_User_Data generic package. No functionality -- behind it. type User_Data is new Integer; type User_Data_Access is access User_Data; -- Those packages are only instantiated to test the usability. -- No real functionality is shown in the demo. package MUD is new Menu_User_Data (User_Data, User_Data_Access); package IUD is new Item_User_Data (User_Data, User_Data_Access); function My_Driver (M : Menu; K : Key_Code; P : Panel) return Boolean; package Mh is new Sample.Menu_Demo.Handler (My_Driver); Itm : Item_Array_Access := new Item_Array' (New_Item ("Menu Layout Options"), New_Item ("Demo of Hook functions"), Null_Item); M : Menu := New_Menu (Itm); U1 : constant User_Data_Access := new User_Data'(4711); U2 : User_Data_Access; U3 : constant User_Data_Access := new User_Data'(4712); U4 : User_Data_Access; function My_Driver (M : Menu; K : Key_Code; P : Panel) return Boolean is Idx : constant Positive := Get_Index (Current (M)); begin if K in User_Key_Code'Range then if K = QUIT then return True; elsif K = SELECT_ITEM then if Idx in Itm'Range then Hide (P); Update_Panels; end if; case Idx is when 1 => Spacing_Demo.Spacing_Test; when others => Not_Implemented; end case; if Idx in Itm'Range then Top (P); Show (P); Update_Panels; Update_Screen; end if; end if; end if; return False; end My_Driver; begin Push_Environment ("MENU00"); Notepad ("MENU-PAD00"); Default_Labels; Refresh_Soft_Label_Keys_Without_Update; Set_Pad_Character (M, '|'); MUD.Set_User_Data (M, U1); IUD.Set_User_Data (Itm.all (1), U3); Mh.Drive_Me (M); MUD.Get_User_Data (M, U2); pragma Assert (U1 = U2 and U1.all = 4711); IUD.Get_User_Data (Itm.all (1), U4); pragma Assert (U3 = U4 and U3.all = 4712); Pop_Environment; Delete (M); Free (Itm, True); end Demo; end Sample.Menu_Demo; AdaCurses-20170708/samples/sample-menu_demo.ads0000644000175100001440000000571207746514446017767 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Menu_Demo -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Menu_Demo is procedure Demo; end Sample.Menu_Demo; AdaCurses-20170708/samples/sample-my_field_type.adb0000644000175100001440000000722511042670536020613 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.My_Field_Type -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2006,2008 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, 1996 -- Version Control -- $Revision: 1.16 $ -- $Date: 2008/07/26 18:47:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- This is a very simple user defined field type. It accepts only a -- defined character as input into the field. -- package body Sample.My_Field_Type is -- That's simple. There are minimal field validity checks. function Field_Check (Fld : Field; Typ : My_Data) return Boolean is begin if Fld = Null_Field or Typ.Ch = Character'Val (0) then return False; end if; return True; end Field_Check; -- Check exactly against the specified character. function Character_Check (Ch : Character; Typ : My_Data) return Boolean is C : constant Character := Typ.Ch; begin return Ch = C; end Character_Check; end Sample.My_Field_Type; AdaCurses-20170708/samples/ncurses.adb0000644000175100001440000000603407212274072016161 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.m; use ncurses2.m; with GNAT.OS_Lib; use GNAT.OS_Lib; procedure ncurses is begin OS_Exit (main); end ncurses; AdaCurses-20170708/samples/ncurses2-demo_panels.adb0000644000175100001440000003070711542241134020525 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2008,2011 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.7 $ -- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Panels.User_Data; with ncurses2.genericPuts; procedure ncurses2.demo_panels (nap_mseci : Integer) is use Int_IO; function mkpanel (color : Color_Number; rows : Line_Count; cols : Column_Count; tly : Line_Position; tlx : Column_Position) return Panel; procedure rmpanel (pan : in out Panel); procedure pflush; procedure wait_a_while (msec : Integer); procedure saywhat (text : String); procedure fill_panel (pan : Panel); nap_msec : Integer := nap_mseci; function mkpanel (color : Color_Number; rows : Line_Count; cols : Column_Count; tly : Line_Position; tlx : Column_Position) return Panel is win : Window; pan : Panel := Null_Panel; begin win := New_Window (rows, cols, tly, tlx); if Null_Window /= win then pan := New_Panel (win); if pan = Null_Panel then Delete (win); elsif Has_Colors then declare fg, bg : Color_Number; begin if color = Blue then fg := White; else fg := Black; end if; bg := color; Init_Pair (Color_Pair (color), fg, bg); Set_Background (win, (Ch => ' ', Attr => Normal_Video, Color => Color_Pair (color))); end; else Set_Background (win, (Ch => ' ', Attr => (Bold_Character => True, others => False), Color => Color_Pair (color))); end if; end if; return pan; end mkpanel; procedure rmpanel (pan : in out Panel) is win : Window := Panel_Window (pan); begin Delete (pan); Delete (win); end rmpanel; procedure pflush is begin Update_Panels; Update_Screen; end pflush; procedure wait_a_while (msec : Integer) is begin -- The C version had some #ifdef blocks here if msec = 1 then Getchar; else Nap_Milli_Seconds (msec); end if; end wait_a_while; procedure saywhat (text : String) is begin Move_Cursor (Line => Lines - 1, Column => 0); Clear_To_End_Of_Line; Add (Str => text); end saywhat; -- from sample-curses_demo.adb type User_Data is new String (1 .. 2); type User_Data_Access is access all User_Data; package PUD is new Panels.User_Data (User_Data, User_Data_Access); use PUD; procedure fill_panel (pan : Panel) is win : constant Window := Panel_Window (pan); num : constant Character := Get_User_Data (pan).all (2); tmp6 : String (1 .. 6) := "-panx-"; maxy : Line_Count; maxx : Column_Count; begin Move_Cursor (win, 1, 1); tmp6 (5) := num; Add (win, Str => tmp6); Clear_To_End_Of_Line (win); Box (win); Get_Size (win, maxy, maxx); for y in 2 .. maxy - 3 loop for x in 1 .. maxx - 3 loop Move_Cursor (win, y, x); Add (win, num); end loop; end loop; exception when Curses_Exception => null; end fill_panel; modstr : constant array (0 .. 5) of String (1 .. 5) := ("test ", "TEST ", "(**) ", "*()* ", "<--> ", "LAST " ); package p is new ncurses2.genericPuts (1024); use p; use p.BS; -- the C version said register int y, x; tmpb : BS.Bounded_String; begin Refresh; for y in 0 .. Integer (Lines - 2) loop for x in 0 .. Integer (Columns - 1) loop myPut (tmpb, (y + x) mod 10); myAdd (Str => tmpb); end loop; end loop; for y in 0 .. 4 loop declare p1, p2, p3, p4, p5 : Panel; U1 : constant User_Data_Access := new User_Data'("p1"); U2 : constant User_Data_Access := new User_Data'("p2"); U3 : constant User_Data_Access := new User_Data'("p3"); U4 : constant User_Data_Access := new User_Data'("p4"); U5 : constant User_Data_Access := new User_Data'("p5"); begin p1 := mkpanel (Red, Lines / 2 - 2, Columns / 8 + 1, 0, 0); Set_User_Data (p1, U1); p2 := mkpanel (Green, Lines / 2 + 1, Columns / 7, Lines / 4, Columns / 10); Set_User_Data (p2, U2); p3 := mkpanel (Yellow, Lines / 4, Columns / 10, Lines / 2, Columns / 9); Set_User_Data (p3, U3); p4 := mkpanel (Blue, Lines / 2 - 2, Columns / 8, Lines / 2 - 2, Columns / 3); Set_User_Data (p4, U4); p5 := mkpanel (Magenta, Lines / 2 - 2, Columns / 8, Lines / 2, Columns / 2 - 2); Set_User_Data (p5, U5); fill_panel (p1); fill_panel (p2); fill_panel (p3); fill_panel (p4); fill_panel (p5); Hide (p4); Hide (p5); pflush; saywhat ("press any key to continue"); wait_a_while (nap_msec); saywhat ("h3 s1 s2 s4 s5; press any key to continue"); Move (p1, 0, 0); Hide (p3); Show (p1); Show (p2); Show (p4); Show (p5); pflush; wait_a_while (nap_msec); saywhat ("s1; press any key to continue"); Show (p1); pflush; wait_a_while (nap_msec); saywhat ("s2; press any key to continue"); Show (p2); pflush; wait_a_while (nap_msec); saywhat ("m2; press any key to continue"); Move (p2, Lines / 3 + 1, Columns / 8); pflush; wait_a_while (nap_msec); saywhat ("s3;"); Show (p3); pflush; wait_a_while (nap_msec); saywhat ("m3; press any key to continue"); Move (p3, Lines / 4 + 1, Columns / 15); pflush; wait_a_while (nap_msec); saywhat ("b3; press any key to continue"); Bottom (p3); pflush; wait_a_while (nap_msec); saywhat ("s4; press any key to continue"); Show (p4); pflush; wait_a_while (nap_msec); saywhat ("s5; press any key to continue"); Show (p5); pflush; wait_a_while (nap_msec); saywhat ("t3; press any key to continue"); Top (p3); pflush; wait_a_while (nap_msec); saywhat ("t1; press any key to continue"); Top (p1); pflush; wait_a_while (nap_msec); saywhat ("t2; press any key to continue"); Top (p2); pflush; wait_a_while (nap_msec); saywhat ("t3; press any key to continue"); Top (p3); pflush; wait_a_while (nap_msec); saywhat ("t4; press any key to continue"); Top (p4); pflush; wait_a_while (nap_msec); for itmp in 0 .. 5 loop declare w4 : constant Window := Panel_Window (p4); w5 : constant Window := Panel_Window (p5); begin saywhat ("m4; press any key to continue"); Move_Cursor (w4, Lines / 8, 1); Add (w4, modstr (itmp)); Move (p4, Lines / 6, Column_Position (itmp) * (Columns / 8)); Move_Cursor (w5, Lines / 6, 1); Add (w5, modstr (itmp)); pflush; wait_a_while (nap_msec); saywhat ("m5; press any key to continue"); Move_Cursor (w4, Lines / 6, 1); Add (w4, modstr (itmp)); Move (p5, Lines / 3 - 1, (Column_Position (itmp) * 10) + 6); Move_Cursor (w5, Lines / 8, 1); Add (w5, modstr (itmp)); pflush; wait_a_while (nap_msec); end; end loop; saywhat ("m4; press any key to continue"); Move (p4, Lines / 6, 6 * (Columns / 8)); -- Move(p4, Lines / 6, itmp * (Columns / 8)); pflush; wait_a_while (nap_msec); saywhat ("t5; press any key to continue"); Top (p5); pflush; wait_a_while (nap_msec); saywhat ("t2; press any key to continue"); Top (p2); pflush; wait_a_while (nap_msec); saywhat ("t1; press any key to continue"); Top (p1); pflush; wait_a_while (nap_msec); saywhat ("d2; press any key to continue"); rmpanel (p2); pflush; wait_a_while (nap_msec); saywhat ("h3; press any key to continue"); Hide (p3); pflush; wait_a_while (nap_msec); saywhat ("d1; press any key to continue"); rmpanel (p1); pflush; wait_a_while (nap_msec); saywhat ("d4; press any key to continue"); rmpanel (p4); pflush; wait_a_while (nap_msec); saywhat ("d5; press any key to continue"); rmpanel (p5); pflush; wait_a_while (nap_msec); if nap_msec = 1 then exit; else nap_msec := 100; end if; end; end loop; Erase; End_Windows; end ncurses2.demo_panels; AdaCurses-20170708/samples/sample-curses_demo-attributes.ads0000644000175100001440000000574407746514446022520 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Curses_Demo.Attributes -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Curses_Demo.Attributes is procedure Demo; end Sample.Curses_Demo.Attributes; AdaCurses-20170708/samples/sample-form_demo.adb0000644000175100001440000001331411542241134017716 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Form_Demo -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2006,2011 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, 1996 -- Version Control -- $Revision: 1.16 $ -- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; with Terminal_Interface.Curses.Forms.Field_User_Data; with Sample.My_Field_Type; use Sample.My_Field_Type; with Sample.Explanation; use Sample.Explanation; with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Form_Demo.Handler; with Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada; with Terminal_Interface.Curses.Forms.Field_Types.Enumeration; use Terminal_Interface.Curses.Forms.Field_Types.Enumeration; with Terminal_Interface.Curses.Forms.Field_Types.IntField; use Terminal_Interface.Curses.Forms.Field_Types.IntField; package body Sample.Form_Demo is type User_Data is record Data : Integer; end record; type User_Access is access User_Data; package Fld_U is new Terminal_Interface.Curses.Forms.Field_User_Data (User_Data, User_Access); type Weekday is (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday); package Weekday_Enum is new Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada (Weekday); Enum_Field : constant Enumeration_Field := Weekday_Enum.Create; procedure Demo is Mft : constant My_Data := (Ch => 'X'); FA : Field_Array_Access := new Field_Array' (Make (0, 14, "Sample Entry Form"), Make (2, 0, "WeekdayEnumeration"), Make (2, 20, "Numeric 1-10"), Make (2, 34, "Only 'X'"), Make (5, 0, "Multiple Lines offscreen(Scroll)"), Make (Width => 18, Top => 3, Left => 0), Make (Width => 12, Top => 3, Left => 20), Make (Width => 12, Top => 3, Left => 34), Make (Width => 46, Top => 6, Left => 0, Height => 4, Off_Screen => 2), Null_Field ); Frm : Terminal_Interface.Curses.Forms.Form := Create (FA); I_F : constant Integer_Field := (Precision => 0, Lower_Limit => 1, Upper_Limit => 10); F1, F2 : User_Access; package Fh is new Sample.Form_Demo.Handler (Default_Driver); begin Push_Environment ("FORM00"); Notepad ("FORM-PAD00"); Default_Labels; Set_Field_Type (FA.all (6), Enum_Field); Set_Field_Type (FA.all (7), I_F); Set_Field_Type (FA.all (8), Mft); F1 := new User_Data'(Data => 4711); Fld_U.Set_User_Data (FA.all (1), F1); Fh.Drive_Me (Frm); Fld_U.Get_User_Data (FA.all (1), F2); pragma Assert (F1 = F2); pragma Assert (F1.Data = F2.Data); Pop_Environment; Delete (Frm); Free (FA, True); end Demo; end Sample.Form_Demo; AdaCurses-20170708/samples/ncurses2-color_edit.ads0000644000175100001440000000567307212274074020417 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.color_edit; AdaCurses-20170708/samples/sample-header_handler.adb0000644000175100001440000001744712405113232020703 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Header_Handler -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control -- $Revision: 1.20 $ -- $Date: 2014/09/13 19:10:18 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Calendar; use Ada.Calendar; with Terminal_Interface.Curses.Text_IO.Integer_IO; with Sample.Manifest; use Sample.Manifest; pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Integer_IO); -- This package handles the painting of the header line of the screen. -- package body Sample.Header_Handler is package Int_IO is new Terminal_Interface.Curses.Text_IO.Integer_IO (Integer); use Int_IO; Header_Window : Window := Null_Window; Display_Hour : Integer := -1; -- hour last displayed Display_Min : Integer := -1; -- minute last displayed Display_Day : Integer := -1; -- day last displayed Display_Month : Integer := -1; -- month last displayed -- This is the routine handed over to the curses library to be called -- as initialization routine when ripping of the header lines from -- the screen. This routine must follow C conventions. function Init_Header_Window (Win : Window; Columns : Column_Count) return Integer; pragma Convention (C, Init_Header_Window); procedure Internal_Update_Header_Window (Do_Update : Boolean); -- The initialization must be called before Init_Screen. It steals two -- lines from the top of the screen. procedure Init_Header_Handler is begin Rip_Off_Lines (2, Init_Header_Window'Access); end Init_Header_Handler; procedure N_Out (N : Integer); -- Emit a two digit number and ensure that a leading zero is generated if -- necessary. procedure N_Out (N : Integer) is begin if N < 10 then Add (Header_Window, '0'); Put (Header_Window, N, 1); else Put (Header_Window, N, 2); end if; end N_Out; -- Paint the header window. The input parameter is a flag indicating -- whether or not the screen should be updated physically after painting. procedure Internal_Update_Header_Window (Do_Update : Boolean) is type Month_Name_Array is array (Month_Number'First .. Month_Number'Last) of String (1 .. 9); Month_Names : constant Month_Name_Array := ("January ", "February ", "March ", "April ", "May ", "June ", "July ", "August ", "September", "October ", "November ", "December "); Now : constant Time := Clock; Sec : constant Integer := Integer (Seconds (Now)); Hour : constant Integer := Sec / 3600; Minute : constant Integer := (Sec - Hour * 3600) / 60; Mon : constant Month_Number := Month (Now); D : constant Day_Number := Day (Now); begin if Header_Window /= Null_Window then if Minute /= Display_Min or else Hour /= Display_Hour or else Display_Day /= D or else Display_Month /= Mon then Move_Cursor (Header_Window, 0, 0); N_Out (D); Add (Header_Window, '.'); Add (Header_Window, Month_Names (Mon)); Move_Cursor (Header_Window, 1, 0); N_Out (Hour); Add (Header_Window, ':'); N_Out (Minute); Display_Min := Minute; Display_Hour := Hour; Display_Month := Mon; Display_Day := D; Refresh_Without_Update (Header_Window); if Do_Update then Update_Screen; end if; end if; end if; end Internal_Update_Header_Window; -- This routine is called in the keyboard input timeout handler. So it will -- periodically update the header line of the screen. procedure Update_Header_Window is begin Internal_Update_Header_Window (True); end Update_Header_Window; function Init_Header_Window (Win : Window; Columns : Column_Count) return Integer is Title : constant String := "Ada 95 ncurses Binding Sample"; Pos : Column_Position; begin Header_Window := Win; if Win /= Null_Window then if Has_Colors then Set_Background (Win => Win, Ch => (Ch => ' ', Color => Header_Color, Attr => Normal_Video)); Set_Character_Attributes (Win => Win, Attr => Normal_Video, Color => Header_Color); Erase (Win); end if; Leave_Cursor_After_Update (Win, True); Pos := Columns - Column_Position (Title'Length); Add (Win, 0, Pos / 2, Title); -- In this phase we must not allow a physical update, because -- ncurses is not properly initialized at this point. Internal_Update_Header_Window (False); return 0; else return -1; end if; end Init_Header_Window; end Sample.Header_Handler; AdaCurses-20170708/samples/sample-manifest.ads0000644000175100001440000000775607746514446017637 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Manifest -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; package Sample.Manifest is QUIT : constant User_Key_Code := User_Key_Code'First; SELECT_ITEM : constant User_Key_Code := QUIT + 1; FKEY_HELP : constant Label_Number := 1; HELP_CODE : constant Special_Key_Code := Key_F1; FKEY_EXPLAIN : constant Label_Number := 2; EXPLAIN_CODE : constant Special_Key_Code := Key_F2; FKEY_QUIT : constant Label_Number := 3; QUIT_CODE : constant Special_Key_Code := Key_F3; Menu_Marker : constant String := "=> "; Default_Colors : constant Redefinable_Color_Pair := 1; Menu_Fore_Color : constant Redefinable_Color_Pair := 2; Menu_Back_Color : constant Redefinable_Color_Pair := 3; Menu_Grey_Color : constant Redefinable_Color_Pair := 4; Form_Fore_Color : constant Redefinable_Color_Pair := 5; Form_Back_Color : constant Redefinable_Color_Pair := 6; Notepad_Color : constant Redefinable_Color_Pair := 7; Help_Color : constant Redefinable_Color_Pair := 8; Header_Color : constant Redefinable_Color_Pair := 9; end Sample.Manifest; AdaCurses-20170708/samples/ncurses2-getch_test.ads0000644000175100001440000000567307212274046020424 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.getch_test; AdaCurses-20170708/samples/sample-helpers.ads0000644000175100001440000000640411541117407017440 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Helpers -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2011 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, 1996 -- Version Control -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; -- This package contains some convenient helper routines used throughout -- this example. -- package Sample.Helpers is procedure Window_Title (Win : Window; Title : String); -- Put a title string into the first line of the window procedure Not_Implemented; end Sample.Helpers; AdaCurses-20170708/samples/ncurses2-getopt.ads0000644000175100001440000000710010447516250017560 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000,2006 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.2 $ -- $Date: 2006/06/25 14:24:40 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package ncurses2.getopt is type stringa is access String; type stringfunc is access function (n : Positive) return String; procedure Qgetopt (retval : out Integer; argc : Integer; argv : stringfunc; optstring : String; optind : in out Integer; -- ignored for ncurses, must be initialized to 0 -- by the caller Optarg : out stringa -- a garbage collector would be useful here. ); end ncurses2.getopt; AdaCurses-20170708/samples/status.ads0000644000175100001440000000674107746514446016066 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Status -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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: Laurent Pautet -- Modified by: Juergen Pfeifer, 1997 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- This package has been contributed by Laurent Pautet -- -- -- with Ada.Interrupts.Names; package Status is pragma Warnings (Off); -- the next pragma exists since 3.11p pragma Unreserve_All_Interrupts; pragma Warnings (On); protected Process is procedure Stop; function Continue return Boolean; pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT); private Done : Boolean := False; end Process; end Status; AdaCurses-20170708/samples/sample-helpers.adb0000644000175100001440000000710011541116741017411 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Helpers -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2009,2011 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, 1996 -- Version Control -- $Revision: 1.14 $ -- $Date: 2011/03/19 12:13:21 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample.Explanation; use Sample.Explanation; -- This package contains some convenient helper routines used throughout -- this example. -- package body Sample.Helpers is procedure Window_Title (Win : Window; Title : String) is Height : Line_Count; Width : Column_Count; Pos : Column_Position := 0; begin Get_Size (Win, Height, Width); if Title'Length < Width then Pos := (Width - Title'Length) / 2; end if; Add (Win, 0, Pos, Title); end Window_Title; procedure Not_Implemented is begin Explain ("NOTIMPL"); end Not_Implemented; end Sample.Helpers; AdaCurses-20170708/samples/sample-menu_demo-aux.adb0000644000175100001440000002133611315445062020521 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Menu_Demo.Aux -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2006,2009 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, 1996 -- Version Control -- $Revision: 1.14 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Sample.Manifest; use Sample.Manifest; with Sample.Helpers; use Sample.Helpers; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Explanation; use Sample.Explanation; package body Sample.Menu_Demo.Aux is procedure Geometry (M : Menu; L : out Line_Count; C : out Column_Count; Y : out Line_Position; X : out Column_Position; Fy : out Line_Position; Fx : out Column_Position); procedure Geometry (M : Menu; L : out Line_Count; -- Lines used for menu C : out Column_Count; -- Columns used for menu Y : out Line_Position; -- Proposed Line for menu X : out Column_Position; -- Proposed Column for menu Fy : out Line_Position; -- Vertical inner frame Fx : out Column_Position) -- Horiz. inner frame is Spc_Desc : Column_Position; -- spaces between description and item begin Set_Mark (M, Menu_Marker); Spacing (M, Spc_Desc, Fy, Fx); Scale (M, L, C); Fx := Fx + Column_Position (Fy - 1); -- looks a bit nicer L := L + 2 * Fy; -- count for frame at top and bottom C := C + 2 * Fx; -- " -- Calculate horizontal coordinate at the screen center X := (Columns - C) / 2; Y := 1; -- always startin line 1 end Geometry; procedure Geometry (M : Menu; L : out Line_Count; -- Lines used for menu C : out Column_Count; -- Columns used for menu Y : out Line_Position; -- Proposed Line for menu X : out Column_Position) -- Proposed Column for menu is Fy : Line_Position; Fx : Column_Position; begin Geometry (M, L, C, Y, X, Fy, Fx); end Geometry; function Create (M : Menu; Title : String; Lin : Line_Position; Col : Column_Position) return Panel is W, S : Window; L : Line_Count; C : Column_Count; Y, Fy : Line_Position; X, Fx : Column_Position; Pan : Panel; begin Geometry (M, L, C, Y, X, Fy, Fx); W := New_Window (L, C, Lin, Col); Set_Meta_Mode (W); Set_KeyPad_Mode (W); if Has_Colors then Set_Background (Win => W, Ch => (Ch => ' ', Color => Menu_Back_Color, Attr => Normal_Video)); Set_Foreground (Men => M, Color => Menu_Fore_Color); Set_Background (Men => M, Color => Menu_Back_Color); Set_Grey (Men => M, Color => Menu_Grey_Color); Erase (W); end if; S := Derived_Window (W, L - Fy, C - Fx, Fy, Fx); Set_Meta_Mode (S); Set_KeyPad_Mode (S); Box (W); Set_Window (M, W); Set_Sub_Window (M, S); if Title'Length > 0 then Window_Title (W, Title); end if; Pan := New_Panel (W); Post (M); return Pan; end Create; procedure Destroy (M : Menu; P : in out Panel) is W, S : Window; begin W := Get_Window (M); S := Get_Sub_Window (M); Post (M, False); Erase (W); Delete (P); Set_Window (M, Null_Window); Set_Sub_Window (M, Null_Window); Delete (S); Delete (W); Update_Panels; end Destroy; function Get_Request (M : Menu; P : Panel) return Key_Code is W : constant Window := Get_Window (M); K : Real_Key_Code; Ch : Character; begin Top (P); loop K := Get_Key (W); if K in Special_Key_Code'Range then case K is when HELP_CODE => Explain_Context; when EXPLAIN_CODE => Explain ("MENUKEYS"); when Key_Home => return REQ_FIRST_ITEM; when QUIT_CODE => return QUIT; when Key_Cursor_Down => return REQ_DOWN_ITEM; when Key_Cursor_Up => return REQ_UP_ITEM; when Key_Cursor_Left => return REQ_LEFT_ITEM; when Key_Cursor_Right => return REQ_RIGHT_ITEM; when Key_End => return REQ_LAST_ITEM; when Key_Backspace => return REQ_BACK_PATTERN; when Key_Next_Page => return REQ_SCR_DPAGE; when Key_Previous_Page => return REQ_SCR_UPAGE; when others => return K; end case; elsif K in Normal_Key_Code'Range then Ch := Character'Val (K); case Ch is when CAN => return QUIT; -- CTRL-X when SO => return REQ_NEXT_ITEM; -- CTRL-N when DLE => return REQ_PREV_ITEM; -- CTRL-P when NAK => return REQ_SCR_ULINE; -- CTRL-U when EOT => return REQ_SCR_DLINE; -- CTRL-D when ACK => return REQ_SCR_DPAGE; -- CTRL-F when STX => return REQ_SCR_UPAGE; -- CTRL-B when EM => return REQ_CLEAR_PATTERN; -- CTRL-Y when BS => return REQ_BACK_PATTERN; -- CTRL-H when SOH => return REQ_NEXT_MATCH; -- CTRL-A when ENQ => return REQ_PREV_MATCH; -- CTRL-E when DC4 => return REQ_TOGGLE_ITEM; -- CTRL-T when CR | LF => return SELECT_ITEM; when others => return K; end case; else return K; end if; end loop; end Get_Request; end Sample.Menu_Demo.Aux; AdaCurses-20170708/samples/ncurses2-getch.ads0000644000175100001440000000566207212274045017362 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure getch_test; AdaCurses-20170708/samples/ncurses2-acs_and_scroll.adb0000644000175100001440000006354511542237674021231 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2009,2011 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.11 $ -- $Date: 2011/03/23 00:33:00 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- Windows and scrolling tester. -- Demonstrate windows with Ada.Strings.Fixed; with Ada.Strings; with ncurses2.util; use ncurses2.util; with ncurses2.genericPuts; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; with Terminal_Interface.Curses.PutWin; use Terminal_Interface.Curses.PutWin; with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with Ada.Streams; use Ada.Streams; procedure ncurses2.acs_and_scroll is Macro_Quit : constant Key_Code := Character'Pos ('Q') mod 16#20#; Macro_Escape : constant Key_Code := Character'Pos ('[') mod 16#20#; Quit : constant Key_Code := CTRL ('Q'); Escape : constant Key_Code := CTRL ('['); Botlines : constant Line_Position := 4; type pair is record y : Line_Position; x : Column_Position; end record; type Frame; type FrameA is access Frame; f : File_Type; dumpfile : constant String := "screendump"; procedure Outerbox (ul, lr : pair; onoff : Boolean); function HaveKeyPad (w : Window) return Boolean; function HaveScroll (w : Window) return Boolean; procedure newwin_legend (curpw : Window); procedure transient (curpw : Window; msg : String); procedure newwin_report (win : Window := Standard_Window); procedure selectcell (uli : Line_Position; ulj : Column_Position; lri : Line_Position; lrj : Column_Position; p : out pair; b : out Boolean); function getwindow return Window; procedure newwin_move (win : Window; dy : Line_Position; dx : Column_Position); function delete_framed (fp : FrameA; showit : Boolean) return FrameA; -- A linked list -- I wish there was a standard library linked list. Oh well. type Frame is record next, last : FrameA; do_scroll : Boolean; do_keypad : Boolean; wind : Window; end record; current : FrameA; c : Key_Code; procedure Outerbox (ul, lr : pair; onoff : Boolean) is begin if onoff then -- Note the fix of an obscure bug -- try making a 1x1 box then enlarging it, the is a blank -- upper left corner! Add (Line => ul.y - 1, Column => ul.x - 1, Ch => ACS_Map (ACS_Upper_Left_Corner)); Add (Line => ul.y - 1, Column => lr.x + 1, Ch => ACS_Map (ACS_Upper_Right_Corner)); Add (Line => lr.y + 1, Column => lr.x + 1, Ch => ACS_Map (ACS_Lower_Right_Corner)); Add (Line => lr.y + 1, Column => ul.x - 1, Ch => ACS_Map (ACS_Lower_Left_Corner)); Move_Cursor (Line => ul.y - 1, Column => ul.x); Horizontal_Line (Line_Symbol => ACS_Map (ACS_Horizontal_Line), Line_Size => Integer (lr.x - ul.x) + 1); Move_Cursor (Line => ul.y, Column => ul.x - 1); Vertical_Line (Line_Symbol => ACS_Map (ACS_Vertical_Line), Line_Size => Integer (lr.y - ul.y) + 1); Move_Cursor (Line => lr.y + 1, Column => ul.x); Horizontal_Line (Line_Symbol => ACS_Map (ACS_Horizontal_Line), Line_Size => Integer (lr.x - ul.x) + 1); Move_Cursor (Line => ul.y, Column => lr.x + 1); Vertical_Line (Line_Symbol => ACS_Map (ACS_Vertical_Line), Line_Size => Integer (lr.y - ul.y) + 1); else Add (Line => ul.y - 1, Column => ul.x - 1, Ch => ' '); Add (Line => ul.y - 1, Column => lr.x + 1, Ch => ' '); Add (Line => lr.y + 1, Column => lr.x + 1, Ch => ' '); Add (Line => lr.y + 1, Column => ul.x - 1, Ch => ' '); Move_Cursor (Line => ul.y - 1, Column => ul.x); Horizontal_Line (Line_Symbol => Blank2, Line_Size => Integer (lr.x - ul.x) + 1); Move_Cursor (Line => ul.y, Column => ul.x - 1); Vertical_Line (Line_Symbol => Blank2, Line_Size => Integer (lr.y - ul.y) + 1); Move_Cursor (Line => lr.y + 1, Column => ul.x); Horizontal_Line (Line_Symbol => Blank2, Line_Size => Integer (lr.x - ul.x) + 1); Move_Cursor (Line => ul.y, Column => lr.x + 1); Vertical_Line (Line_Symbol => Blank2, Line_Size => Integer (lr.y - ul.y) + 1); end if; end Outerbox; function HaveKeyPad (w : Window) return Boolean is begin return Get_KeyPad_Mode (w); exception when Curses_Exception => return False; end HaveKeyPad; function HaveScroll (w : Window) return Boolean is begin return Scrolling_Allowed (w); exception when Curses_Exception => return False; end HaveScroll; procedure newwin_legend (curpw : Window) is package p is new genericPuts (200); use p; use p.BS; type string_a is access String; type rrr is record msg : string_a; code : Integer range 0 .. 3; end record; legend : constant array (Positive range <>) of rrr := ( ( new String'("^C = create window"), 0 ), ( new String'("^N = next window"), 0 ), ( new String'("^P = previous window"), 0 ), ( new String'("^F = scroll forward"), 0 ), ( new String'("^B = scroll backward"), 0 ), ( new String'("^K = keypad(%s)"), 1 ), ( new String'("^S = scrollok(%s)"), 2 ), ( new String'("^W = save window to file"), 0 ), ( new String'("^R = restore window"), 0 ), ( new String'("^X = resize"), 0 ), ( new String'("^Q%s = exit"), 3 ) ); buf : Bounded_String; do_keypad : constant Boolean := HaveKeyPad (curpw); do_scroll : constant Boolean := HaveScroll (curpw); pos : Natural; mypair : pair; use Ada.Strings.Fixed; begin Move_Cursor (Line => Lines - 4, Column => 0); for n in legend'Range loop pos := Ada.Strings.Fixed.Index (Source => legend (n).msg.all, Pattern => "%s"); -- buf := (others => ' '); buf := To_Bounded_String (legend (n).msg.all); case legend (n).code is when 0 => null; when 1 => if do_keypad then Replace_Slice (buf, pos, pos + 1, "yes"); else Replace_Slice (buf, pos, pos + 1, "no"); end if; when 2 => if do_scroll then Replace_Slice (buf, pos, pos + 1, "yes"); else Replace_Slice (buf, pos, pos + 1, "no"); end if; when 3 => if do_keypad then Replace_Slice (buf, pos, pos + 1, "/ESC"); else Replace_Slice (buf, pos, pos + 1, ""); end if; end case; Get_Cursor_Position (Line => mypair.y, Column => mypair.x); if Columns < mypair.x + 3 + Column_Position (Length (buf)) then Add (Ch => newl); elsif n /= 1 then -- n /= legen'First Add (Str => ", "); end if; myAdd (Str => buf); end loop; Clear_To_End_Of_Line; end newwin_legend; procedure transient (curpw : Window; msg : String) is begin newwin_legend (curpw); if msg /= "" then Add (Line => Lines - 1, Column => 0, Str => msg); Refresh; Nap_Milli_Seconds (1000); end if; Move_Cursor (Line => Lines - 1, Column => 0); if HaveKeyPad (curpw) then Add (Str => "Non-arrow"); else Add (Str => "All other"); end if; Add (Str => " characters are echoed, window should "); if not HaveScroll (curpw) then Add (Str => "not "); end if; Add (Str => "scroll"); Clear_To_End_Of_Line; end transient; procedure newwin_report (win : Window := Standard_Window) is y : Line_Position; x : Column_Position; use Int_IO; tmp2a : String (1 .. 2); tmp2b : String (1 .. 2); begin if win /= Standard_Window then transient (win, ""); end if; Get_Cursor_Position (win, y, x); Move_Cursor (Line => Lines - 1, Column => Columns - 17); Put (tmp2a, Integer (y)); Put (tmp2b, Integer (x)); Add (Str => "Y = " & tmp2a & " X = " & tmp2b); if win /= Standard_Window then Refresh; else Move_Cursor (win, y, x); end if; end newwin_report; procedure selectcell (uli : Line_Position; ulj : Column_Position; lri : Line_Position; lrj : Column_Position; p : out pair; b : out Boolean) is c : Key_Code; res : pair; i : Line_Position := 0; j : Column_Position := 0; si : constant Line_Position := lri - uli + 1; sj : constant Column_Position := lrj - ulj + 1; begin res.y := uli; res.x := ulj; loop Move_Cursor (Line => uli + i, Column => ulj + j); newwin_report; c := Getchar; case c is when Macro_Quit | Macro_Escape => -- on the same line macro calls interfere due to the # comment -- this is needed because keypad off affects all windows. -- try removing the ESCAPE and see what happens. b := False; return; when KEY_UP => i := i + si - 1; -- same as i := i - 1 because of Modulus arithmetic, -- on Line_Position, which is a Natural -- the C version uses this form too, interestingly. when KEY_DOWN => i := i + 1; when KEY_LEFT => j := j + sj - 1; when KEY_RIGHT => j := j + 1; when Key_Mouse => declare event : Mouse_Event; y : Line_Position; x : Column_Position; Button : Mouse_Button; State : Button_State; begin event := Get_Mouse; Get_Event (Event => event, Y => y, X => x, Button => Button, State => State); if y > uli and x > ulj then i := y - uli; j := x - ulj; -- same as when others => res.y := uli + i; res.x := ulj + j; p := res; b := True; return; else Beep; end if; end; when others => res.y := uli + i; res.x := ulj + j; p := res; b := True; return; end case; i := i mod si; j := j mod sj; end loop; end selectcell; function getwindow return Window is rwindow : Window; ul, lr : pair; result : Boolean; begin Move_Cursor (Line => 0, Column => 0); Clear_To_End_Of_Line; Add (Str => "Use arrows to move cursor, anything else to mark corner 1"); Refresh; selectcell (2, 1, Lines - Botlines - 2, Columns - 2, ul, result); if not result then return Null_Window; end if; Add (Line => ul.y - 1, Column => ul.x - 1, Ch => ACS_Map (ACS_Upper_Left_Corner)); Move_Cursor (Line => 0, Column => 0); Clear_To_End_Of_Line; Add (Str => "Use arrows to move cursor, anything else to mark corner 2"); Refresh; selectcell (ul.y, ul.x, Lines - Botlines - 2, Columns - 2, lr, result); if not result then return Null_Window; end if; rwindow := Sub_Window (Number_Of_Lines => lr.y - ul.y + 1, Number_Of_Columns => lr.x - ul.x + 1, First_Line_Position => ul.y, First_Column_Position => ul.x); Outerbox (ul, lr, True); Refresh; Refresh (rwindow); Move_Cursor (Line => 0, Column => 0); Clear_To_End_Of_Line; return rwindow; end getwindow; procedure newwin_move (win : Window; dy : Line_Position; dx : Column_Position) is cur_y, max_y : Line_Position; cur_x, max_x : Column_Position; begin Get_Cursor_Position (win, cur_y, cur_x); Get_Size (win, max_y, max_x); cur_x := Column_Position'Min (Column_Position'Max (cur_x + dx, 0), max_x - 1); cur_y := Line_Position'Min (Line_Position'Max (cur_y + dy, 0), max_y - 1); Move_Cursor (win, Line => cur_y, Column => cur_x); end newwin_move; function delete_framed (fp : FrameA; showit : Boolean) return FrameA is np : FrameA; begin fp.all.last.all.next := fp.all.next; fp.all.next.all.last := fp.all.last; if showit then Erase (fp.all.wind); Refresh (fp.all.wind); end if; Delete (fp.all.wind); if fp = fp.all.next then np := null; else np := fp.all.next; end if; -- TODO free(fp); return np; end delete_framed; Mask : Event_Mask := No_Events; Mask2 : Event_Mask; usescr : Window; begin if Has_Mouse then Register_Reportable_Event ( Button => Left, State => Clicked, Mask => Mask); Mask2 := Start_Mouse (Mask); end if; c := CTRL ('C'); Set_Raw_Mode (SwitchOn => True); loop transient (Standard_Window, ""); case c is when Character'Pos ('c') mod 16#20# => -- Ctrl('c') declare neww : constant FrameA := new Frame'(null, null, False, False, Null_Window); begin neww.all.wind := getwindow; if neww.all.wind = Null_Window then exit; -- was goto breakout; ha ha ha else if current = null then neww.all.next := neww; neww.all.last := neww; else neww.all.next := current.all.next; neww.all.last := current; neww.all.last.all.next := neww; neww.all.next.all.last := neww; end if; current := neww; Set_KeyPad_Mode (current.all.wind, True); current.all.do_keypad := HaveKeyPad (current.all.wind); current.all.do_scroll := HaveScroll (current.all.wind); end if; end; when Character'Pos ('N') mod 16#20# => -- Ctrl('N') if current /= null then current := current.all.next; end if; when Character'Pos ('P') mod 16#20# => -- Ctrl('P') if current /= null then current := current.all.last; end if; when Character'Pos ('F') mod 16#20# => -- Ctrl('F') if current /= null and then HaveScroll (current.all.wind) then Scroll (current.all.wind, 1); end if; when Character'Pos ('B') mod 16#20# => -- Ctrl('B') if current /= null and then HaveScroll (current.all.wind) then -- The C version of Scroll may return ERR which is ignored -- we need to avoid the exception -- with the 'and HaveScroll(current.wind)' Scroll (current.all.wind, -1); end if; when Character'Pos ('K') mod 16#20# => -- Ctrl('K') if current /= null then current.all.do_keypad := not current.all.do_keypad; Set_KeyPad_Mode (current.all.wind, current.all.do_keypad); end if; when Character'Pos ('S') mod 16#20# => -- Ctrl('S') if current /= null then current.all.do_scroll := not current.all.do_scroll; Allow_Scrolling (current.all.wind, current.all.do_scroll); end if; when Character'Pos ('W') mod 16#20# => -- Ctrl('W') if current /= current.all.next then Create (f, Name => dumpfile); -- TODO error checking if not Is_Open (f) then raise Curses_Exception; end if; Put_Window (current.all.wind, f); Close (f); current := delete_framed (current, True); end if; when Character'Pos ('R') mod 16#20# => -- Ctrl('R') declare neww : FrameA := new Frame'(null, null, False, False, Null_Window); begin Open (f, Mode => In_File, Name => dumpfile); neww := new Frame'(null, null, False, False, Null_Window); neww.all.next := current.all.next; neww.all.last := current; neww.all.last.all.next := neww; neww.all.next.all.last := neww; neww.all.wind := Get_Window (f); Close (f); Refresh (neww.all.wind); end; when Character'Pos ('X') mod 16#20# => -- Ctrl('X') if current /= null then declare tmp, ul, lr : pair; mx : Column_Position; my : Line_Position; tmpbool : Boolean; begin Move_Cursor (Line => 0, Column => 0); Clear_To_End_Of_Line; Add (Str => "Use arrows to move cursor, anything else " & "to mark new corner"); Refresh; Get_Window_Position (current.all.wind, ul.y, ul.x); selectcell (ul.y, ul.x, Lines - Botlines - 2, Columns - 2, tmp, tmpbool); if not tmpbool then -- the C version had a goto. I refuse gotos. Beep; else Get_Size (current.all.wind, lr.y, lr.x); lr.y := lr.y + ul.y - 1; lr.x := lr.x + ul.x - 1; Outerbox (ul, lr, False); Refresh_Without_Update; Get_Size (current.all.wind, my, mx); if my > tmp.y - ul.y then Get_Cursor_Position (current.all.wind, lr.y, lr.x); Move_Cursor (current.all.wind, tmp.y - ul.y + 1, 0); Clear_To_End_Of_Screen (current.all.wind); Move_Cursor (current.all.wind, lr.y, lr.x); end if; if mx > tmp.x - ul.x then for i in 0 .. my - 1 loop Move_Cursor (current.all.wind, i, tmp.x - ul.x + 1); Clear_To_End_Of_Line (current.all.wind); end loop; end if; Refresh_Without_Update (current.all.wind); lr := tmp; -- The C version passes invalid args to resize -- which returns an ERR. For Ada we avoid the exception. if lr.y /= ul.y and lr.x /= ul.x then Resize (current.all.wind, lr.y - ul.y + 0, lr.x - ul.x + 0); end if; Get_Window_Position (current.all.wind, ul.y, ul.x); Get_Size (current.all.wind, lr.y, lr.x); lr.y := lr.y + ul.y - 1; lr.x := lr.x + ul.x - 1; Outerbox (ul, lr, True); Refresh_Without_Update; Refresh_Without_Update (current.all.wind); Move_Cursor (Line => 0, Column => 0); Clear_To_End_Of_Line; Update_Screen; end if; end; end if; when Key_F10 => declare tmp : pair; tmpbool : Boolean; begin -- undocumented --- use this to test area clears selectcell (0, 0, Lines - 1, Columns - 1, tmp, tmpbool); Clear_To_End_Of_Screen; Refresh; end; when Key_Cursor_Up => newwin_move (current.all.wind, -1, 0); when Key_Cursor_Down => newwin_move (current.all.wind, 1, 0); when Key_Cursor_Left => newwin_move (current.all.wind, 0, -1); when Key_Cursor_Right => newwin_move (current.all.wind, 0, 1); when Key_Backspace | Key_Delete_Char => declare y : Line_Position; x : Column_Position; tmp : Line_Position; begin Get_Cursor_Position (current.all.wind, y, x); -- x := x - 1; -- I got tricked by the -1 = Max_Natural - 1 result -- y := y - 1; if not (x = 0 and y = 0) then if x = 0 then y := y - 1; Get_Size (current.all.wind, tmp, x); end if; x := x - 1; Delete_Character (current.all.wind, y, x); end if; end; when others => -- TODO c = '\r' ? if current /= null then declare begin Add (current.all.wind, Ch => Code_To_Char (c)); exception when Curses_Exception => null; -- this happens if we are at the -- lower right of a window and add a character. end; else Beep; end if; end case; newwin_report (current.all.wind); if current /= null then usescr := current.all.wind; else usescr := Standard_Window; end if; Refresh (usescr); c := Getchar (usescr); exit when c = Quit or (c = Escape and HaveKeyPad (usescr)); -- TODO when does c = ERR happen? end loop; -- TODO while current /= null loop -- current := delete_framed(current, False); -- end loop; Allow_Scrolling (Mode => True); End_Mouse (Mask2); Set_Raw_Mode (SwitchOn => True); Erase; End_Windows; end ncurses2.acs_and_scroll; AdaCurses-20170708/samples/README0000644000175100001440000000473510422526414014712 0ustar tomusers------------------------------------------------------------------------------- -- Copyright (c) 1998,2006 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. -- ------------------------------------------------------------------------------- -- $Id: README,v 1.2 2006/04/22 22:24:12 tom Exp $ ------------------------------------------------------------------------------- The intention of the demo at this point in time is not to demonstrate all the features of (n)curses and its subsystems, but to give some sample sources how to use the binding at all. Ideally in the future we can combine both goals. AdaCurses-20170708/samples/sample-form_demo-aux.adb0000644000175100001440000002464511315445062020526 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Form_Demo.Aux -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2004,2009 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, 1996 -- Version Control -- $Revision: 1.17 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Sample.Manifest; use Sample.Manifest; with Sample.Helpers; use Sample.Helpers; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Explanation; use Sample.Explanation; package body Sample.Form_Demo.Aux is procedure Geometry (F : Form; L : out Line_Count; -- Lines used for menu C : out Column_Count; -- Columns used for menu Y : out Line_Position; -- Proposed Line for menu X : out Column_Position) -- Proposed Column for menu is begin Scale (F, L, C); L := L + 2; -- count for frame at top and bottom C := C + 2; -- " -- Calculate horizontal coordinate at the screen center X := (Columns - C) / 2; Y := 1; -- start always in line 1 end Geometry; function Create (F : Form; Title : String; Lin : Line_Position; Col : Column_Position) return Panel is W, S : Window; L : Line_Count; C : Column_Count; Y : Line_Position; X : Column_Position; Pan : Panel; begin Geometry (F, L, C, Y, X); W := New_Window (L, C, Lin, Col); Set_Meta_Mode (W); Set_KeyPad_Mode (W); if Has_Colors then Set_Background (Win => W, Ch => (Ch => ' ', Color => Default_Colors, Attr => Normal_Video)); Set_Character_Attributes (Win => W, Color => Default_Colors, Attr => Normal_Video); Erase (W); end if; S := Derived_Window (W, L - 2, C - 2, 1, 1); Set_Meta_Mode (S); Set_KeyPad_Mode (S); Box (W); Set_Window (F, W); Set_Sub_Window (F, S); if Title'Length > 0 then Window_Title (W, Title); end if; Pan := New_Panel (W); Post (F); return Pan; end Create; procedure Destroy (F : Form; P : in out Panel) is W, S : Window; begin W := Get_Window (F); S := Get_Sub_Window (F); Post (F, False); Erase (W); Delete (P); Set_Window (F, Null_Window); Set_Sub_Window (F, Null_Window); Delete (S); Delete (W); Update_Panels; end Destroy; function Get_Request (F : Form; P : Panel; Handle_CRLF : Boolean := True) return Key_Code is W : constant Window := Get_Window (F); K : Real_Key_Code; Ch : Character; begin Top (P); loop K := Get_Key (W); if K in Special_Key_Code'Range then case K is when HELP_CODE => Explain_Context; when EXPLAIN_CODE => Explain ("FORMKEYS"); when Key_Home => return F_First_Field; when Key_End => return F_Last_Field; when QUIT_CODE => return QUIT; when Key_Cursor_Down => return F_Down_Char; when Key_Cursor_Up => return F_Up_Char; when Key_Cursor_Left => return F_Previous_Char; when Key_Cursor_Right => return F_Next_Char; when Key_Next_Page => return F_Next_Page; when Key_Previous_Page => return F_Previous_Page; when Key_Backspace => return F_Delete_Previous; when Key_Clear_Screen => return F_Clear_Field; when Key_Clear_End_Of_Line => return F_Clear_EOF; when others => return K; end case; elsif K in Normal_Key_Code'Range then Ch := Character'Val (K); case Ch is when CAN => return QUIT; -- CTRL-X when ACK => return F_Next_Field; -- CTRL-F when STX => return F_Previous_Field; -- CTRL-B when FF => return F_Left_Field; -- CTRL-L when DC2 => return F_Right_Field; -- CTRL-R when NAK => return F_Up_Field; -- CTRL-U when EOT => return F_Down_Field; -- CTRL-D when ETB => return F_Next_Word; -- CTRL-W when DC4 => return F_Previous_Word; -- CTRL-T when SOH => return F_Begin_Field; -- CTRL-A when ENQ => return F_End_Field; -- CTRL-E when HT => return F_Insert_Char; -- CTRL-I when SI => return F_Insert_Line; -- CTRL-O when SYN => return F_Delete_Char; -- CTRL-V when BS => return F_Delete_Previous; -- CTRL-H when EM => return F_Delete_Line; -- CTRL-Y when BEL => return F_Delete_Word; -- CTRL-G when VT => return F_Clear_EOF; -- CTRL-K when SO => return F_Next_Choice; -- CTRL-N when DLE => return F_Previous_Choice; -- CTRL-P when CR | LF => if Handle_CRLF then return F_New_Line; else return K; end if; when others => return K; end case; else return K; end if; end loop; end Get_Request; function Make (Top : Line_Position; Left : Column_Position; Text : String) return Field is Fld : Field; C : constant Column_Count := Column_Count (Text'Length); begin Fld := New_Field (1, C, Top, Left); Set_Buffer (Fld, 0, Text); Switch_Options (Fld, (Active => True, others => False), False); if Has_Colors then Set_Background (Fld => Fld, Color => Default_Colors); end if; return Fld; end Make; function Make (Height : Line_Count := 1; Width : Column_Count; Top : Line_Position; Left : Column_Position; Off_Screen : Natural := 0) return Field is Fld : constant Field := New_Field (Height, Width, Top, Left, Off_Screen); begin if Has_Colors then Set_Foreground (Fld => Fld, Color => Form_Fore_Color); Set_Background (Fld => Fld, Color => Form_Back_Color); else Set_Background (Fld, (Reverse_Video => True, others => False)); end if; return Fld; end Make; function Default_Driver (F : Form; K : Key_Code; P : Panel) return Boolean is begin if P = Null_Panel then raise Panel_Exception; end if; if K in User_Key_Code'Range and then K = QUIT then if Driver (F, F_Validate_Field) = Form_Ok then return True; end if; end if; return False; end Default_Driver; function Count_Active (F : Form) return Natural is N : Natural := 0; O : Field_Option_Set; H : constant Natural := Field_Count (F); begin if H > 0 then for I in 1 .. H loop Get_Options (Fields (F, I), O); if O.Active then N := N + 1; end if; end loop; end if; return N; end Count_Active; end Sample.Form_Demo.Aux; AdaCurses-20170708/samples/ncurses2-acs_and_scroll.ads0000644000175100001440000000567707212274072021244 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.acs_and_scroll; AdaCurses-20170708/samples/ncurses2-slk_test.adb0000644000175100001440000001720411541115574020073 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2009,2011 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.9 $ -- $Date: 2011/03/19 12:03:08 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Ada.Strings.Unbounded; with Interfaces.C; with Terminal_Interface.Curses.Aux; procedure ncurses2.slk_test is procedure myGet (Win : Window := Standard_Window; Str : out Ada.Strings.Unbounded.Unbounded_String; Len : Integer := -1); procedure myGet (Win : Window := Standard_Window; Str : out Ada.Strings.Unbounded.Unbounded_String; Len : Integer := -1) is use Ada.Strings.Unbounded; use Interfaces.C; use Terminal_Interface.Curses.Aux; function Wgetnstr (Win : Window; Str : char_array; Len : int) return int; pragma Import (C, Wgetnstr, "wgetnstr"); -- FIXME: how to construct "(Len > 0) ? Len : 80"? Ask : constant Interfaces.C.size_t := Interfaces.C.size_t'Val (Len + 80); Txt : char_array (0 .. Ask); begin Txt (0) := Interfaces.C.char'First; if Wgetnstr (Win, Txt, Txt'Length) = Curses_Err then raise Curses_Exception; end if; Str := To_Unbounded_String (To_Ada (Txt, True)); end myGet; use Int_IO; use Ada.Strings.Unbounded; c : Key_Code; buf : Unbounded_String; c2 : Character; fmt : Label_Justification := Centered; tmp : Integer; begin c := CTRL ('l'); loop Move_Cursor (Line => 0, Column => 0); c2 := Code_To_Char (c); case c2 is when Character'Val (Character'Pos ('l') mod 16#20#) => -- CTRL('l') Erase; Switch_Character_Attribute (Attr => (Bold_Character => True, others => False)); Add (Line => 0, Column => 20, Str => "Soft Key Exerciser"); Switch_Character_Attribute (On => False, Attr => (Bold_Character => True, others => False)); Move_Cursor (Line => 2, Column => 0); P ("Available commands are:"); P (""); P ("^L -- refresh screen"); P ("a -- activate or restore soft keys"); P ("d -- disable soft keys"); P ("c -- set centered format for labels"); P ("l -- set left-justified format for labels"); P ("r -- set right-justified format for labels"); P ("[12345678] -- set label; labels are numbered 1 through 8"); P ("e -- erase stdscr (should not erase labels)"); P ("s -- test scrolling of shortened screen"); P ("x, q -- return to main menu"); P (""); P ("Note: if activating the soft keys causes your terminal to"); P ("scroll up one line, your terminal auto-scrolls when anything"); P ("is written to the last screen position. The ncurses code"); P ("does not yet handle this gracefully."); Refresh; Restore_Soft_Label_Keys; when 'a' => Restore_Soft_Label_Keys; when 'e' => Clear; when 's' => Add (Line => 20, Column => 0, Str => "Press Q to stop the scrolling-test: "); loop c := Getchar; c2 := Code_To_Char (c); exit when c2 = 'Q'; -- c = ERR? -- TODO when c is not a character (arrow key) -- the behavior is different from the C version. Add (Ch => c2); end loop; when 'd' => Clear_Soft_Label_Keys; when 'l' => fmt := Left; when 'c' => fmt := Centered; when 'r' => fmt := Right; when '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' => Add (Line => 20, Column => 0, Str => "Please enter the label value: "); Set_Echo_Mode (SwitchOn => True); myGet (Str => buf); Set_Echo_Mode (SwitchOn => False); tmp := ctoi (c2); Set_Soft_Label_Key (Label_Number (tmp), To_String (buf), fmt); Refresh_Soft_Label_Keys; Move_Cursor (Line => 20, Column => 0); Clear_To_End_Of_Line; when 'x' | 'q' => exit; -- the C version needed a goto, ha ha -- breaks exit the case not the loop because fall-through -- happens in C! when others => Beep; end case; c := Getchar; -- TODO exit when c = EOF end loop; Erase; End_Windows; end ncurses2.slk_test; AdaCurses-20170708/samples/ncurses2-test_sgr_attributes.ads0000644000175100001440000000570407212274052022363 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.test_sgr_attributes; AdaCurses-20170708/samples/sample-form_demo-handler.ads0000644000175100001440000000723211315445551021363 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Form_Demo.Handler -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; generic with function My_Driver (Frm : Form; K : Key_Code; Pan : Panel) return Boolean; package Sample.Form_Demo.Handler is procedure Drive_Me (F : Form; Lin : Line_Position; Col : Column_Position; Title : String := ""); -- Position the menu at the given point and drive it. procedure Drive_Me (F : Form; Title : String := ""); -- Center menu and drive it. end Sample.Form_Demo.Handler; AdaCurses-20170708/samples/ncurses2-getch_test.adb0000644000175100001440000002367112405113232020366 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2009,2014 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.9 $ -- $Date: 2014/09/13 19:10:18 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- Character input test -- test the keypad feature with ncurses2.util; use ncurses2.util; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; with Ada.Characters.Handling; with Ada.Strings.Bounded; with ncurses2.genericPuts; procedure ncurses2.getch_test is use Int_IO; function mouse_decode (ep : Mouse_Event) return String; function mouse_decode (ep : Mouse_Event) return String is Y : Line_Position; X : Column_Position; Button : Mouse_Button; State : Button_State; package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (200); use BS; buf : Bounded_String := To_Bounded_String (""); begin -- Note that these bindings do not allow -- two button states, -- The C version can print {click-1, click-3} for example. -- They also don't have the 'id' or z coordinate. Get_Event (ep, Y, X, Button, State); -- TODO Append (buf, "id "); from C version Append (buf, "at ("); Append (buf, Column_Position'Image (X)); Append (buf, ", "); Append (buf, Line_Position'Image (Y)); Append (buf, ") state"); Append (buf, Mouse_Button'Image (Button)); Append (buf, " = "); Append (buf, Button_State'Image (State)); return To_String (buf); end mouse_decode; buf : String (1 .. 1024); -- TODO was BUFSIZE n : Integer; c : Key_Code; blockflag : Timeout_Mode := Blocking; firsttime : Boolean := True; tmp2 : Event_Mask; tmp6 : String (1 .. 6); tmp20 : String (1 .. 20); x : Column_Position; y : Line_Position; tmpx : Integer; incount : Integer := 0; begin Refresh; tmp2 := Start_Mouse (All_Events); Add (Str => "Delay in 10ths of a second ( for blocking input)? "); Set_Echo_Mode (SwitchOn => True); Get (Str => buf); Set_Echo_Mode (SwitchOn => False); Set_NL_Mode (SwitchOn => False); if Ada.Characters.Handling.Is_Digit (buf (1)) then Get (Item => n, From => buf, Last => tmpx); Set_Timeout_Mode (Mode => Delayed, Amount => n * 100); blockflag := Delayed; end if; c := Character'Pos ('?'); Set_Raw_Mode (SwitchOn => True); loop if not firsttime then Add (Str => "Key pressed: "); Put (tmp6, Integer (c), 8); Add (Str => tmp6); Add (Ch => ' '); if c = Key_Mouse then declare event : Mouse_Event; begin event := Get_Mouse; Add (Str => "KEY_MOUSE, "); Add (Str => mouse_decode (event)); Add (Ch => newl); end; elsif c >= Key_Min then Key_Name (c, tmp20); Add (Str => tmp20); -- I used tmp and got bitten by the length problem:-> Add (Ch => newl); elsif c > 16#80# then -- TODO fix, use constant if possible declare c2 : constant Character := Character'Val (c mod 16#80#); begin if Ada.Characters.Handling.Is_Graphic (c2) then Add (Str => "M-"); Add (Ch => c2); else Add (Str => "M-"); Add (Str => Un_Control ((Ch => c2, Color => Color_Pair'First, Attr => Normal_Video))); end if; Add (Str => " (high-half character)"); Add (Ch => newl); end; else declare c2 : constant Character := Character'Val (c mod 16#80#); begin if Ada.Characters.Handling.Is_Graphic (c2) then Add (Ch => c2); Add (Str => " (ASCII printable character)"); Add (Ch => newl); else Add (Str => Un_Control ((Ch => c2, Color => Color_Pair'First, Attr => Normal_Video))); Add (Str => " (ASCII control character)"); Add (Ch => newl); end if; end; end if; -- TODO I am not sure why this was in the C version -- the delay statement scroll anyway. Get_Cursor_Position (Line => y, Column => x); if y >= Lines - 1 then Move_Cursor (Line => 0, Column => 0); end if; Clear_To_End_Of_Line; end if; firsttime := False; if c = Character'Pos ('g') then declare package p is new ncurses2.genericPuts (1024); use p; use p.BS; timedout : Boolean := False; boundedbuf : Bounded_String; begin Add (Str => "getstr test: "); Set_Echo_Mode (SwitchOn => True); -- Note that if delay mode is set -- Get can raise an exception. -- The C version would print the string it had so far -- also TODO get longer length string, like the C version declare begin myGet (Str => boundedbuf); exception when Curses_Exception => Add (Str => "Timed out."); Add (Ch => newl); timedout := True; end; -- note that the Ada Get will stop reading at 1024. if not timedout then Set_Echo_Mode (SwitchOn => False); Add (Str => " I saw '"); myAdd (Str => boundedbuf); Add (Str => "'."); Add (Ch => newl); end if; end; elsif c = Character'Pos ('s') then ShellOut (True); elsif c = Character'Pos ('x') or c = Character'Pos ('q') or (c = Key_None and blockflag = Blocking) then exit; elsif c = Character'Pos ('?') then Add (Str => "Type any key to see its keypad value. Also:"); Add (Ch => newl); Add (Str => "g -- triggers a getstr test"); Add (Ch => newl); Add (Str => "s -- shell out"); Add (Ch => newl); Add (Str => "q -- quit"); Add (Ch => newl); Add (Str => "? -- repeats this help message"); Add (Ch => newl); end if; loop c := Getchar; exit when c /= Key_None; if blockflag /= Blocking then Put (tmp6, incount); -- argh string length! Add (Str => tmp6); Add (Str => ": input timed out"); Add (Ch => newl); else Put (tmp6, incount); Add (Str => tmp6); Add (Str => ": input error"); Add (Ch => newl); exit; end if; incount := incount + 1; end loop; end loop; End_Mouse (tmp2); Set_Timeout_Mode (Mode => Blocking, Amount => 0); -- amount is ignored Set_Raw_Mode (SwitchOn => False); Set_NL_Mode (SwitchOn => True); Erase; End_Windows; end ncurses2.getch_test; AdaCurses-20170708/samples/ncurses2-color_test.ads0000644000175100001440000000567307212274075020452 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.color_test; AdaCurses-20170708/samples/sample-curses_demo.adb0000644000175100001440000001417011542237320020262 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Curses_Demo -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2004,2011 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, 1996 -- Version Control -- $Revision: 1.17 $ -- $Date: 2011/03/23 00:29:04 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Panels.User_Data; with Sample.Manifest; use Sample.Manifest; with Sample.Helpers; use Sample.Helpers; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Explanation; use Sample.Explanation; with Sample.Menu_Demo.Handler; with Sample.Curses_Demo.Mouse; with Sample.Curses_Demo.Attributes; package body Sample.Curses_Demo is type User_Data is new Integer; type User_Data_Access is access all User_Data; package PUD is new Panels.User_Data (User_Data, User_Data_Access); -- We use above instantiation of the generic User_Data package to -- demonstrate and test the use of the user data mechanism. procedure Demo is function My_Driver (M : Menu; K : Key_Code; Pan : Panel) return Boolean; package Mh is new Sample.Menu_Demo.Handler (My_Driver); Itm : Item_Array_Access := new Item_Array' (New_Item ("Attributes Demo"), New_Item ("Mouse Demo"), Null_Item); M : Menu := New_Menu (Itm); U1 : constant User_Data_Access := new User_Data'(4711); U2 : User_Data_Access; function My_Driver (M : Menu; K : Key_Code; Pan : Panel) return Boolean is Idx : constant Positive := Get_Index (Current (M)); Result : Boolean := False; begin PUD.Set_User_Data (Pan, U1); -- set some user data, just for fun if K in User_Key_Code'Range then if K = QUIT then Result := True; elsif K = SELECT_ITEM then if Idx in Itm'Range then Hide (Pan); Update_Panels; end if; case Idx is when 1 => Sample.Curses_Demo.Attributes.Demo; when 2 => Sample.Curses_Demo.Mouse.Demo; when others => Not_Implemented; end case; if Idx in Itm'Range then Top (Pan); Show (Pan); Update_Panels; Update_Screen; end if; end if; end if; PUD.Get_User_Data (Pan, U2); -- get the user data pragma Assert (U1.all = U2.all and then U1 = U2); return Result; end My_Driver; begin if (1 + Item_Count (M)) /= Itm'Length then raise Constraint_Error; end if; if not Has_Mouse then declare O : Item_Option_Set; begin Get_Options (Itm.all (2), O); O.Selectable := False; Set_Options (Itm.all (2), O); end; end if; Push_Environment ("CURSES00"); Notepad ("CURSES-PAD00"); Default_Labels; Refresh_Soft_Label_Keys_Without_Update; Mh.Drive_Me (M, " Demo "); Pop_Environment; Delete (M); Free (Itm, True); end Demo; end Sample.Curses_Demo; AdaCurses-20170708/samples/ncurses2-menu_test.adb0000644000175100001440000001504711542240500020236 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2006,2011 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.8 $ -- $Date: 2011/03/23 00:39:28 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; procedure ncurses2.menu_test is function menu_virtualize (c : Key_Code) return Key_Code; procedure xAdd (l : Line_Position; c : Column_Position; s : String); function menu_virtualize (c : Key_Code) return Key_Code is begin case c is when Character'Pos (newl) | Key_Exit => return Menu_Request_Code'Last + 1; -- MAX_COMMAND? TODO when Character'Pos ('u') => return M_ScrollUp_Line; when Character'Pos ('d') => return M_ScrollDown_Line; when Character'Pos ('b') | Key_Next_Page => return M_ScrollUp_Page; when Character'Pos ('f') | Key_Previous_Page => return M_ScrollDown_Page; when Character'Pos ('n') | Key_Cursor_Down => return M_Next_Item; when Character'Pos ('p') | Key_Cursor_Up => return M_Previous_Item; when Character'Pos (' ') => return M_Toggle_Item; when Key_Mouse => return c; when others => Beep; return c; end case; end menu_virtualize; MENU_Y : constant Line_Count := 8; MENU_X : constant Column_Count := 8; type String_Access is access String; animals : constant array (Positive range <>) of String_Access := (new String'("Lions"), new String'("Tigers"), new String'("Bears"), new String'("(Oh my!)"), new String'("Newts"), new String'("Platypi"), new String'("Lemurs")); items_a : constant Item_Array_Access := new Item_Array (1 .. animals'Last + 1); tmp : Event_Mask; procedure xAdd (l : Line_Position; c : Column_Position; s : String) is begin Add (Line => l, Column => c, Str => s); end xAdd; mrows : Line_Count; mcols : Column_Count; menuwin : Window; m : Menu; c1 : Key_Code; c : Driver_Result; r : Key_Code; begin tmp := Start_Mouse; xAdd (0, 0, "This is the menu test:"); xAdd (2, 0, " Use up and down arrow to move the select bar."); xAdd (3, 0, " 'n' and 'p' act like arrows."); xAdd (4, 0, " 'b' and 'f' scroll up/down (page), 'u' and 'd' (line)."); xAdd (5, 0, " Press return to exit."); Refresh; for i in animals'Range loop items_a.all (i) := New_Item (animals (i).all); end loop; items_a.all (animals'Last + 1) := Null_Item; m := New_Menu (items_a); Set_Format (m, Line_Position (animals'Last + 1) / 2, 1); Scale (m, mrows, mcols); menuwin := Create (mrows + 2, mcols + 2, MENU_Y, MENU_X); Set_Window (m, menuwin); Set_KeyPad_Mode (menuwin, True); Box (menuwin); -- 0,0? Set_Sub_Window (m, Derived_Window (menuwin, mrows, mcols, 1, 1)); Post (m); loop c1 := Getchar (menuwin); r := menu_virtualize (c1); c := Driver (m, r); exit when c = Unknown_Request; -- E_UNKNOWN_COMMAND? if c = Request_Denied then Beep; end if; -- continue ? end loop; Move_Cursor (Line => Lines - 2, Column => 0); Add (Str => "You chose: "); Add (Str => Name (Current (m))); Add (Ch => newl); Pause; -- the C version didn't use Pause, it spelled it out Post (m, False); -- unpost, not clear :-( declare begin Delete (menuwin); exception when Curses_Exception => null; end; -- menuwin has children so will raise the exception. Delete (m); End_Mouse (tmp); end ncurses2.menu_test; AdaCurses-20170708/samples/ncurses2-getopt.adb0000644000175100001440000001554311541116417017546 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2008,2011 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.8 $ -- $Date: 2011/03/19 12:09:51 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- A simplified version of the GNU getopt function -- copyright Free Software Foundtion with Ada.Strings.Fixed; with Ada.Strings.Bounded; with Ada.Text_IO; use Ada.Text_IO; package body ncurses2.getopt is nextchar : Natural := 0; -- Ncurses doesn't use the non option elements so we are spared -- the job of computing those. -- also the user is not allowed to modify argv or argc -- Doing so is Erroneous execution. -- long options are not handled. procedure Qgetopt (retval : out Integer; argc : Integer; argv : stringfunc; -- argv will be the Argument function. optstring : String; optind : in out Integer; -- ignored for ncurses, must be initialized to 1 by -- the caller Optarg : out stringa -- a garbage collector would be useful here. ) is package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (200); use BS; optargx : Bounded_String; begin if argc < optind then retval := -1; return; end if; optargx := To_Bounded_String (""); if nextchar = 0 then if argv (optind) = "--" then -- the rest are non-options, we ignore them retval := -1; return; end if; if argv (optind)(1) /= '-' or argv (optind)'Length = 1 then optind := optind + 1; Optarg := new String'(argv (optind)); retval := 1; return; end if; nextchar := 2; -- skip the one hyphen. end if; -- Look at and handle the next short option-character. declare c : Character := argv (optind) (nextchar); temp : constant Natural := Ada.Strings.Fixed.Index (optstring, String'(1 => c)); begin if temp = 0 or c = ':' then Put_Line (Standard_Error, argv (optind) & ": invalid option -- " & c); c := '?'; return; end if; if optstring (temp + 1) = ':' then if optstring (temp + 2) = ':' then -- This is an option that accepts an argument optionally. if nextchar /= argv (optind)'Length then optargx := To_Bounded_String (argv (optind) (nextchar .. argv (optind)'Length)); else Optarg := null; end if; else -- This is an option that requires an argument. if nextchar /= argv (optind)'Length then optargx := To_Bounded_String (argv (optind) (nextchar .. argv (optind)'Length)); optind := optind + 1; elsif optind = argc then Put_Line (Standard_Error, argv (optind) & ": option requires an argument -- " & c); if optstring (optstring'First) = ':' then c := ':'; else c := '?'; end if; else -- increment it again when taking next ARGV-elt as argument. optind := optind + 1; optargx := To_Bounded_String (argv (optind)); optind := optind + 1; end if; end if; nextchar := 0; else -- no argument for the option if nextchar = argv (optind)'Length then optind := optind + 1; nextchar := 0; else nextchar := nextchar + 1; end if; end if; retval := Character'Pos (c); Optarg := new String'(To_String (optargx)); return; end; end Qgetopt; end ncurses2.getopt; AdaCurses-20170708/samples/sample.adb0000644000175100001440000002042711542241134015754 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2008,2011 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, 1996 -- Version Control -- $Revision: 1.18 $ -- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; with Terminal_Interface.Curses.Menus.Menu_User_Data; with Terminal_Interface.Curses.Menus.Item_User_Data; with Sample.Manifest; use Sample.Manifest; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Header_Handler; use Sample.Header_Handler; with Sample.Explanation; use Sample.Explanation; with Sample.Menu_Demo.Handler; with Sample.Curses_Demo; with Sample.Form_Demo; with Sample.Menu_Demo; with Sample.Text_IO_Demo; with GNAT.OS_Lib; package body Sample is type User_Data is record Data : Integer; end record; type User_Access is access User_Data; package Ud is new Terminal_Interface.Curses.Menus.Menu_User_Data (User_Data, User_Access); package Id is new Terminal_Interface.Curses.Menus.Item_User_Data (User_Data, User_Access); procedure Whow is procedure Main_Menu; procedure Main_Menu is function My_Driver (M : Menu; K : Key_Code; Pan : Panel) return Boolean; package Mh is new Sample.Menu_Demo.Handler (My_Driver); I : Item_Array_Access := new Item_Array' (New_Item ("Curses Core Demo"), New_Item ("Menu Demo"), New_Item ("Form Demo"), New_Item ("Text IO Demo"), Null_Item); M : Menu := New_Menu (I); D1, D2 : User_Access; I1, I2 : User_Access; function My_Driver (M : Menu; K : Key_Code; Pan : Panel) return Boolean is Idx : constant Positive := Get_Index (Current (M)); begin if K in User_Key_Code'Range then if K = QUIT then return True; elsif K = SELECT_ITEM then if Idx <= 4 then Hide (Pan); Update_Panels; end if; case Idx is when 1 => Sample.Curses_Demo.Demo; when 2 => Sample.Menu_Demo.Demo; when 3 => Sample.Form_Demo.Demo; when 4 => Sample.Text_IO_Demo.Demo; when others => null; end case; if Idx <= 4 then Top (Pan); Show (Pan); Update_Panels; Update_Screen; end if; end if; end if; return False; end My_Driver; begin if (1 + Item_Count (M)) /= I'Length then raise Constraint_Error; end if; D1 := new User_Data'(Data => 4711); Ud.Set_User_Data (M, D1); I1 := new User_Data'(Data => 1174); Id.Set_User_Data (I.all (1), I1); Set_Spacing (Men => M, Row => 2); Default_Labels; Notepad ("MAINPAD"); Mh.Drive_Me (M, " Demo "); Ud.Get_User_Data (M, D2); pragma Assert (D1 = D2); pragma Assert (D1.Data = D2.Data); Id.Get_User_Data (I.all (1), I2); pragma Assert (I1 = I2); pragma Assert (I1.Data = I2.Data); Delete (M); Free (I, True); end Main_Menu; begin Initialize (PC_Style_With_Index); Init_Header_Handler; Init_Screen; if Has_Colors then Start_Color; Init_Pair (Pair => Default_Colors, Fore => Black, Back => White); Init_Pair (Pair => Menu_Back_Color, Fore => Black, Back => Cyan); Init_Pair (Pair => Menu_Fore_Color, Fore => Red, Back => Cyan); Init_Pair (Pair => Menu_Grey_Color, Fore => White, Back => Cyan); Init_Pair (Pair => Notepad_Color, Fore => Black, Back => Yellow); Init_Pair (Pair => Help_Color, Fore => Blue, Back => Cyan); Init_Pair (Pair => Form_Back_Color, Fore => Black, Back => Cyan); Init_Pair (Pair => Form_Fore_Color, Fore => Red, Back => Cyan); Init_Pair (Pair => Header_Color, Fore => Black, Back => Green); Set_Background (Ch => (Color => Default_Colors, Attr => Normal_Video, Ch => ' ')); Set_Character_Attributes (Attr => Normal_Video, Color => Default_Colors); Erase; Set_Soft_Label_Key_Attributes (Color => Header_Color); -- This propagates the attributes to the label window Refresh_Soft_Label_Keys; end if; Init_Keyboard_Handler; Set_Echo_Mode (False); Set_Raw_Mode; Set_Meta_Mode; Set_KeyPad_Mode; -- Initialize the Function Key Environment -- We have some fixed key throughout this sample Main_Menu; End_Windows; Curses_Free_All; exception when Event : others => Terminal_Interface.Curses.End_Windows; Text_IO.Put ("Exception: "); Text_IO.Put (Exception_Name (Event)); Text_IO.New_Line; GNAT.OS_Lib.OS_Exit (1); end Whow; end Sample; AdaCurses-20170708/samples/ncurses2-flushinp_test.ads0000644000175100001440000000601007212274112021136 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; procedure ncurses2.flushinp_test (win : Terminal_Interface.Curses.Window); AdaCurses-20170708/samples/ncurses2-demo_panels.ads0000644000175100001440000000572207212274111020545 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.demo_panels (nap_mseci : Integer); AdaCurses-20170708/samples/sample-my_field_type.ads0000644000175100001440000000704610447516776020652 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.My_Field_Type -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2006 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, 1996 -- Version Control -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; with Terminal_Interface.Curses.Forms.Field_Types.User; use Terminal_Interface.Curses.Forms.Field_Types.User; -- This is a very simple user defined field type. It accepts only a -- defined character as input into the field. -- package Sample.My_Field_Type is type My_Data is new User_Defined_Field_Type with record Ch : Character; end record; function Field_Check (Fld : Field; Typ : My_Data) return Boolean; function Character_Check (Ch : Character; Typ : My_Data) return Boolean; end Sample.My_Field_Type; AdaCurses-20170708/samples/sample-explanation.ads0000644000175100001440000000672511315445551020331 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Explanation -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control -- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- Poor mans help system. This scans a sequential file for key lines and -- then reads the lines up to the next key. Those lines are presented in -- a window as help or explanation. -- package Sample.Explanation is procedure Explain (Key : String); -- Retrieve the text associated with this key and display it. procedure Explain_Context; -- Explain the current context. procedure Notepad (Key : String); -- Put a note on the screen and maintain it with the context Explanation_Not_Found : exception; Explanation_Error : exception; end Sample.Explanation; AdaCurses-20170708/samples/Makefile.in0000644000175100001440000001122312560514435016072 0ustar tomusers############################################################################## # Copyright (c) 1998-2012,2015 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, 1996 # # $Id: Makefile.in,v 1.49 2015/08/05 23:15:41 tom Exp $ # .SUFFIXES: SHELL = @SHELL@ VPATH = @srcdir@ THIS = Makefile x = @EXEEXT@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ datarootdir = @datarootdir@ datadir = @datadir@ libdir = @libdir@ includedir = @includedir@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ AWK = @AWK@ LN_S = @LN_S@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @ACPPFLAGS@ \ -DHAVE_CONFIG_H -I$(srcdir) CCFLAGS = $(CPPFLAGS) $(CFLAGS) CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) REL_VERSION = @cf_cv_rel_version@ ABI_VERSION = @cf_cv_abi_version@ LOCAL_LIBDIR = @top_builddir@/lib LINK = $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ RANLIB = @RANLIB@ ################################################################################ BINDIR = $(DESTDIR)$(bindir) DATADIR = $(DESTDIR)$(datadir) LIBDIR = $(DESTDIR)$(libdir) MY_DATADIR = $(DATADIR)/AdaCurses ################################################################################ ada_srcdir=../src LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) ADA = @cf_ada_compiler@ ADAFLAGS = @ADAFLAGS@ -I$(srcdir) ADAMAKE = @cf_ada_make@ ADAMAKEFLAGS = -a -A$(srcdir) -A$(ada_srcdir) -A$(srcdir)/$(ada_srcdir) ALIB = @cf_ada_package@ ABASE = $(ALIB)-curses CARGS =-cargs $(ADAFLAGS) LARGS =-largs -L../lib -lAdaCurses @TEST_ARG2@ $(LD_FLAGS) @TEST_LIBS2@ PROGS = tour$x ncurses$x @USE_GNAT_SIGINT@ rain$x all :: $(PROGS) @echo made $@ sources : @echo made $@ libs \ install \ install.libs :: @echo made $@ uninstall \ uninstall.libs :: @echo made $@ install.examples :: $(BINDIR) $(PROGS) $(INSTALL) $(PROGS) $(BINDIR) install.examples :: $(MY_DATADIR) $(INSTALL_DATA) explain.txt $(MY_DATADIR) uninstall.examples :: -cd $(BINDIR) && rm -f $(PROGS) -rmdir $(BINDIR) -rm -f $(MY_DATADIR)/explain.txt -rmdir $(MY_DATADIR) $(BINDIR) \ $(MY_DATADIR) : mkdir -p $@ ncurses$x : $(ADAMAKE) $(ADAMAKEFLAGS) ncurses $(CARGS) $(LARGS) tour$x : $(ADAMAKE) $(ADAMAKEFLAGS) tour $(CARGS) $(LARGS) rain$x : $(ADAMAKE) $(ADAMAKEFLAGS) rain $(CARGS) $(LARGS) mostlyclean: @echo made $@ clean :: mostlyclean rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \ trace screendump b~*.ad[bs] distclean :: clean rm -f Makefile realclean :: distclean @echo made $@ AdaCurses-20170708/samples/status.adb0000644000175100001440000000652407746514446016044 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Status -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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: Laurent Pautet -- Modified by: Juergen Pfeifer, 1997 -- Version Control -- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- This package has been contributed by Laurent Pautet -- -- -- package body Status is protected body Process is procedure Stop is begin Done := True; end Stop; function Continue return Boolean is begin return not Done; end Continue; end Process; end Status; AdaCurses-20170708/samples/sample-explanation.adb0000644000175100001440000003474212405113232020275 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Explanation -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2011,2014 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, 1996 -- Version Control -- $Revision: 1.27 $ -- $Date: 2014/09/13 19:10:18 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- Poor mans help system. This scans a sequential file for key lines and -- then reads the lines up to the next key. Those lines are presented in -- a window as help or explanation. -- with Ada.Text_IO; use Ada.Text_IO; with Ada.Unchecked_Deallocation; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Manifest; use Sample.Manifest; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Helpers; use Sample.Helpers; package body Sample.Explanation is Help_Keys : constant String := "HELPKEYS"; In_Help : constant String := "INHELP"; File_Name : constant String := "explain.txt"; F : File_Type; type Help_Line; type Help_Line_Access is access Help_Line; pragma Controlled (Help_Line_Access); type String_Access is access String; pragma Controlled (String_Access); type Help_Line is record Prev, Next : Help_Line_Access; Line : String_Access; end record; procedure Explain (Key : String; Win : Window); procedure Release_String is new Ada.Unchecked_Deallocation (String, String_Access); procedure Release_Help_Line is new Ada.Unchecked_Deallocation (Help_Line, Help_Line_Access); function Search (Key : String) return Help_Line_Access; procedure Release_Help (Root : in out Help_Line_Access); function Check_File (Name : String) return Boolean; procedure Explain (Key : String) is begin Explain (Key, Null_Window); end Explain; procedure Explain (Key : String; Win : Window) is -- Retrieve the text associated with this key and display it in this -- window. If no window argument is passed, the routine will create -- a temporary window and use it. function Filter_Key return Real_Key_Code; procedure Unknown_Key; procedure Redo; procedure To_Window (C : in out Help_Line_Access; More : in out Boolean); Frame : Window := Null_Window; W : Window := Win; K : Real_Key_Code; P : Panel; Height : Line_Count; Width : Column_Count; Help : Help_Line_Access := Search (Key); Current : Help_Line_Access; Top_Line : Help_Line_Access; Has_More : Boolean := True; procedure Unknown_Key is begin Add (W, "Help message with ID "); Add (W, Key); Add (W, " not found."); Add (W, Character'Val (10)); Add (W, "Press the Function key labeled 'Quit' key to continue."); end Unknown_Key; procedure Redo is H : Help_Line_Access := Top_Line; begin if Top_Line /= null then for L in 0 .. (Height - 1) loop Add (W, L, 0, H.all.Line.all); exit when H.all.Next = null; H := H.all.Next; end loop; else Unknown_Key; end if; end Redo; function Filter_Key return Real_Key_Code is K : Real_Key_Code; begin loop K := Get_Key (W); if K in Special_Key_Code'Range then case K is when HELP_CODE => if not Find_Context (In_Help) then Push_Environment (In_Help, False); Explain (In_Help, W); Pop_Environment; Redo; end if; when EXPLAIN_CODE => if not Find_Context (Help_Keys) then Push_Environment (Help_Keys, False); Explain (Help_Keys, W); Pop_Environment; Redo; end if; when others => exit; end case; else exit; end if; end loop; return K; end Filter_Key; procedure To_Window (C : in out Help_Line_Access; More : in out Boolean) is L : Line_Position := 0; begin loop Add (W, L, 0, C.all.Line.all); L := L + 1; exit when C.all.Next = null or else L = Height; C := C.all.Next; end loop; if C.all.Next /= null then pragma Assert (L = Height); More := True; else More := False; end if; end To_Window; begin if W = Null_Window then Push_Environment ("HELP"); Default_Labels; Frame := New_Window (Lines - 2, Columns, 0, 0); if Has_Colors then Set_Background (Win => Frame, Ch => (Ch => ' ', Color => Help_Color, Attr => Normal_Video)); Set_Character_Attributes (Win => Frame, Attr => Normal_Video, Color => Help_Color); Erase (Frame); end if; Box (Frame); Set_Character_Attributes (Frame, (Reverse_Video => True, others => False)); Add (Frame, Lines - 3, 2, "Cursor Up/Down scrolls"); Set_Character_Attributes (Frame); -- Back to default. Window_Title (Frame, "Explanation"); W := Derived_Window (Frame, Lines - 4, Columns - 2, 1, 1); Refresh_Without_Update (Frame); Get_Size (W, Height, Width); Set_Meta_Mode (W); Set_KeyPad_Mode (W); Allow_Scrolling (W, True); Set_Echo_Mode (False); P := Create (Frame); Top (P); Update_Panels; else Clear (W); Refresh_Without_Update (W); end if; Current := Help; Top_Line := Help; if null = Help then Unknown_Key; loop K := Filter_Key; exit when K = QUIT_CODE; end loop; else To_Window (Current, Has_More); if Has_More then -- This means there are more lines available, so we have to go -- into a scroll manager. loop K := Filter_Key; if K in Special_Key_Code'Range then case K is when Key_Cursor_Down => if Current.all.Next /= null then Move_Cursor (W, Height - 1, 0); Scroll (W, 1); Current := Current.all.Next; Top_Line := Top_Line.all.Next; Add (W, Current.all.Line.all); end if; when Key_Cursor_Up => if Top_Line.all.Prev /= null then Move_Cursor (W, 0, 0); Scroll (W, -1); Top_Line := Top_Line.all.Prev; Current := Current.all.Prev; Add (W, Top_Line.all.Line.all); end if; when QUIT_CODE => exit; when others => null; end case; end if; end loop; else loop K := Filter_Key; exit when K = QUIT_CODE; end loop; end if; end if; Clear (W); if Frame /= Null_Window then Clear (Frame); Delete (P); Delete (W); Delete (Frame); Pop_Environment; end if; Update_Panels; Update_Screen; Release_Help (Help); end Explain; function Search (Key : String) return Help_Line_Access is Last : Natural; Buffer : String (1 .. 256); Root : Help_Line_Access := null; Current : Help_Line_Access; Tail : Help_Line_Access := null; function Next_Line return Boolean; function Next_Line return Boolean is H_End : constant String := "#END"; begin Get_Line (F, Buffer, Last); if Last = H_End'Length and then H_End = Buffer (1 .. Last) then return False; else return True; end if; end Next_Line; begin Reset (F); Outer : loop exit Outer when not Next_Line; if Last = (1 + Key'Length) and then Key = Buffer (2 .. Last) and then Buffer (1) = '#' then loop exit when not Next_Line; exit when Buffer (1) = '#'; Current := new Help_Line'(null, null, new String'(Buffer (1 .. Last))); if Tail = null then Release_Help (Root); Root := Current; else Tail.all.Next := Current; Current.all.Prev := Tail; end if; Tail := Current; end loop; exit Outer; end if; end loop Outer; return Root; end Search; procedure Release_Help (Root : in out Help_Line_Access) is Next : Help_Line_Access; begin loop exit when Root = null; Next := Root.all.Next; Release_String (Root.all.Line); Release_Help_Line (Root); Root := Next; end loop; end Release_Help; procedure Explain_Context is begin Explain (Context); end Explain_Context; procedure Notepad (Key : String) is H : constant Help_Line_Access := Search (Key); T : Help_Line_Access := H; N : Line_Count := 1; L : Line_Position := 0; W : Window; P : Panel; begin if H /= null then loop T := T.all.Next; exit when T = null; N := N + 1; end loop; W := New_Window (N + 2, Columns, Lines - N - 2, 0); if Has_Colors then Set_Background (Win => W, Ch => (Ch => ' ', Color => Notepad_Color, Attr => Normal_Video)); Set_Character_Attributes (Win => W, Attr => Normal_Video, Color => Notepad_Color); Erase (W); end if; Box (W); Window_Title (W, "Notepad"); P := New_Panel (W); T := H; loop Add (W, L + 1, 1, T.all.Line.all, Integer (Columns - 2)); L := L + 1; T := T.all.Next; exit when T = null; end loop; T := H; Release_Help (T); Refresh_Without_Update (W); Notepad_To_Context (P); end if; end Notepad; function Check_File (Name : String) return Boolean is The_File : File_Type; begin Open (The_File, In_File, Name); Close (The_File); return True; exception when Name_Error => return False; end Check_File; begin if Check_File ("/usr/share/AdaCurses/" & File_Name) then Open (F, In_File, "/usr/share/AdaCurses/" & File_Name); elsif Check_File (File_Name) then Open (F, In_File, File_Name); else Put_Line (Standard_Error, "The file explain.txt was not found in the current directory." ); raise Name_Error; end if; end Sample.Explanation; AdaCurses-20170708/samples/ncurses2-util.ads0000644000175100001440000000752210447516250017243 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses2.util -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000,2006 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.2 $ -- $Date: 2006/06/25 14:24:40 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Ada.Text_IO; package ncurses2.util is Blank : constant Character := ' '; Blank2 : constant Attributed_Character := (Ch => Blank, Attr => Normal_Video, Color => Color_Pair'First); newl : constant Character := Character'Val (10); function CTRL (c : Character) return Key_Code; function CTRL (c : Character) return Character; function Getchar (win : Window := Standard_Window) return Key_Code; procedure Getchar (win : Window := Standard_Window); procedure Pause; procedure Cannot (s : String); procedure ShellOut (message : Boolean); package Int_IO is new Ada.Text_IO.Integer_IO (Integer); function Is_Digit (c : Key_Code) return Boolean; procedure P (s : String); function Code_To_Char (c : Key_Code) return Character; function ctoi (c : Character) return Integer; end ncurses2.util; AdaCurses-20170708/samples/ncurses2.ads0000644000175100001440000000573207212274054016270 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package ncurses2 is pragma Pure (ncurses2); end ncurses2; AdaCurses-20170708/samples/sample-text_io_demo.adb0000644000175100001440000001616011542241134020430 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Text_IO_Demo -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2006,2011 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, 1996 -- Version Control -- $Revision: 1.17 $ -- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Numerics.Generic_Elementary_Functions; with Ada.Numerics.Complex_Types; use Ada.Numerics.Complex_Types; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Text_IO; use Terminal_Interface.Curses.Text_IO; with Terminal_Interface.Curses.Text_IO.Integer_IO; with Terminal_Interface.Curses.Text_IO.Float_IO; with Terminal_Interface.Curses.Text_IO.Enumeration_IO; with Terminal_Interface.Curses.Text_IO.Complex_IO; with Terminal_Interface.Curses.Text_IO.Fixed_IO; with Terminal_Interface.Curses.Text_IO.Decimal_IO; with Terminal_Interface.Curses.Text_IO.Modular_IO; with Sample.Manifest; use Sample.Manifest; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Explanation; use Sample.Explanation; pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Complex_IO); pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Decimal_IO); pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Enumeration_IO); pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Fixed_IO); pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Float_IO); pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Integer_IO); pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Modular_IO); package body Sample.Text_IO_Demo is type Weekday is (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday); type Fix is delta 0.1 range 0.0 .. 4.0; type Dec is delta 0.01 digits 5 range 0.0 .. 4.0; type Md is mod 5; package Math is new Ada.Numerics.Generic_Elementary_Functions (Float); package Int_IO is new Terminal_Interface.Curses.Text_IO.Integer_IO (Integer); use Int_IO; package Real_IO is new Terminal_Interface.Curses.Text_IO.Float_IO (Float); use Real_IO; package Enum_IO is new Terminal_Interface.Curses.Text_IO.Enumeration_IO (Weekday); use Enum_IO; package C_IO is new Terminal_Interface.Curses.Text_IO.Complex_IO (Ada.Numerics.Complex_Types); use C_IO; package F_IO is new Terminal_Interface.Curses.Text_IO.Fixed_IO (Fix); use F_IO; package D_IO is new Terminal_Interface.Curses.Text_IO.Decimal_IO (Dec); use D_IO; package M_IO is new Terminal_Interface.Curses.Text_IO.Modular_IO (Md); use M_IO; procedure Demo is W : Window; P : Panel := Create (Standard_Window); K : Real_Key_Code; Im : constant Complex := (0.0, 1.0); Fx : constant Dec := 3.14; Dc : constant Dec := 2.72; L : Md; begin Push_Environment ("TEXTIO"); Default_Labels; Notepad ("TEXTIO-PAD00"); Set_Echo_Mode (False); Set_Meta_Mode; Set_KeyPad_Mode; W := Sub_Window (Standard_Window, Lines - 2, Columns - 2, 1, 1); Box; Refresh_Without_Update; Set_Meta_Mode (W); Set_KeyPad_Mode (W); Immediate_Update_Mode (W, True); Set_Window (W); for I in 1 .. 10 loop Put ("Square root of "); Put (Item => I, Width => 5); Put (" is "); Put (Item => Math.Sqrt (Float (I)), Exp => 0, Aft => 7); New_Line; end loop; for W in Weekday loop Put (Item => W); Put (' '); end loop; New_Line; L := Md'First; for I in 1 .. 2 loop for J in Md'Range loop Put (L); Put (' '); L := L + 1; end loop; end loop; New_Line; Put (Im); New_Line; Put (Fx); New_Line; Put (Dc); New_Line; loop K := Get_Key; if K in Special_Key_Code'Range then case K is when QUIT_CODE => exit; when HELP_CODE => Explain_Context; when EXPLAIN_CODE => Explain ("TEXTIOKEYS"); when others => null; end case; end if; end loop; Set_Window (Null_Window); Erase; Refresh_Without_Update; Delete (P); Delete (W); Pop_Environment; end Demo; end Sample.Text_IO_Demo; AdaCurses-20170708/samples/sample-curses_demo-mouse.ads0000644000175100001440000000573207746514446021457 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Curses_Demo.Mouse -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Curses_Demo.Mouse is procedure Demo; end Sample.Curses_Demo.Mouse; AdaCurses-20170708/samples/ncurses2-color_edit.adb0000644000175100001440000002417411315445062020367 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2006,2009 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.6 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with ncurses2.genericPuts; with Terminal_Interface.Curses; use Terminal_Interface.Curses; procedure ncurses2.color_edit is use Int_IO; type RGB_Enum is (Redx, Greenx, Bluex); procedure change_color (current : Color_Number; field : RGB_Enum; value : RGB_Value; usebase : Boolean); procedure change_color (current : Color_Number; field : RGB_Enum; value : RGB_Value; usebase : Boolean) is red, green, blue : RGB_Value; begin if usebase then Color_Content (current, red, green, blue); else red := 0; green := 0; blue := 0; end if; case field is when Redx => red := red + value; when Greenx => green := green + value; when Bluex => blue := blue + value; end case; declare begin Init_Color (current, red, green, blue); exception when Curses_Exception => Beep; end; end change_color; package x is new ncurses2.genericPuts (100); use x; tmpb : x.BS.Bounded_String; tmp4 : String (1 .. 4); tmp6 : String (1 .. 6); tmp8 : String (1 .. 8); -- This would be easier if Ada had a Bounded_String -- defined as a class instead of the inferior generic package, -- then I could define Put, Add, and Get for them. Blech. value : RGB_Value := 0; red, green, blue : RGB_Value; max_colors : constant Natural := Number_Of_Colors; current : Color_Number := 0; field : RGB_Enum := Redx; this_c : Key_Code := 0; begin Refresh; for i in Color_Number'(0) .. Color_Number (Number_Of_Colors) loop Init_Pair (Color_Pair (i), White, i); end loop; Move_Cursor (Line => Lines - 2, Column => 0); Add (Str => "Number: "); myPut (tmpb, Integer (value)); myAdd (Str => tmpb); loop Switch_Character_Attribute (On => False, Attr => (Bold_Character => True, others => False)); Add (Line => 0, Column => 20, Str => "Color RGB Value Editing"); Switch_Character_Attribute (On => False, Attr => (Bold_Character => True, others => False)); for i in Color_Number'(0) .. Color_Number (Number_Of_Colors) loop Move_Cursor (Line => 2 + Line_Position (i), Column => 0); if current = i then Add (Ch => '>'); else Add (Ch => ' '); end if; -- TODO if i <= color_names'Max then Put (tmp8, Integer (i)); Set_Character_Attributes (Color => Color_Pair (i)); Add (Str => " "); Set_Character_Attributes; Refresh; Color_Content (i, red, green, blue); Add (Str => " R = "); if current = i and field = Redx then Switch_Character_Attribute (On => True, Attr => (Stand_Out => True, others => False)); end if; Put (tmp4, Integer (red)); Add (Str => tmp4); if current = i and field = Redx then Set_Character_Attributes; end if; Add (Str => " G = "); if current = i and field = Greenx then Switch_Character_Attribute (On => True, Attr => (Stand_Out => True, others => False)); end if; Put (tmp4, Integer (green)); Add (Str => tmp4); if current = i and field = Greenx then Set_Character_Attributes; end if; Add (Str => " B = "); if current = i and field = Bluex then Switch_Character_Attribute (On => True, Attr => (Stand_Out => True, others => False)); end if; Put (tmp4, Integer (blue)); Add (Str => tmp4); if current = i and field = Bluex then Set_Character_Attributes; end if; Set_Character_Attributes; Add (Ch => ')'); end loop; Add (Line => Line_Position (Number_Of_Colors + 3), Column => 0, Str => "Use up/down to select a color, left/right to change " & "fields."); Add (Line => Line_Position (Number_Of_Colors + 4), Column => 0, Str => "Modify field by typing nnn=, nnn-, or nnn+. ? for help."); Move_Cursor (Line => 2 + Line_Position (current), Column => 0); this_c := Getchar; if Is_Digit (this_c) then value := 0; end if; case this_c is when KEY_UP => current := (current - 1) mod Color_Number (max_colors); when KEY_DOWN => current := (current + 1) mod Color_Number (max_colors); when KEY_RIGHT => field := RGB_Enum'Val ((RGB_Enum'Pos (field) + 1) mod 3); when KEY_LEFT => field := RGB_Enum'Val ((RGB_Enum'Pos (field) - 1) mod 3); when Character'Pos ('0') | Character'Pos ('1') | Character'Pos ('2') | Character'Pos ('3') | Character'Pos ('4') | Character'Pos ('5') | Character'Pos ('6') | Character'Pos ('7') | Character'Pos ('8') | Character'Pos ('9') => value := value * 10 + RGB_Value (ctoi (Code_To_Char (this_c))); when Character'Pos ('+') => change_color (current, field, value, True); when Character'Pos ('-') => change_color (current, field, -value, True); when Character'Pos ('=') => change_color (current, field, value, False); when Character'Pos ('?') => Erase; P (" RGB Value Editing Help"); P (""); P ("You are in the RGB value editor. Use the arrow keys to " & "select one of"); P ("the fields in one of the RGB triples of the current colors;" & " the one"); P ("currently selected will be reverse-video highlighted."); P (""); P ("To change a field, enter the digits of the new value; they" & " are echoed"); P ("as entered. Finish by typing `='. The change will take" & " effect instantly."); P ("To increment or decrement a value, use the same procedure," & " but finish"); P ("with a `+' or `-'."); P (""); P ("To quit, do `x' or 'q'"); Pause; Erase; when Character'Pos ('q') | Character'Pos ('x') => null; when others => Beep; end case; Move_Cursor (Line => Lines - 2, Column => 0); Put (tmp6, Integer (value)); Add (Str => "Number: " & tmp6); Clear_To_End_Of_Line; exit when this_c = Character'Pos ('x') or this_c = Character'Pos ('q'); end loop; Erase; End_Windows; end ncurses2.color_edit; AdaCurses-20170708/samples/sample.ads0000644000175100001440000000566407746514446016027 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample is procedure Whow; end Sample; AdaCurses-20170708/samples/ncurses2-overlap_test.adb0000644000175100001440000001533612555017427020762 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2014,2015 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.7 $ -- $Date: 2015/07/25 23:43:19 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with Terminal_Interface.Curses; use Terminal_Interface.Curses; -- test effects of overlapping windows procedure ncurses2.overlap_test is procedure fillwin (win : Window; ch : Character); procedure crosswin (win : Window; ch : Character); procedure fillwin (win : Window; ch : Character) is y1 : Line_Position; x1 : Column_Position; begin Get_Size (win, y1, x1); for y in 0 .. y1 - 1 loop Move_Cursor (win, y, 0); for x in 0 .. x1 - 1 loop Add (win, Ch => ch); end loop; end loop; exception when Curses_Exception => null; -- write to lower right corner end fillwin; procedure crosswin (win : Window; ch : Character) is y1 : Line_Position; x1 : Column_Position; begin Get_Size (win, y1, x1); for y in 0 .. y1 - 1 loop for x in 0 .. x1 - 1 loop if ((x > (x1 - 1) / 3) and (x <= (2 * (x1 - 1)) / 3)) or (((y > (y1 - 1) / 3) and (y <= (2 * (y1 - 1)) / 3))) then Move_Cursor (win, y, x); Add (win, Ch => ch); end if; end loop; end loop; end crosswin; -- In a 24x80 screen like some xterms are, the instructions will -- be overwritten. ch : Character; win1 : Window := New_Window (9, 20, 3, 3); win2 : Window := New_Window (9, 20, 9, 16); begin Set_Raw_Mode (SwitchOn => True); Refresh; Move_Cursor (Line => 0, Column => 0); Add (Str => "This test shows the behavior of wnoutrefresh() with " & "respect to"); Add (Ch => newl); Add (Str => "the shared region of two overlapping windows A and B. " & "The cross"); Add (Ch => newl); Add (Str => "pattern in each window does not overlap the other."); Add (Ch => newl); Move_Cursor (Line => 18, Column => 0); Add (Str => "a = refresh A, then B, then doupdate. b = refresh B, " & "then A, then doupdate"); Add (Ch => newl); Add (Str => "c = fill window A with letter A. d = fill window B " & "with letter B."); Add (Ch => newl); Add (Str => "e = cross pattern in window A. f = cross pattern " & "in window B."); Add (Ch => newl); Add (Str => "g = clear window A. h = clear window B."); Add (Ch => newl); Add (Str => "i = overwrite A onto B. j = overwrite " & "B onto A."); Add (Ch => newl); Add (Str => "^Q/ESC = terminate test."); loop ch := Code_To_Char (Getchar); exit when ch = CTRL ('Q') or ch = CTRL ('['); -- QUIT or ESCAPE case ch is when 'a' => -- refresh window A first, then B Refresh_Without_Update (win1); Refresh_Without_Update (win2); Update_Screen; when 'b' => -- refresh window B first, then A Refresh_Without_Update (win2); Refresh_Without_Update (win1); Update_Screen; when 'c' => -- fill window A so it's visible fillwin (win1, 'A'); when 'd' => -- fill window B so it's visible fillwin (win2, 'B'); when 'e' => -- cross test pattern in window A crosswin (win1, 'A'); when 'f' => -- cross test pattern in window B crosswin (win2, 'B'); when 'g' => -- clear window A Clear (win1); Move_Cursor (win1, 0, 0); when 'h' => -- clear window B Clear (win2); Move_Cursor (win2, 0, 0); when 'i' => -- overwrite A onto B Overwrite (win1, win2); when 'j' => -- overwrite B onto A Overwrite (win2, win1); when others => null; end case; end loop; Delete (win2); Delete (win1); Erase; End_Windows; end ncurses2.overlap_test; AdaCurses-20170708/samples/sample-curses_demo-mouse.adb0000644000175100001440000002131311042670563021412 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Curses_Demo.Mouse -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2006,2008 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, 1996 -- Version Control -- $Revision: 1.16 $ -- $Date: 2008/07/26 18:48:19 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; with Terminal_Interface.Curses.Text_IO; use Terminal_Interface.Curses.Text_IO; with Terminal_Interface.Curses.Text_IO.Integer_IO; with Terminal_Interface.Curses.Text_IO.Enumeration_IO; with Sample.Helpers; use Sample.Helpers; with Sample.Manifest; use Sample.Manifest; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Explanation; use Sample.Explanation; package body Sample.Curses_Demo.Mouse is package Int_IO is new Terminal_Interface.Curses.Text_IO.Integer_IO (Integer); use Int_IO; package Button_IO is new Terminal_Interface.Curses.Text_IO.Enumeration_IO (Mouse_Button); use Button_IO; package State_IO is new Terminal_Interface.Curses.Text_IO.Enumeration_IO (Button_State); use State_IO; procedure Demo is type Controls is array (1 .. 3) of Panel; Frame : Window; Msg : Window; Ctl : Controls; Pan : Panel; K : Real_Key_Code; V : Cursor_Visibility := Invisible; W : Window; Note : Window; Msg_L : constant Line_Count := 8; Lins : Line_Position := Lines; Cols : Column_Position; Mask : Event_Mask; procedure Show_Mouse_Event; procedure Show_Mouse_Event is Evt : constant Mouse_Event := Get_Mouse; Y : Line_Position; X : Column_Position; Button : Mouse_Button; State : Button_State; W : Window; begin Get_Event (Evt, Y, X, Button, State); Put (Msg, "Event at"); Put (Msg, " X="); Put (Msg, Integer (X), 3); Put (Msg, ", Y="); Put (Msg, Integer (Y), 3); Put (Msg, ", Btn="); Put (Msg, Button, 10); Put (Msg, ", Stat="); Put (Msg, State, 15); for I in Ctl'Range loop W := Get_Window (Ctl (I)); if Enclosed_In_Window (W, Evt) then Transform_Coordinates (W, Y, X, From_Screen); Put (Msg, ",Box("); Put (Msg, (I), 1); Put (Msg, ","); Put (Msg, Integer (Y), 1); Put (Msg, ","); Put (Msg, Integer (X), 1); Put (Msg, ")"); end if; end loop; New_Line (Msg); Flush (Msg); Update_Panels; Update_Screen; end Show_Mouse_Event; begin Push_Environment ("MOUSE00"); Notepad ("MOUSE-PAD00"); Default_Labels; Set_Cursor_Visibility (V); Note := Notepad_Window; if Note /= Null_Window then Get_Window_Position (Note, Lins, Cols); end if; Frame := Create (Msg_L, Columns, Lins - Msg_L, 0); if Has_Colors then Set_Background (Win => Frame, Ch => (Color => Default_Colors, Attr => Normal_Video, Ch => ' ')); Set_Character_Attributes (Win => Frame, Attr => Normal_Video, Color => Default_Colors); Erase (Frame); end if; Msg := Derived_Window (Frame, Msg_L - 2, Columns - 2, 1, 1); Pan := Create (Frame); Set_Meta_Mode; Set_KeyPad_Mode; Mask := Start_Mouse; Box (Frame); Window_Title (Frame, "Mouse Protocol"); Refresh_Without_Update (Frame); Allow_Scrolling (Msg, True); declare Middle_Column : constant Integer := Integer (Columns) / 2; Middle_Index : constant Natural := Ctl'First + (Ctl'Length / 2); Width : constant Column_Count := 5; Height : constant Line_Count := 3; Half : constant Column_Count := Width / 2; Space : constant Column_Count := 3; Position : Integer; W : Window; begin for I in Ctl'Range loop Position := ((I) - Integer (Middle_Index)) * Integer (Half + Space + Width) + Middle_Column; W := Create (Height, Width, 1, Column_Position (Position)); if Has_Colors then Set_Background (Win => W, Ch => (Color => Menu_Back_Color, Attr => Normal_Video, Ch => ' ')); Set_Character_Attributes (Win => W, Attr => Normal_Video, Color => Menu_Fore_Color); Erase (W); end if; Ctl (I) := Create (W); Box (W); Move_Cursor (W, 1, Half); Put (W, (I), 1); Refresh_Without_Update (W); end loop; end; Update_Panels; Update_Screen; loop K := Get_Key; if K in Special_Key_Code'Range then case K is when QUIT_CODE => exit; when HELP_CODE => Explain_Context; when EXPLAIN_CODE => Explain ("MOUSEKEYS"); when Key_Mouse => Show_Mouse_Event; when others => null; end case; end if; end loop; for I in Ctl'Range loop W := Get_Window (Ctl (I)); Clear (W); Delete (Ctl (I)); Delete (W); end loop; Clear (Frame); Delete (Pan); Delete (Msg); Delete (Frame); Set_Cursor_Visibility (V); End_Mouse (Mask); Pop_Environment; Update_Panels; Update_Screen; end Demo; end Sample.Curses_Demo.Mouse; AdaCurses-20170708/samples/ncurses2-demo_forms.ads0000644000175100001440000000567307212274076020430 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.demo_forms; AdaCurses-20170708/samples/tour.ads0000644000175100001440000000562307746514446015532 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Tour -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure Tour; AdaCurses-20170708/samples/ncurses2-m.ads0000644000175100001440000000574307212274047016526 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package ncurses2.m is function main return Integer; end ncurses2.m; AdaCurses-20170708/samples/ncurses2-genericputs.adb0000644000175100001440000001212511315445062020565 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2008,2009 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.4 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body ncurses2.genericPuts is procedure myGet (Win : Window := Standard_Window; Str : out BS.Bounded_String; Len : Integer := -1) is function Wgetnstr (Win : Window; Str : char_array; Len : int) return int; pragma Import (C, Wgetnstr, "wgetnstr"); N : Integer := Len; Txt : char_array (0 .. size_t (Max_Length)); xStr : String (1 .. Max_Length); Cnt : Natural; begin if N < 0 then N := Max_Length; end if; if N > Max_Length then raise Constraint_Error; end if; Txt (0) := Interfaces.C.char'First; if Wgetnstr (Win, Txt, C_Int (N)) = Curses_Err then raise Curses_Exception; end if; To_Ada (Txt, xStr, Cnt, True); Str := To_Bounded_String (xStr (1 .. Cnt)); end myGet; procedure myPut (Str : out BS.Bounded_String; i : Integer; Base : Number_Base := 10) is package Int_IO is new Integer_IO (Integer); use Int_IO; tmp : String (1 .. BS.Max_Length); begin Put (tmp, i, Base); Str := To_Bounded_String (tmp); Trim (Str, Ada.Strings.Trim_End'(Ada.Strings.Left)); end myPut; procedure myAdd (Str : BS.Bounded_String) is begin Add (Str => To_String (Str)); end myAdd; -- from ncurses-aux procedure Fill_String (Cp : chars_ptr; Str : out BS.Bounded_String) is -- Fill the string with the characters referenced by the -- chars_ptr. -- Len : Natural; begin if Cp /= Null_Ptr then Len := Natural (Strlen (Cp)); if Max_Length < Len then raise Constraint_Error; end if; declare S : String (1 .. Len); begin S := Value (Cp); Str := To_Bounded_String (S); end; else Str := Null_Bounded_String; end if; end Fill_String; end ncurses2.genericPuts; AdaCurses-20170708/samples/ncurses2-m.adb0000644000175100001440000003631511042670526016502 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2006,2008 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.8 $ -- $Date: 2008/07/26 18:47:50 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- TODO use Default_Character where appropriate -- This is an Ada version of ncurses -- I translated this because it tests the most features. with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; with Ada.Text_IO; use Ada.Text_IO; with Ada.Characters.Latin_1; -- with Ada.Characters.Handling; with Ada.Command_Line; use Ada.Command_Line; with Ada.Strings.Unbounded; with ncurses2.util; use ncurses2.util; with ncurses2.getch_test; with ncurses2.attr_test; with ncurses2.color_test; with ncurses2.demo_panels; with ncurses2.color_edit; with ncurses2.slk_test; with ncurses2.acs_display; with ncurses2.acs_and_scroll; with ncurses2.flushinp_test; with ncurses2.test_sgr_attributes; with ncurses2.menu_test; with ncurses2.demo_pad; with ncurses2.demo_forms; with ncurses2.overlap_test; with ncurses2.trace_set; with ncurses2.getopt; use ncurses2.getopt; package body ncurses2.m is use Int_IO; function To_trace (n : Integer) return Trace_Attribute_Set; procedure usage; procedure Set_Terminal_Modes; function Do_Single_Test (c : Character) return Boolean; function To_trace (n : Integer) return Trace_Attribute_Set is a : Trace_Attribute_Set := (others => False); m : Integer; rest : Integer; begin m := n mod 2; if 1 = m then a.Times := True; end if; rest := n / 2; m := rest mod 2; if 1 = m then a.Tputs := True; end if; rest := rest / 2; m := rest mod 2; if 1 = m then a.Update := True; end if; rest := rest / 2; m := rest mod 2; if 1 = m then a.Cursor_Move := True; end if; rest := rest / 2; m := rest mod 2; if 1 = m then a.Character_Output := True; end if; rest := rest / 2; m := rest mod 2; if 1 = m then a.Calls := True; end if; rest := rest / 2; m := rest mod 2; if 1 = m then a.Virtual_Puts := True; end if; rest := rest / 2; m := rest mod 2; if 1 = m then a.Input_Events := True; end if; rest := rest / 2; m := rest mod 2; if 1 = m then a.TTY_State := True; end if; rest := rest / 2; m := rest mod 2; if 1 = m then a.Internal_Calls := True; end if; rest := rest / 2; m := rest mod 2; if 1 = m then a.Character_Calls := True; end if; rest := rest / 2; m := rest mod 2; if 1 = m then a.Termcap_TermInfo := True; end if; return a; end To_trace; -- these are type Stdscr_Init_Proc; function rip_footer ( Win : Window; Columns : Column_Count) return Integer; pragma Convention (C, rip_footer); function rip_footer ( Win : Window; Columns : Column_Count) return Integer is begin Set_Background (Win, (Ch => ' ', Attr => (Reverse_Video => True, others => False), Color => 0)); Erase (Win); Move_Cursor (Win, 0, 0); Add (Win, "footer:" & Columns'Img & " columns"); Refresh_Without_Update (Win); return 0; -- Curses_OK; end rip_footer; function rip_header ( Win : Window; Columns : Column_Count) return Integer; pragma Convention (C, rip_header); function rip_header ( Win : Window; Columns : Column_Count) return Integer is begin Set_Background (Win, (Ch => ' ', Attr => (Reverse_Video => True, others => False), Color => 0)); Erase (Win); Move_Cursor (Win, 0, 0); Add (Win, "header:" & Columns'Img & " columns"); -- 'Img is a GNAT extention Refresh_Without_Update (Win); return 0; -- Curses_OK; end rip_header; procedure usage is -- type Stringa is access String; use Ada.Strings.Unbounded; -- tbl : constant array (Positive range <>) of Stringa := ( tbl : constant array (Positive range <>) of Unbounded_String := ( To_Unbounded_String ("Usage: ncurses [options]"), To_Unbounded_String (""), To_Unbounded_String ("Options:"), To_Unbounded_String (" -a f,b set default-colors " & "(assumed white-on-black)"), To_Unbounded_String (" -d use default-colors if terminal " & "supports them"), To_Unbounded_String (" -e fmt specify format for soft-keys " & "test (e)"), To_Unbounded_String (" -f rip-off footer line " & "(can repeat)"), To_Unbounded_String (" -h rip-off header line " & "(can repeat)"), To_Unbounded_String (" -s msec specify nominal time for " & "panel-demo (default: 1, to hold)"), To_Unbounded_String (" -t mask specify default trace-level " & "(may toggle with ^T)") ); begin for n in tbl'Range loop Put_Line (Standard_Error, To_String (tbl (n))); end loop; -- exit(EXIT_FAILURE); -- TODO should we use Set_Exit_Status and throw and exception? end usage; procedure Set_Terminal_Modes is begin Set_Raw_Mode (SwitchOn => False); Set_Cbreak_Mode (SwitchOn => True); Set_Echo_Mode (SwitchOn => False); Allow_Scrolling (Mode => True); Use_Insert_Delete_Line (Do_Idl => True); Set_KeyPad_Mode (SwitchOn => True); end Set_Terminal_Modes; nap_msec : Integer := 1; function Do_Single_Test (c : Character) return Boolean is begin case c is when 'a' => getch_test; when 'b' => attr_test; when 'c' => if not Has_Colors then Cannot ("does not support color."); else color_test; end if; when 'd' => if not Has_Colors then Cannot ("does not support color."); elsif not Can_Change_Color then Cannot ("has hardwired color values."); else color_edit; end if; when 'e' => slk_test; when 'f' => acs_display; when 'o' => demo_panels (nap_msec); when 'g' => acs_and_scroll; when 'i' => flushinp_test (Standard_Window); when 'k' => test_sgr_attributes; when 'm' => menu_test; when 'p' => demo_pad; when 'r' => demo_forms; when 's' => overlap_test; when 't' => trace_set; when '?' => null; when others => return False; end case; return True; end Do_Single_Test; command : Character; my_e_param : Soft_Label_Key_Format := Four_Four; assumed_colors : Boolean := False; default_colors : Boolean := False; default_fg : Color_Number := White; default_bg : Color_Number := Black; -- nap_msec was an unsigned long integer in the C version, -- yet napms only takes an int! c : Integer; c2 : Character; optind : Integer := 1; -- must be initialized to one. optarg : getopt.stringa; length : Integer; tmpi : Integer; package myio is new Ada.Text_IO.Integer_IO (Integer); use myio; save_trace : Integer := 0; save_trace_set : Trace_Attribute_Set; function main return Integer is begin loop Qgetopt (c, Argument_Count, Argument'Access, "a:de:fhs:t:", optind, optarg); exit when c = -1; c2 := Character'Val (c); case c2 is when 'a' => -- Ada doesn't have scanf, it doesn't even have a -- regular expression library. assumed_colors := True; myio.Get (optarg.all, Integer (default_fg), length); myio.Get (optarg.all (length + 2 .. optarg.all'Length), Integer (default_bg), length); when 'd' => default_colors := True; when 'e' => myio.Get (optarg.all, tmpi, length); if tmpi > 3 then usage; return 1; end if; my_e_param := Soft_Label_Key_Format'Val (tmpi); when 'f' => Rip_Off_Lines (-1, rip_footer'Access); when 'h' => Rip_Off_Lines (1, rip_header'Access); when 's' => myio.Get (optarg.all, nap_msec, length); when 't' => myio.Get (optarg.all, save_trace, length); when others => usage; return 1; end case; end loop; -- the C version had a bunch of macros here. -- if (!isatty(fileno(stdin))) -- isatty is not available in the standard Ada so skip it. save_trace_set := To_trace (save_trace); Trace_On (save_trace_set); Init_Soft_Label_Keys (my_e_param); Init_Screen; Set_Background (Ch => (Ch => Blank, Attr => Normal_Video, Color => Color_Pair'First)); if Has_Colors then Start_Color; if default_colors then Use_Default_Colors; elsif assumed_colors then Assume_Default_Colors (default_fg, default_bg); end if; end if; Set_Terminal_Modes; Save_Curses_Mode (Curses); End_Windows; -- TODO add macro #if blocks. Put_Line ("Welcome to " & Curses_Version & ". Press ? for help."); loop Put_Line ("This is the ncurses main menu"); Put_Line ("a = keyboard and mouse input test"); Put_Line ("b = character attribute test"); Put_Line ("c = color test pattern"); Put_Line ("d = edit RGB color values"); Put_Line ("e = exercise soft keys"); Put_Line ("f = display ACS characters"); Put_Line ("g = display windows and scrolling"); Put_Line ("i = test of flushinp()"); Put_Line ("k = display character attributes"); Put_Line ("m = menu code test"); Put_Line ("o = exercise panels library"); Put_Line ("p = exercise pad features"); Put_Line ("q = quit"); Put_Line ("r = exercise forms code"); Put_Line ("s = overlapping-refresh test"); Put_Line ("t = set trace level"); Put_Line ("? = repeat this command summary"); Put ("> "); Flush; command := Ada.Characters.Latin_1.NUL; -- get_input: -- loop declare Ch : Character; begin Get (Ch); -- TODO if read(ch) <= 0 -- TODO ada doesn't have an Is_Space function command := Ch; -- TODO if ch = '\n' or '\r' are these in Ada? end; -- end loop get_input; declare begin if Do_Single_Test (command) then Flush_Input; Set_Terminal_Modes; Reset_Curses_Mode (Curses); Clear; Refresh; End_Windows; if command = '?' then Put_Line ("This is the ncurses capability tester."); Put_Line ("You may select a test from the main menu by " & "typing the"); Put_Line ("key letter of the choice (the letter to left " & "of the =)"); Put_Line ("at the > prompt. The commands `x' or `q' will " & "exit."); end if; -- continue; --why continue in the C version? end if; exception when Curses_Exception => End_Windows; end; exit when command = 'q'; end loop; Curses_Free_All; return 0; -- TODO ExitProgram(EXIT_SUCCESS); end main; end ncurses2.m; AdaCurses-20170708/samples/ncurses2-flushinp_test.adb0000644000175100001440000001265607212274112021132 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with ncurses2.util; use ncurses2.util; procedure ncurses2.flushinp_test (win : Window) is procedure Continue (win : Window); procedure Continue (win : Window) is begin Set_Echo_Mode (False); Move_Cursor (win, 10, 1); Add (win, 10, 1, " Press any key to continue"); Refresh (win); Getchar (win); end Continue; h, by, sh : Line_Position; w, bx, sw : Column_Position; subWin : Window; begin Clear (win); Get_Size (win, h, w); Get_Window_Position (win, by, bx); sw := w / 3; sh := h / 3; subWin := Sub_Window (win, sh, sw, by + h - sh - 2, bx + w - sw - 2); if Has_Colors then Init_Pair (2, Cyan, Blue); Change_Background (subWin, Attributed_Character'(Ch => ' ', Color => 2, Attr => Normal_Video)); end if; Set_Character_Attributes (subWin, (Bold_Character => True, others => False)); Box (subWin); Add (subWin, 2, 1, "This is a subwindow"); Refresh (win); Set_Cbreak_Mode (True); Add (win, 0, 1, "This is a test of the flushinp() call."); Add (win, 2, 1, "Type random keys for 5 seconds."); Add (win, 3, 1, "These should be discarded (not echoed) after the subwindow " & "goes away."); Refresh (win); for i in 0 .. 4 loop Move_Cursor (subWin, 1, 1); Add (subWin, Str => "Time = "); Add (subWin, Str => Integer'Image (i)); Refresh (subWin); Nap_Milli_Seconds (1000); Flush_Input; end loop; Delete (subWin); Erase (win); Flash_Screen; Refresh (win); Nap_Milli_Seconds (1000); Add (win, 2, 1, Str => "If you were still typing when the window timer expired,"); Add (win, 3, 1, "or else you typed nothing at all while it was running,"); Add (win, 4, 1, "test was invalid. You'll see garbage or nothing at all. "); Add (win, 6, 1, "Press a key"); Move_Cursor (win, 9, 10); Refresh (win); Set_Echo_Mode (True); Getchar (win); Flush_Input; Add (win, 12, 0, "If you see any key other than what you typed, flushinp() is broken."); Continue (win); Move_Cursor (win, 9, 10); Delete_Character (win); Refresh (win); Move_Cursor (win, 12, 0); Clear_To_End_Of_Line; Add (win, "What you typed should now have been deleted; if not, wdelch() " & "failed."); Continue (win); Set_Cbreak_Mode (True); end ncurses2.flushinp_test; AdaCurses-20170708/samples/sample-header_handler.ads0000644000175100001440000000637007746514446020745 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Header_Handler -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; -- This package handles the painting of the header line of the screen. -- package Sample.Header_Handler is procedure Init_Header_Handler; -- Initialize the handler for the headerlines. procedure Update_Header_Window; -- Update the information in the header window end Sample.Header_Handler; AdaCurses-20170708/samples/rain.adb0000644000175100001440000001421111056336677015437 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Rain -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2007,2008 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: Laurent Pautet -- Modified by: Juergen Pfeifer, 1997 -- Version Control -- $Revision: 1.8 $ -- $Date: 2008/08/30 21:38:07 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- -- with ncurses2.util; use ncurses2.util; with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random; with Status; use Status; with Terminal_Interface.Curses; use Terminal_Interface.Curses; procedure Rain is Visibility : Cursor_Visibility; subtype X_Position is Line_Position; subtype Y_Position is Column_Position; Xpos : array (1 .. 5) of X_Position; Ypos : array (1 .. 5) of Y_Position; done : Boolean; c : Key_Code; N : Integer; G : Generator; Max_X, X : X_Position; Max_Y, Y : Y_Position; procedure Next (J : in out Integer); procedure Cursor (X : X_Position; Y : Y_Position); procedure Next (J : in out Integer) is begin if J = 5 then J := 1; else J := J + 1; end if; end Next; procedure Cursor (X : X_Position; Y : Y_Position) is begin Move_Cursor (Line => X, Column => Y); end Cursor; pragma Inline (Cursor); begin Init_Screen; Set_NL_Mode; Set_Echo_Mode (False); Visibility := Invisible; Set_Cursor_Visibility (Visibility); Set_Timeout_Mode (Standard_Window, Non_Blocking, 0); Max_X := Lines - 5; Max_Y := Columns - 5; for I in Xpos'Range loop Xpos (I) := X_Position (Float (Max_X) * Random (G)) + 2; Ypos (I) := Y_Position (Float (Max_Y) * Random (G)) + 2; end loop; N := 1; done := False; while not done and Process.Continue loop X := X_Position (Float (Max_X) * Random (G)) + 2; Y := Y_Position (Float (Max_Y) * Random (G)) + 2; Cursor (X, Y); Add (Ch => '.'); Cursor (Xpos (N), Ypos (N)); Add (Ch => 'o'); -- Next (N); Cursor (Xpos (N), Ypos (N)); Add (Ch => 'O'); -- Next (N); Cursor (Xpos (N) - 1, Ypos (N)); Add (Ch => '-'); Cursor (Xpos (N), Ypos (N) - 1); Add (Str => "|.|"); Cursor (Xpos (N) + 1, Ypos (N)); Add (Ch => '-'); -- Next (N); Cursor (Xpos (N) - 2, Ypos (N)); Add (Ch => '-'); Cursor (Xpos (N) - 1, Ypos (N) - 1); Add (Str => "/\\"); Cursor (Xpos (N), Ypos (N) - 2); Add (Str => "| O |"); Cursor (Xpos (N) + 1, Ypos (N) - 1); Add (Str => "\\/"); Cursor (Xpos (N) + 2, Ypos (N)); Add (Ch => '-'); -- Next (N); Cursor (Xpos (N) - 2, Ypos (N)); Add (Ch => ' '); Cursor (Xpos (N) - 1, Ypos (N) - 1); Add (Str => " "); Cursor (Xpos (N), Ypos (N) - 2); Add (Str => " "); Cursor (Xpos (N) + 1, Ypos (N) - 1); Add (Str => " "); Cursor (Xpos (N) + 2, Ypos (N)); Add (Ch => ' '); Xpos (N) := X; Ypos (N) := Y; c := Getchar; case c is when Character'Pos ('q') => done := True; when Character'Pos ('Q') => done := True; when Character'Pos ('s') => Set_NoDelay_Mode (Standard_Window, False); when Character'Pos (' ') => Set_NoDelay_Mode (Standard_Window, True); when others => null; end case; Nap_Milli_Seconds (50); end loop; Visibility := Normal; Set_Cursor_Visibility (Visibility); End_Windows; Curses_Free_All; end Rain; AdaCurses-20170708/samples/sample-menu_demo-handler.ads0000644000175100001440000000723211315445604021363 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Menu_Demo.Handler -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,2009 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; generic with function My_Driver (Men : Menu; K : Key_Code; Pan : Panel) return Boolean; package Sample.Menu_Demo.Handler is procedure Drive_Me (M : Menu; Lin : Line_Position; Col : Column_Position; Title : String := ""); -- Position the menu at the given point and drive it. procedure Drive_Me (M : Menu; Title : String := ""); -- Center menu and drive it. end Sample.Menu_Demo.Handler; AdaCurses-20170708/samples/sample-keyboard_handler.adb0000644000175100001440000002007611542240020021240 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Keyboard_Handler -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2006,2011 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, 1996 -- Version Control -- $Revision: 1.16 $ -- $Date: 2011/03/23 00:34:24 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants; with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Ada.Characters.Handling; use Ada.Characters.Handling; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; with Terminal_Interface.Curses.Forms.Field_Types.Enumeration; use Terminal_Interface.Curses.Forms.Field_Types.Enumeration; with Sample.Header_Handler; use Sample.Header_Handler; with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux; with Sample.Manifest; use Sample.Manifest; with Sample.Form_Demo.Handler; -- This package contains a centralized keyboard handler used throughout -- this example. The handler establishes a timeout mechanism that provides -- periodical updates of the common header lines used in this example. -- package body Sample.Keyboard_Handler is In_Command : Boolean := False; function Get_Key (Win : Window := Standard_Window) return Real_Key_Code is K : Real_Key_Code; function Command return Real_Key_Code; function Command return Real_Key_Code is function My_Driver (F : Form; C : Key_Code; P : Panel) return Boolean; package Fh is new Sample.Form_Demo.Handler (My_Driver); type Label_Array is array (Label_Number) of String (1 .. 8); Labels : Label_Array; FA : Field_Array_Access := new Field_Array' (Make (0, 0, "Command:"), Make (Top => 0, Left => 9, Width => Columns - 11), Null_Field); K : Real_Key_Code := Key_None; N : Natural := 0; function My_Driver (F : Form; C : Key_Code; P : Panel) return Boolean is Ch : Character; begin if P = Null_Panel then raise Panel_Exception; end if; if C in User_Key_Code'Range and then C = QUIT then if Driver (F, F_Validate_Field) = Form_Ok then K := Key_None; return True; end if; elsif C in Normal_Key_Code'Range then Ch := Character'Val (C); if Ch = LF or else Ch = CR then if Driver (F, F_Validate_Field) = Form_Ok then declare Buffer : String (1 .. Positive (Columns - 11)); Cmdc : String (1 .. 8); begin Get_Buffer (Fld => FA.all (2), Str => Buffer); Trim (Buffer, Left); if Buffer (1) /= ' ' then Cmdc := To_Upper (Buffer (Cmdc'Range)); for I in Labels'Range loop if Cmdc = Labels (I) then K := Function_Key_Code (Function_Key_Number (I)); exit; end if; end loop; end if; return True; end; end if; end if; end if; return False; end My_Driver; begin In_Command := True; for I in Label_Number'Range loop Get_Soft_Label_Key (I, Labels (I)); Trim (Labels (I), Left); Translate (Labels (I), Upper_Case_Map); if Labels (I) (1) /= ' ' then N := N + 1; end if; end loop; if N > 0 then -- some labels were really set declare Enum_Info : Enumeration_Info (N); Enum_Field : Enumeration_Field; J : Positive := Enum_Info.Names'First; Frm : Form := Create (FA); begin for I in Label_Number'Range loop if Labels (I) (1) /= ' ' then Enum_Info.Names (J) := new String'(Labels (I)); J := J + 1; end if; end loop; Enum_Field := Create (Enum_Info, True); Set_Field_Type (FA.all (2), Enum_Field); Set_Background (FA.all (2), Normal_Video); Fh.Drive_Me (Frm, Lines - 3, 0); Delete (Frm); Update_Panels; Update_Screen; end; end if; Free (FA, True); In_Command := False; return K; end Command; begin Set_Timeout_Mode (Win, Delayed, 30000); loop K := Get_Keystroke (Win); if K = Key_None then -- a timeout occurred Update_Header_Window; elsif K = 3 and then not In_Command then -- CTRL-C K := Command; exit when K /= Key_None; else exit; end if; end loop; return K; end Get_Key; procedure Init_Keyboard_Handler is begin null; end Init_Keyboard_Handler; end Sample.Keyboard_Handler; AdaCurses-20170708/samples/sample-form_demo.ads0000644000175100001440000000571207746514446017766 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Form_Demo -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2003 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, 1996 -- Version Control -- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Form_Demo is procedure Demo; end Sample.Form_Demo; AdaCurses-20170708/samples/ncurses2-trace_set.adb0000644000175100001440000004155112405113232020203 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses2.trace_set -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2011,2014 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.6 $ -- $Date: 2014/09/13 19:10:18 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; with Ada.Strings.Bounded; -- interactively set the trace level procedure ncurses2.trace_set is function menu_virtualize (c : Key_Code) return Key_Code; function subset (super, sub : Trace_Attribute_Set) return Boolean; function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set; function trace_num (tlevel : Trace_Attribute_Set) return String; function tracetrace (tlevel : Trace_Attribute_Set) return String; function run_trace_menu (m : Menu; count : Integer) return Boolean; function menu_virtualize (c : Key_Code) return Key_Code is begin case c is when Character'Pos (newl) | Key_Exit => return Menu_Request_Code'Last + 1; -- MAX_COMMAND? TODO when Character'Pos ('u') => return M_ScrollUp_Line; when Character'Pos ('d') => return M_ScrollDown_Line; when Character'Pos ('b') | Key_Next_Page => return M_ScrollUp_Page; when Character'Pos ('f') | Key_Previous_Page => return M_ScrollDown_Page; when Character'Pos ('n') | Key_Cursor_Down => return M_Next_Item; when Character'Pos ('p') | Key_Cursor_Up => return M_Previous_Item; when Character'Pos (' ') => return M_Toggle_Item; when Key_Mouse => return c; when others => Beep; return c; end case; end menu_virtualize; type string_a is access String; type tbl_entry is record name : string_a; mask : Trace_Attribute_Set; end record; t_tbl : constant array (Positive range <>) of tbl_entry := ( (new String'("Disable"), Trace_Disable), (new String'("Times"), Trace_Attribute_Set'(Times => True, others => False)), (new String'("Tputs"), Trace_Attribute_Set'(Tputs => True, others => False)), (new String'("Update"), Trace_Attribute_Set'(Update => True, others => False)), (new String'("Cursor_Move"), Trace_Attribute_Set'(Cursor_Move => True, others => False)), (new String'("Character_Output"), Trace_Attribute_Set'(Character_Output => True, others => False)), (new String'("Ordinary"), Trace_Ordinary), (new String'("Calls"), Trace_Attribute_Set'(Calls => True, others => False)), (new String'("Virtual_Puts"), Trace_Attribute_Set'(Virtual_Puts => True, others => False)), (new String'("Input_Events"), Trace_Attribute_Set'(Input_Events => True, others => False)), (new String'("TTY_State"), Trace_Attribute_Set'(TTY_State => True, others => False)), (new String'("Internal_Calls"), Trace_Attribute_Set'(Internal_Calls => True, others => False)), (new String'("Character_Calls"), Trace_Attribute_Set'(Character_Calls => True, others => False)), (new String'("Termcap_TermInfo"), Trace_Attribute_Set'(Termcap_TermInfo => True, others => False)), (new String'("Maximium"), Trace_Maximum) ); package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (300); function subset (super, sub : Trace_Attribute_Set) return Boolean is begin if (super.Times or not sub.Times) and (super.Tputs or not sub.Tputs) and (super.Update or not sub.Update) and (super.Cursor_Move or not sub.Cursor_Move) and (super.Character_Output or not sub.Character_Output) and (super.Calls or not sub.Calls) and (super.Virtual_Puts or not sub.Virtual_Puts) and (super.Input_Events or not sub.Input_Events) and (super.TTY_State or not sub.TTY_State) and (super.Internal_Calls or not sub.Internal_Calls) and (super.Character_Calls or not sub.Character_Calls) and (super.Termcap_TermInfo or not sub.Termcap_TermInfo) and True then return True; else return False; end if; end subset; function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set is retval : Trace_Attribute_Set := Trace_Disable; begin retval.Times := (a.Times or b.Times); retval.Tputs := (a.Tputs or b.Tputs); retval.Update := (a.Update or b.Update); retval.Cursor_Move := (a.Cursor_Move or b.Cursor_Move); retval.Character_Output := (a.Character_Output or b.Character_Output); retval.Calls := (a.Calls or b.Calls); retval.Virtual_Puts := (a.Virtual_Puts or b.Virtual_Puts); retval.Input_Events := (a.Input_Events or b.Input_Events); retval.TTY_State := (a.TTY_State or b.TTY_State); retval.Internal_Calls := (a.Internal_Calls or b.Internal_Calls); retval.Character_Calls := (a.Character_Calls or b.Character_Calls); retval.Termcap_TermInfo := (a.Termcap_TermInfo or b.Termcap_TermInfo); return retval; end trace_or; -- Print the hexadecimal value of the mask so -- users can set it from the command line. function trace_num (tlevel : Trace_Attribute_Set) return String is result : Integer := 0; m : Integer := 1; begin if tlevel.Times then result := result + m; end if; m := m * 2; if tlevel.Tputs then result := result + m; end if; m := m * 2; if tlevel.Update then result := result + m; end if; m := m * 2; if tlevel.Cursor_Move then result := result + m; end if; m := m * 2; if tlevel.Character_Output then result := result + m; end if; m := m * 2; if tlevel.Calls then result := result + m; end if; m := m * 2; if tlevel.Virtual_Puts then result := result + m; end if; m := m * 2; if tlevel.Input_Events then result := result + m; end if; m := m * 2; if tlevel.TTY_State then result := result + m; end if; m := m * 2; if tlevel.Internal_Calls then result := result + m; end if; m := m * 2; if tlevel.Character_Calls then result := result + m; end if; m := m * 2; if tlevel.Termcap_TermInfo then result := result + m; end if; m := m * 2; return result'Img; end trace_num; function tracetrace (tlevel : Trace_Attribute_Set) return String is use BS; buf : Bounded_String := To_Bounded_String (""); begin -- The C version prints the hexadecimal value of the mask, we -- won't do that here because this is Ada. if tlevel = Trace_Disable then Append (buf, "Trace_Disable"); else if subset (tlevel, Trace_Attribute_Set'(Times => True, others => False)) then Append (buf, "Times"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Tputs => True, others => False)) then Append (buf, "Tputs"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Update => True, others => False)) then Append (buf, "Update"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Cursor_Move => True, others => False)) then Append (buf, "Cursor_Move"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Character_Output => True, others => False)) then Append (buf, "Character_Output"); Append (buf, ", "); end if; if subset (tlevel, Trace_Ordinary) then Append (buf, "Ordinary"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Calls => True, others => False)) then Append (buf, "Calls"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Virtual_Puts => True, others => False)) then Append (buf, "Virtual_Puts"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Input_Events => True, others => False)) then Append (buf, "Input_Events"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(TTY_State => True, others => False)) then Append (buf, "TTY_State"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Internal_Calls => True, others => False)) then Append (buf, "Internal_Calls"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Character_Calls => True, others => False)) then Append (buf, "Character_Calls"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Termcap_TermInfo => True, others => False)) then Append (buf, "Termcap_TermInfo"); Append (buf, ", "); end if; if subset (tlevel, Trace_Maximum) then Append (buf, "Maximium"); Append (buf, ", "); end if; end if; if To_String (buf) (Length (buf) - 1) = ',' then Delete (buf, Length (buf) - 1, Length (buf)); end if; return To_String (buf); end tracetrace; function run_trace_menu (m : Menu; count : Integer) return Boolean is i, p : Item; changed : Boolean; c, v : Key_Code; begin loop changed := (count /= 0); c := Getchar (Get_Window (m)); v := menu_virtualize (c); case Driver (m, v) is when Unknown_Request => return False; when others => i := Current (m); if i = Menus.Items (m, 1) then -- the first item for n in t_tbl'First + 1 .. t_tbl'Last loop if Value (i) then Set_Value (i, False); changed := True; end if; end loop; else for n in t_tbl'First + 1 .. t_tbl'Last loop p := Menus.Items (m, n); if Value (p) then Set_Value (Menus.Items (m, 1), False); changed := True; exit; end if; end loop; end if; if not changed then return True; end if; end case; end loop; end run_trace_menu; nc_tracing, mask : Trace_Attribute_Set; pragma Import (C, nc_tracing, "_nc_tracing"); items_a : constant Item_Array_Access := new Item_Array (t_tbl'First .. t_tbl'Last + 1); mrows : Line_Count; mcols : Column_Count; menuwin : Window; menu_y : constant Line_Position := 8; menu_x : constant Column_Position := 8; ip : Item; m : Menu; count : Integer; newtrace : Trace_Attribute_Set; begin Add (Line => 0, Column => 0, Str => "Interactively set trace level:"); Add (Line => 2, Column => 0, Str => " Press space bar to toggle a selection."); Add (Line => 3, Column => 0, Str => " Use up and down arrow to move the select bar."); Add (Line => 4, Column => 0, Str => " Press return to set the trace level."); Add (Line => 6, Column => 0, Str => "(Current trace level is "); Add (Str => tracetrace (nc_tracing) & " numerically: " & trace_num (nc_tracing)); Add (Ch => ')'); Refresh; for n in t_tbl'Range loop items_a.all (n) := New_Item (t_tbl (n).name.all); end loop; items_a.all (t_tbl'Last + 1) := Null_Item; m := New_Menu (items_a); Set_Format (m, 16, 2); Scale (m, mrows, mcols); Switch_Options (m, (One_Valued => True, others => False), On => False); menuwin := New_Window (mrows + 2, mcols + 2, menu_y, menu_x); Set_Window (m, menuwin); Set_KeyPad_Mode (menuwin, SwitchOn => True); Box (menuwin); Set_Sub_Window (m, Derived_Window (menuwin, mrows, mcols, 1, 1)); Post (m); for n in t_tbl'Range loop ip := Items (m, n); mask := t_tbl (n).mask; if mask = Trace_Disable then Set_Value (ip, nc_tracing = Trace_Disable); elsif subset (sub => mask, super => nc_tracing) then Set_Value (ip, True); end if; end loop; count := 1; while run_trace_menu (m, count) loop count := count + 1; end loop; newtrace := Trace_Disable; for n in t_tbl'Range loop ip := Items (m, n); if Value (ip) then mask := t_tbl (n).mask; newtrace := trace_or (newtrace, mask); end if; end loop; Trace_On (newtrace); Trace_Put ("trace level interactively set to " & tracetrace (nc_tracing)); Move_Cursor (Line => Lines - 4, Column => 0); Add (Str => "Trace level is "); Add (Str => tracetrace (nc_tracing)); Add (Ch => newl); Pause; -- was just Add(); Getchar Post (m, False); -- menuwin has subwindows I think, which makes an error. declare begin Delete (menuwin); exception when Curses_Exception => null; end; -- free_menu(m); -- free_item() end ncurses2.trace_set; AdaCurses-20170708/samples/ncurses2-menu_test.ads0000644000175100001440000000567207212274050020270 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.menu_test; AdaCurses-20170708/samples/ncurses2-acs_display.ads0000644000175100001440000000567407212274073020567 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.acs_display; AdaCurses-20170708/samples/ncurses2-demo_forms.adb0000644000175100001440000004157012405113232020365 0ustar tomusers------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000-2011,2014 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: Eugene V. Melaragno 2000 -- Version Control -- $Revision: 1.7 $ -- $Date: 2014/09/13 19:10:18 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; with Terminal_Interface.Curses.Forms.Field_User_Data; with Ada.Characters.Handling; with Ada.Strings; with Ada.Strings.Bounded; procedure ncurses2.demo_forms is package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (80); type myptr is access Integer; -- The C version stores a pointer in the userptr and -- converts it into a long integer. -- The correct, but inconvenient way to do it is to use a -- pointer to long and keep the pointer constant. -- It just adds one memory piece to allocate and deallocate (not done here) package StringData is new Terminal_Interface.Curses.Forms.Field_User_Data (Integer, myptr); function edit_secure (me : Field; c_in : Key_Code) return Key_Code; function form_virtualize (f : Form; w : Window) return Key_Code; function my_form_driver (f : Form; c : Key_Code) return Boolean; function make_label (frow : Line_Position; fcol : Column_Position; label : String) return Field; function make_field (frow : Line_Position; fcol : Column_Position; rows : Line_Count; cols : Column_Count; secure : Boolean) return Field; procedure display_form (f : Form); procedure erase_form (f : Form); -- prints '*' instead of characters. -- Not that this keeps a bug from the C version: -- type in the psasword field then move off and back. -- the cursor is at position one, but -- this assumes it as at the end so text gets appended instead -- of overwtitting. function edit_secure (me : Field; c_in : Key_Code) return Key_Code is rows, frow : Line_Position; nrow : Natural; cols, fcol : Column_Position; nbuf : Buffer_Number; c : Key_Code := c_in; c2 : Character; use StringData; begin Info (me, rows, cols, frow, fcol, nrow, nbuf); -- TODO if result = Form_Ok and nbuf > 0 then -- C version checked the return value -- of Info, the Ada binding throws an exception I think. if nbuf > 0 then declare temp : BS.Bounded_String; temps : String (1 .. 10); -- TODO Get_Buffer povides no information on the field length? len : myptr; begin Get_Buffer (me, 1, Str => temps); -- strcpy(temp, field_buffer(me, 1)); Get_User_Data (me, len); temp := BS.To_Bounded_String (temps (1 .. len.all)); if c <= Key_Max then c2 := Code_To_Char (c); if Ada.Characters.Handling.Is_Graphic (c2) then BS.Append (temp, c2); len.all := len.all + 1; Set_Buffer (me, 1, BS.To_String (temp)); c := Character'Pos ('*'); else c := 0; end if; else case c is when REQ_BEG_FIELD | REQ_CLR_EOF | REQ_CLR_EOL | REQ_DEL_LINE | REQ_DEL_WORD | REQ_DOWN_CHAR | REQ_END_FIELD | REQ_INS_CHAR | REQ_INS_LINE | REQ_LEFT_CHAR | REQ_NEW_LINE | REQ_NEXT_WORD | REQ_PREV_WORD | REQ_RIGHT_CHAR | REQ_UP_CHAR => c := 0; -- we don't want to do inline editing when REQ_CLR_FIELD => if len.all /= 0 then temp := BS.To_Bounded_String (""); Set_Buffer (me, 1, BS.To_String (temp)); len.all := 0; end if; when REQ_DEL_CHAR | REQ_DEL_PREV => if len.all /= 0 then BS.Delete (temp, BS.Length (temp), BS.Length (temp)); Set_Buffer (me, 1, BS.To_String (temp)); len.all := len.all - 1; end if; when others => null; end case; end if; end; end if; return c; end edit_secure; mode : Key_Code := REQ_INS_MODE; function form_virtualize (f : Form; w : Window) return Key_Code is type lookup_t is record code : Key_Code; result : Key_Code; -- should be Form_Request_Code, but we need MAX_COMMAND + 1 end record; lookup : constant array (Positive range <>) of lookup_t := ( ( Character'Pos ('A') mod 16#20#, REQ_NEXT_CHOICE ), ( Character'Pos ('B') mod 16#20#, REQ_PREV_WORD ), ( Character'Pos ('C') mod 16#20#, REQ_CLR_EOL ), ( Character'Pos ('D') mod 16#20#, REQ_DOWN_FIELD ), ( Character'Pos ('E') mod 16#20#, REQ_END_FIELD ), ( Character'Pos ('F') mod 16#20#, REQ_NEXT_PAGE ), ( Character'Pos ('G') mod 16#20#, REQ_DEL_WORD ), ( Character'Pos ('H') mod 16#20#, REQ_DEL_PREV ), ( Character'Pos ('I') mod 16#20#, REQ_INS_CHAR ), ( Character'Pos ('K') mod 16#20#, REQ_CLR_EOF ), ( Character'Pos ('L') mod 16#20#, REQ_LEFT_FIELD ), ( Character'Pos ('M') mod 16#20#, REQ_NEW_LINE ), ( Character'Pos ('N') mod 16#20#, REQ_NEXT_FIELD ), ( Character'Pos ('O') mod 16#20#, REQ_INS_LINE ), ( Character'Pos ('P') mod 16#20#, REQ_PREV_FIELD ), ( Character'Pos ('R') mod 16#20#, REQ_RIGHT_FIELD ), ( Character'Pos ('S') mod 16#20#, REQ_BEG_FIELD ), ( Character'Pos ('U') mod 16#20#, REQ_UP_FIELD ), ( Character'Pos ('V') mod 16#20#, REQ_DEL_CHAR ), ( Character'Pos ('W') mod 16#20#, REQ_NEXT_WORD ), ( Character'Pos ('X') mod 16#20#, REQ_CLR_FIELD ), ( Character'Pos ('Y') mod 16#20#, REQ_DEL_LINE ), ( Character'Pos ('Z') mod 16#20#, REQ_PREV_CHOICE ), ( Character'Pos ('[') mod 16#20#, -- ESCAPE Form_Request_Code'Last + 1 ), ( Key_Backspace, REQ_DEL_PREV ), ( KEY_DOWN, REQ_DOWN_CHAR ), ( Key_End, REQ_LAST_FIELD ), ( Key_Home, REQ_FIRST_FIELD ), ( KEY_LEFT, REQ_LEFT_CHAR ), ( KEY_LL, REQ_LAST_FIELD ), ( Key_Next, REQ_NEXT_FIELD ), ( KEY_NPAGE, REQ_NEXT_PAGE ), ( KEY_PPAGE, REQ_PREV_PAGE ), ( Key_Previous, REQ_PREV_FIELD ), ( KEY_RIGHT, REQ_RIGHT_CHAR ), ( KEY_UP, REQ_UP_CHAR ), ( Character'Pos ('Q') mod 16#20#, -- QUIT Form_Request_Code'Last + 1 -- TODO MAX_FORM_COMMAND + 1 ) ); c : Key_Code := Getchar (w); me : constant Field := Current (f); begin if c = Character'Pos (']') mod 16#20# then if mode = REQ_INS_MODE then mode := REQ_OVL_MODE; else mode := REQ_INS_MODE; end if; c := mode; else for n in lookup'Range loop if lookup (n).code = c then c := lookup (n).result; exit; end if; end loop; end if; -- Force the field that the user is typing into to be in reverse video, -- while the other fields are shown underlined. if c <= Key_Max then c := edit_secure (me, c); Set_Background (me, (Reverse_Video => True, others => False)); elsif c <= Form_Request_Code'Last then c := edit_secure (me, c); Set_Background (me, (Under_Line => True, others => False)); end if; return c; end form_virtualize; function my_form_driver (f : Form; c : Key_Code) return Boolean is flag : constant Driver_Result := Driver (f, F_Validate_Field); begin if c = Form_Request_Code'Last + 1 and flag = Form_Ok then return True; else Beep; return False; end if; end my_form_driver; function make_label (frow : Line_Position; fcol : Column_Position; label : String) return Field is f : constant Field := Create (1, label'Length, frow, fcol, 0, 0); o : Field_Option_Set := Get_Options (f); begin if f /= Null_Field then Set_Buffer (f, 0, label); o.Active := False; Set_Options (f, o); end if; return f; end make_label; function make_field (frow : Line_Position; fcol : Column_Position; rows : Line_Count; cols : Column_Count; secure : Boolean) return Field is f : Field; use StringData; len : myptr; begin if secure then f := Create (rows, cols, frow, fcol, 0, 1); else f := Create (rows, cols, frow, fcol, 0, 0); end if; if f /= Null_Field then Set_Background (f, (Under_Line => True, others => False)); len := new Integer; len.all := 0; Set_User_Data (f, len); end if; return f; end make_field; procedure display_form (f : Form) is w : Window; rows : Line_Count; cols : Column_Count; begin Scale (f, rows, cols); w := New_Window (rows + 2, cols + 4, 0, 0); if w /= Null_Window then Set_Window (f, w); Set_Sub_Window (f, Derived_Window (w, rows, cols, 1, 2)); Box (w); -- 0,0 Set_KeyPad_Mode (w, True); end if; -- TODO if Post(f) /= Form_Ok then it's a procedure declare begin Post (f); exception when Eti_System_Error | Eti_Bad_Argument | Eti_Posted | Eti_Connected | Eti_Bad_State | Eti_No_Room | Eti_Not_Posted | Eti_Unknown_Command | Eti_No_Match | Eti_Not_Selectable | Eti_Not_Connected | Eti_Request_Denied | Eti_Invalid_Field | Eti_Current => Refresh (w); end; -- end if; end display_form; procedure erase_form (f : Form) is w : Window := Get_Window (f); s : Window := Get_Sub_Window (f); begin Post (f, False); Erase (w); Refresh (w); Delete (s); Delete (w); end erase_form; finished : Boolean := False; f : constant Field_Array_Access := new Field_Array (1 .. 12); secure : Field; myform : Form; w : Window; c : Key_Code; result : Driver_Result; begin Move_Cursor (Line => 18, Column => 0); Add (Str => "Defined form-traversal keys: ^Q/ESC- exit form"); Add (Ch => newl); Add (Str => "^N -- go to next field ^P -- go to previous field"); Add (Ch => newl); Add (Str => "Home -- go to first field End -- go to last field"); Add (Ch => newl); Add (Str => "^L -- go to field to left ^R -- go to field to right"); Add (Ch => newl); Add (Str => "^U -- move upward to field ^D -- move downward to field"); Add (Ch => newl); Add (Str => "^W -- go to next word ^B -- go to previous word"); Add (Ch => newl); Add (Str => "^S -- go to start of field ^E -- go to end of field"); Add (Ch => newl); Add (Str => "^H -- delete previous char ^Y -- delete line"); Add (Ch => newl); Add (Str => "^G -- delete current word ^C -- clear to end of line"); Add (Ch => newl); Add (Str => "^K -- clear to end of field ^X -- clear field"); Add (Ch => newl); Add (Str => "Arrow keys move within a field as you would expect."); Add (Line => 4, Column => 57, Str => "Forms Entry Test"); Refresh; -- describe the form f.all (1) := make_label (0, 15, "Sample Form"); f.all (2) := make_label (2, 0, "Last Name"); f.all (3) := make_field (3, 0, 1, 18, False); f.all (4) := make_label (2, 20, "First Name"); f.all (5) := make_field (3, 20, 1, 12, False); f.all (6) := make_label (2, 34, "Middle Name"); f.all (7) := make_field (3, 34, 1, 12, False); f.all (8) := make_label (5, 0, "Comments"); f.all (9) := make_field (6, 0, 4, 46, False); f.all (10) := make_label (5, 20, "Password:"); f.all (11) := make_field (5, 30, 1, 9, True); secure := f.all (11); f.all (12) := Null_Field; myform := New_Form (f); display_form (myform); w := Get_Window (myform); Set_Raw_Mode (SwitchOn => True); Set_NL_Mode (SwitchOn => True); -- lets us read ^M's while not finished loop c := form_virtualize (myform, w); result := Driver (myform, c); case result is when Form_Ok => Add (Line => 5, Column => 57, Str => Get_Buffer (secure, 1)); Clear_To_End_Of_Line; Refresh; when Unknown_Request => finished := my_form_driver (myform, c); when others => Beep; end case; end loop; erase_form (myform); -- TODO Free_Form(myform); -- for (c = 0; f[c] != 0; c++) free_field(f[c]); Set_Raw_Mode (SwitchOn => False); Set_NL_Mode (SwitchOn => True); end ncurses2.demo_forms; AdaCurses-20170708/Makefile.in0000644000175100001440000000565712560514435014444 0ustar tomusers# $Id: Makefile.in,v 1.22 2015/08/05 23:15:41 tom Exp $ ############################################################################## # Copyright (c) 1998-2010,2015 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, 1996 # # Version Control # $Revision: 1.22 $ # SHELL = @SHELL@ VPATH = @srcdir@ THIS = Makefile SUBDIRS = @ADA_SUBDIRS@ CF_MFLAGS = @cf_cv_makeflags@ @SET_MAKE@ all \ libs \ sources \ install \ install.libs \ uninstall \ uninstall.libs :: for d in $(SUBDIRS); do \ (cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\ done clean \ mostlyclean :: for d in $(SUBDIRS); do \ (cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\ done distclean \ realclean :: for d in $(SUBDIRS); do \ (cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\ done rm -rf lib for lib_kind in static dynamic; do \ rm -rf $${lib_kind}-ali; \ rm -rf $${lib_kind}-obj; \ done -rm -f config.cache config.log config.status include/ncurses_cfg.h -rm -f Makefile tags : @ preinstall : @ install.data : @ AdaCurses-20170708/config.guess0000755000175100001440000012573113063237535014715 0ustar tomusers#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2017 Free Software Foundation, Inc. timestamp='2017-03-05' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || \ echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "${UNAME_MACHINE_ARCH}" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; *:Sortix:*:*) echo ${UNAME_MACHINE}-unknown-sortix exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; k1om:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; mips64el:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; NSX-?:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac cat >&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: AdaCurses-20170708/NEWS0000644000175100001440000220753713130273754013101 0ustar tomusers------------------------------------------------------------------------------- -- Copyright (c) 1998-2016,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. -- ------------------------------------------------------------------------------- -- $Id: NEWS,v 1.2882 2017/07/09 00:25:16 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started working with Pavel Curtis' original work, pcurses, in 1992. Changes through 1.9.9e are recorded by Zeyd M Ben-Halim. Changes since 1.9.9e are recorded by Thomas E Dickey. Contributors include those who have provided patches (even small ones), as well as those who provide useful information (bug reports, analyses). Changes with no cited author are the work of Thomas E Dickey (TD). A few contributors may be cited in this file by their initials. Each accounts for half of one percent or more of the changes since 1.9.9e. See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. 20170708 + add a note to tic manual page about -W versus -f options. + correct a limit-check in fixes from 20170701 (report by Sven Joachim). 20170701 + modify update_getenv() in db_iterator.c to ensure that environment variables which are not initially set will be checked later if an application happens to set them (patch by Guillaume Maudoux). + remove initialization-check for calling napms() in the term-driver configuration; none is needed. + add help-screen to test/test_getstr.c and test/test_get_wstr.c + improve compatibility between different configurations of new_prescr, fixing a case with threaded code and term-driver where c++/demo did not work (cf: 20160213). + the fixes for Redhat #1464685 obscured a problem subsequently reported in Redhat #1464687; the given test-case was no longer reproducible. Testing without the fixes for the earlier reports showed a problem with buffer overflow in dump_entry.c, which is addressed by reducing the use of a fixed-size buffer. + add/improve checks in tic's parser to address invalid input (Redhat #1464684, #1464685, #1464686, #1464691). + alloc_entry.c, add a check for a null-pointer. + parse_entry.c, add several checks for valid pointers as well as one check to ensure that a single character on a line is not treated as the 2-character termcap short-name. + fix a memory leak in delscreen() (report by Bai Junq). + improve tracemunch, showing thread identifiers as names. + fix a use-after-free in NCursesMenu::~NCursesMenu() + further amend incorrect calls for memory-leaks from 20170617 changes (report by Allen Hewes). 20170624 + modify c++/etip.h.in to accommodate deprecation of throw() and throws() in c++17 (prompted by patch by Romain Geissler). + remove some incorrect calls for memory-leaks from 20170617 changes (report by Allen Hewes). + add test-programs for termattrs and term_attrs. + modify _nc_outc_wrapper to use the standard output if the screen was not initialized, rather than returning an error. + improve checks for low-level terminfo functions when the terminal has not been initialized (Redhat #1345963). + modify make_hash to allow building with address-sanitizer, assuming that --disable-leaks is configured. + amend changes for number_format() in 20170506 to avoid undefined behavior when shifting (patch by Emanuele Giaquinta). 20170617 + fill in some places where TERMTYPE2 vs TERMTYPE was not used (report by Allen Hewes). + use ExitTerminfo() internally in error-exits for ncurses' setupterm to help with leak checking. + use ExitProgram() in error-exit from initscr() to help with leak checking. + review test-programs, adding checks for cases where the terminal cannot be initialized. 20170610 + add option "-xp" to picsmap.c, to use init_extended_pair(). + make simple performance fixes for picsmap.c + improve aspect ratio of images read from "convert" in picsmap.c 20170603 + add option to picsmap to use color-palette files, e.g., for mapping to xterm-256color. + move the data in SCREEN used for the alloc_pair() function to the end, to restore compatibility between ncurses/ncursesw libtinfo (report/patch by Miroslav Lichvar). + add build-time utility "report_offsets" to help show when the various configurations of tinfo library are compatible or not. 20170527 + improved test/picsmap.c: + lookup named colors for xpm files in rgb.txt + accept blanks in color-keys for xpm files. + if neither xbm/xpm work, try "convert", which may be available. 20170520 + modify test/picsmap.c to read xpm files. + modify package/debian/* to create documentation packages, so the related files can be checked with lintian. + fix some typos in manpages (report/patch by Sven Joachim). 20170513 + add test/picsmap.c to fill in some testing issues not met by dots. The initial version reads X bitmap (".xbm") files. + repair logic which forces a repaint where a color-pair's content is changed (cf: 20170311). + improve tracemunch, showing screenXX pointers as names. 20170506 + modify tic/infocmp display of numeric values to use hexadecimal when they are "close" to a power of two, making the result more readable. + improve discussion of portability in curs_mouse.3x + change line-length for generated html/manpages to 78 columns from 65. + improve discussion of line-drawing characters in curs_add_wch.3x (prompted by discussion with Lorinczy Zsigmond). + cleanup formatting of hackguide.html and ncurses-intro.html + add examples for WACS_D_PLUS and WACS_T_PLUS to test/ncurses.c 20170429 + corrected a case where $with_gpm was set to "maybe" after CF_WITH_GPM, overlooked in 20160528 fixes (report by Alexandre Bury). + improve a couple of test-program's help-messages. + corrected loop in rain.c from 20170415 changes. + modify winnstr and winchnstr to return error if the output pointer is null, as well as adding a null pointer check of the window pointer for better compatibility with other implementations. + improve discussion of NetBSD curses in scr_dump.5 + modify LIMIT_TYPED macro in new_pair.h to avoid changing sign of the value to be limited (reports by Darby Payne, Rob Boudreau). + update config.guess, config.sub from http://git.savannah.gnu.org/cgit/config.git 20170422 + build-fix for termcap-configuration (report by Chi-Hsuan Yen). + improve terminfo manual page discussion of control- and graphics- characters. + remove tic warning about "^?" in string capabilities, which was marked as an extension (cf: 20000610, 20110820); however all Unix implementations support this and X/Open Curses does not address it. On the other hand, termcap never did support this feature. + correct missing comma-separator between string capabilities in icl6402 and m2-nam -TD + restore rmir/smir in ansi+idc to better match original ansiterm+idc, add alias ansiterm (report by Robert King). + amend an old check for ambiguous use of "ma" in terminfo versus a termcap use, if the capability is cancelled to treat it as number. + correct a case in _nc_captoinfo() which read "%%" and emitted "%". + modify sscanf calls in _nc_infotocap() for patterns "%{number}%+%c" and "%'char'%+%c" to check that the final character is really 'c', avoiding a case in icl6404 which cannot be converted to termcap. + in _nc_infotocap(), add a check to ensure that terminfo "^?" is not written to termcap, because the BSDs did not implement that. + in _nc_tic_expand() and _nc_infotocap(), improve string-length check when deciding whether to use "^X" or "\xxx" format for control characters, to make the output of tic/infocmp more predictable. + limit termcap "%d" width to 2 digits on input, and use "%2" in preference to "%02" on output. + correct terminfo/termcap conversion of "%02" and "%03" into "%2" and "%3"; the result repeated the last character. + add man/scr_dump.5 to document screen-dump format. 20170415 + modify several test programs to use new popup_msgs, adapted from help-screen used in test/edit_field.c + drop two symbols obsoleted in 2004: _nc_check_termtype, and _nc_resolve_uses + fix some old copyright dates (cf: 20031025). + build-fixes for test/savescreen.c to work with AIX and HPUX. + minor fix to configure script, adding a backslash/continuation. + extend TERMINAL structure for ABI 6 to store numbers internally as integers rather than short, by adding new data for this purpose. + more fixes for minor memory-leaks in test-programs. 20170408 + change logic in wins_nwstr() to avoid addressing data past the output of mbstowcs(). + correct a call to setcchar() in Data_Entry_w() from 20131207 changes. + fix minor memory-leaks in test-programs. + further improve ifdef in term_entry.h for internal definitions not used by tack. 20170401 + minor fixes for vt100+4bsd, e.g., delay in sgr for consistency -TD + add smso for env230, to match sgr -TD + remove p7/protect from sgr in fbterm -TD + drop setf/setb from fbterm; setaf/setab are enough -TD + make xterm-pcolor sgr consistent with other capabilities -TD + add rmxx/smxx ECMA-48 strikeout extension to tmux and xterm-basic (discussion with Nicholas Marriott) + add test-programs sp_tinfo and extended_color + modify no-leaks code for lib_cur_term.c to account for the tgetent() cache. + modify setupterm() to save original tty-modes so that erasechar() works as expected. Also modify _nc_setupscreen() to avoid redundant calls to get original tty-modes. + modify set_curterm() to update ttytype[] data used by longname(). + modify wattr_set() and wattr_get() to return ERR if win-parameter is null, as documented. + improve cast used for null-pointer checks in header macros, to reduce compiler warnings. + modify several functions, using the reserved "opts" parameter to pass color- and pair-values larger than 16-bits: + getcchar(), setcchar(), slk_attr_set(), vid_puts(), wattr_get(), wattr_set(), wchgat(), wcolor_set(). + Other functions call these with the corresponding altered behavior, including chgat(), mvchgat(), mvwchgat(), slk_color_on(), slk_color_off(), vid_attr(). + add new functions for manipulating color- and pair-values larger than 16-bits. These are extended_color_content(), extended_pair_content(), extended_slk_color(), init_extended_color(), init_extended_pair(), and the corresponding sp-funcs. 20170325 + fix a memory leak in the window-list when creating multiple screens (reports by Andres Martinelli, Debian #783486). + reviewed calls from link_test.c, added a few more null-pointer checks. + add a null-pointer check in ungetmouse, in case mousemask was not called (report by "Kau"). + updated curs_sp_funcs.3x for new functions. 20170318 + change TERMINAL structure in term.h to make it opaque. Some applications misuse its members, e.g., directly modifying it rather than using def_prog_mode(). + modify utility headers such as tic.h to make it clearer which are externals that are used by tack. + improve curs_slk.3x in particular its discussion of portability. + fix cut/paste in legacy_encoding.3x + add prototype for find_pair() to new_pair.3x (report by Branden Robinson). + fix a couple of broken links in generated man-html documentation. + regenerate man-html documentation. 20170311 + modify vt100 rs2 string to reset vt52 mode and scrolling regions (report/analysis by Robert King) -TD + add vt100+4bsd building block, use that for older terminals rather than "vt100" which is now mostly used as a building block for terminal emulators -TD + correct a few spelling errors in terminfo.src comments -TD + add fbterm -TD + fix a typo in ncurses.c test_attr legend (patch by Petr Vanek). + changed internal colorpair_t to a struct, eliminating an internal 8-bit limit on colors + add ncurses/new_pair.h + add ncurses/base/new_pair.c with alloc_pair(), find_pair() and free_pair() functions + add test/demo_new_pair.c 20170304 + improve terminfo manual description of terminfo syntax. + clarify the use of wint_t vs wchar_t in curs_get_wstr.3x + improve description of endwin() in manual. + modify setcchar() and getcchar() to treat negative color-pair as an error. + fix a typo in include/hashed_db.h (Andre Sa). 20170225 + fixes for CF_CC_ENV_FLAGS (report by Ross Burton). 20170218 + fix several formatting issues with manual pages. + correct read of terminfo entry in which all strings are absent or explicitly cancelled. Before this fix, the result was that all were treated as only absent. + modify infocmp to suppress mixture of absent/cancelled capabilities that would only show as "NULL, NULL", unless the -q option is used, e.g., to show "-, @" or "@, -". 20170212 + build-fixes for PGI compilers (report by Adam J. Stewart) + accept whitespace in sed expression for generating expanded.c + modify configure check that g++ compiler warnings are not used. + add configure check for -fPIC option needed for shared libraries. + let configure --disable-ext-funcs override the default for the --enable-sp-funcs option. + mark some structs in form/menu/panel libraries as potentially opaque without modifying API/ABI. + add configure option --enable-opaque-curses for ncurses library and similar options for the other libraries. 20170204 + trim newlines, tabs and escaped newlines from terminfo "paths" passed to db-iterator. + ignore zero-length files in db-iterator; these are useful for instance to suppress "$HOME/.terminfo" when not wanted. + amended "b64:" encoder to work with the terminfo reader. + modify terminfo reader to accept "b64:" format using RFC-3548 in as well as RFC-4648 url/filename-safe format. + modify terminfo reader to accept "hex:" format as generated by "infocmp -0qQ1" (cf: 20150905). + adjust authors comment to reflect drop below 1% for SV. 20170128 + minor comment-fixes to help automate links to bug-urls -TD + add dvtm, dvtm-256color -TD + add settings corresponding to xterm-keys option to tmux entry to reflect upcoming change to make that option "on" by default (patch by Nicholas Marriott). + uncancel Ms in tmux entry (Harry Gindi, Nicholas Marriott). + add dumb-emacs-ansi -TD 20170121 + improve discussion of early history of tput program. + incorporate A_COLOR mask into COLOR_PAIR(), in case user application provides an out-of-range pair number (report by Elijah Stone). + clarify description in tput manual page regarding support for termcap names (prompted by FreeBSD #214709). + remove a restriction in tput's support for termcap names which omitted capabilities normally not shown in termcap translations (cf: 990123). + modify configure script for clang as used on FreeBSD, to work around clang's differences in exit codes vs gcc. 20170114 + improve discussion of early history of tset/reset programs. + clarify in manual pages that the optional verbose option level is available only when ncurses is configured for tracing. + amend change from 20161231 to avoid writing traces to the standard error after initializing the trace feature using the environment variable. 20170107 + amend changes for tput to reset tty modes to "sane" if the program is run as "reset", like tset. Likewise, ensure that tset sends either reset- or init-strings. + improve manual page descriptions of tput init/reset and tset/reset, to make it easier to see how they are similar and different. + move a static result from key_name() to _nc_globals + modify _nc_get_screensize to allow for use_env() and use_tioctl() state to be per-screen when sp-funcs are configured, better matching the behavior when using the term-driver configuration. + improve cross-references in manual pages for often used functions + move SCREEN field for use_tioctl() data before the ncursesw fields, and limit that to the sp-funcs configuration to improve termlib compatibility (cf: 20120714). + correct order of initialization for traces in use_env() and use_tioctl() versus first trace calls. 20161231 + fix errata for ncurses-howto (report by Damien Ruscoe). + fix a few places in configure/build scripts where DESTDIR and rpath were combined (report by Thomas Klausner). + merge current st description (report by Harry Gindi) -TD + modify flash capability for linux and wyse entries to put the delay between the reverse/normal escapes rather than after -TD + modify program tabs to pass the actual tty file descriptor to setupterm rather than the standard output, making padding work consistently. + explain in clear's manual page that it writes to stdout. + add special case for verbose debugging traces of command-line utilities which write to stderr (cf: 20161126). + remove a trace with literal escapes from skip_DECSCNM(), added in 20161203. + update config.guess, config.sub from http://git.savannah.gnu.org/cgit/config.git 20161224 + correct parmeters for copywin call in _nc_Synchronize_Attributes() (patch by Leon Winter). + improve color-handling section in terminfo manual page (prompted by patch by Mihail Konev). + modify programs clear, tput and tset to pass the actual tty file descriptor to setupterm rather than the standard output, making padding work. 20161217 + add tput-colorcube demo script. + add -r and -s options to tput-initc demo, to match usage in xterm. + flush the standard output in _nc_flush for the case where SP is zero, e.g., when called via putp. This fixes a scenario where "tput flash" did not work after changes in 20130112. 20161210 + add configure script option --disable-wattr-macros for use in cases where one wants to use the same headers for ncurses5/ncurses6 development, by suppressing the wattr* macros which differ due to the introduction of extended colors (prompted by comments in Debian #230990, Redhat #1270534). + add test/tput-initc to demonstrate tput used to initialize palette from a data file. + modify test/xterm*.dat to use the newer color4/color12 values. 20161203 + improve discussion of field validation in form_driver.3x manual page. + update curs_trace.3x manual page. 20161126 + modify linux-16color to not mask dim, standout or reverse with the ncv capability -TD + add 0.1sec mandatory delay to flash capabilities using the VT100 reverse-video control -TD + omit selection of ISO-8859-1 for G0 in enacs capability from linux2.6 entry, to avoid conflict with the user-defined mapping. The reset feature will use ISO-8859-1 in any case (Mikulas Patocka). + improve check in tic for delays by also warning about beep/flash when a delay is not embedded, or if those use the VT100 reverse video escape without using a delay. + minor fix for syntax-check of delays from 20161119 changes. + modify trace() to avoid overwriting existing file (report by Maor Shwartz). 20161119 + add check in tic for some syntax errors of delays, as well as use of proportional delays for non-line capabilities. + document history of the clear program and the E3 extension, prompted by various discussions including http://unix.stackexchange.com/questions/87469/clearing-the-old-scrollback-buffer 20161112 + improve -W option in tic/infocmp: + correct order of size-adjustments in wrapped lines + if -f option splits line, do not further split it with -W + begin a new line when adding "use=" after a wrapped line 20161105 + fix typo in man/terminfo.tail (Alain Williams). + correct program-name in adacurses6-config.1 manual page. 20161029 + add new function "unfocus_current_field" (Leon Winter) 20161022 + modify tset -w (and tput reset) to update the program's copy of the screensize if it was already set in the system, to improve tabstop setting which relies upon knowing the actual screensize. + add functionality of tset -w to tput, like the "-c" feature this is not optional in tput. + add "clear" as a possible link/alias to tput. + improve tput's check for being called as "init" or "reset" to allow for transformed names. + split-out the "clear" function from progs/clear.c, share with tput to get the same behavior, e.g., the E3 extension. 20161015 + amend internal use of tputs to consistently use the number of lines affected, e.g., for insert/delete character operations. While merging terminfo source early in 1995, several descriptions used the "*" proportional delay for these operations, prompting a change in doupdate. + regenerate llib-* files. + regenerate HTML manpages. + fix several formatting issues with manual pages. 20161008 + adjust size in infocmp/tic to work with strlcpy. + fix configure script to record when strlcat is found on OpenBSD. + build-fix for "recent" OpenBSD vs baudrate. 20161001 + add -W option to tic/infocmp to force long strings to wrap. This is in addition to the -w option which attempts to fit capabilities into a given line-length. + add linux-m1 minitel entries (patch by Alexandre Montaron). + correct rs2 string for vt100-nam -TD 20160924 + modify _nc_tic_expand to escape comma if it immediately follows a percent sign, to work with minitel change. + updated minitel and viewdata descriptions (Alexandre Montaron). 20160917 + build-fix for gnat6, which unhelpfully attempts to compile C files. + fix typo in 20160910 changes (Debian #837892, patch by Sven Joachim). 20160910 + trim dead code ifdef'd with HIDE_EINTR since 970830 (discussion with Leon Winter). + trim some obsolete/incorrect wording about EINTR from wgetch manual page (patch by Leon Winter). + really correct 20100515 change (patch by Rich Coe). + add "--enable-string-hacks" option to test/configure + completed string-hacks for "sprintf", etc., including test-programs. + make "--enable-string-hacks" work with Debian by checking for the "bsd" library and its associated "" header. 20160903 + correct 20100515 change for weak signals versus sigprocmask (report by Rich Coe). + modify misc/Makefile.in to work around OpenBSD "make" which unlike all other versions of "make" does not recognize continuation lines of comments. + amend the last change to CF_C_ENV_FLAGS to move only the preprocessor, optimization and warning flags to CPPFLAGS and CFLAGS, leaving the residue in CC. That happens to work for gcc's various "model" options, but may require tuning for other compilers (report by Sven Joachim). 20160827 + add "v" menu entry to test/ncurses.c to show baudrate and other values. + add "newer" baudrate symbols from Linux and FreeBSD to progs/tset.c, lib_baudrate.c + modify CF_XOPEN_SOURCE macro: + add "uclinux" to case for "linux" (patch by Yann E. Morin) + modify _GNU_SOURCE for cygwin headers, tested with cygwin 2.3, 2.5 (patch by Corinna Vinschen, from changes to tin). + improve CF_CC_ENV_FLAGS macro to allow for compiler wrappers such as "ccache" (report by Enrico Scholz). + update config.guess, config.sub from http://git.savannah.gnu.org/cgit/config.git 20160820 + update tput manual page to reflect changes to manipulate terminal modes by sharing functions with tset. + add the terminal-mode parts of "reset" (aka tset) to the "tput reset" command, making the two almost the same except for window-size. + adapt logic used in dialog "--keep-tite" option for test/filter.c as "-a" option. When set, test/filter attempts to suppress the alternate screen. + correct a typo in interix entry -TD 20160813 + add a dependency upon generated-sources in Ada95/src/Makefile.in to handle a case of "configure && make install". + trim trailing blanks from include/Caps*, to work around a problem in sed (Debian #818067). 20160806 + improve CF_GNU_SOURCE configure macro to optionally define _DEFAULT_SOURCE work around a nuisance in recent glibc releases. + move the terminfo-specific parts of tput's "reset" function into the shared reset_cmd.c, making the two forms of reset use the same strings. + split-out the terminal initialization functions from tset as progs/reset_cmd.c, as part of changes to merge the reset-feature with tput. 20160730 + change tset's initialization to allow it to get settings from the standard input as well as /dev/tty, to be more effective when output or error are redirected. + improve discussion of history and portability for tset/reset/tput manual pages. 20160723 + improve error message from tset/reset when both stderr/stdout are redirected to a file or pipe. + improve organization of curs_attr.3x, curs_color.3x 20160709 + work around Debian's antique/unmaintained version of mawk when building link_test. + improve test/list_keys.c, showing ncurses's convention of modifiers for special keys, based on xterm. 20160702 + improve test/list_keys.c, using $TERM if no parameters areg given. 20160625 + build-fixes for ncurses "test_progs" rule. + amend change to CF_CC_ENV_FLAGS in 20160521 to make multilib build work (report by Sven Joachim). 20160618 + build-fixes for ncurses-examples with NetBSD curses. + improve test/list_keys.c, fixing column-widths and sorting the list to make it more readable. 20160611 + revise fix for Debian #805618 (report by Vlado Potisk, cf: 20151128). + modify test/ncurses.c a/A screens to make exiting on an escape character depend on the start of keypad and timeout modes, to allow better testing of function-keys. + modify rs1 for xterm-16color, xterm-88color and xterm-256color to reset palette using "oc" string as in linux -TD + use ANSI reply for u8 in xterm-new, to reflect vt220-style responses that could be returned -TD + added a few capabilities fixed in recent vte -TD 20160604 + correct logic for -f option in test/demo_terminfo.c + add test/list_keys.c 20160528 + further workaround for PIE/PIC breakage which causes gpm to not link. + fix most cppcheck warnings, mostly style, in ncurses library. 20160521 + improved manual page description of tset/reset versus window-size. + fixes to work with a slightly broken compiler configuration which cannot compile "Hello World!" without adding compiler options (report by Ola x Nilsson): + pass appropriate compiler options to the CF_PROG_CC_C_O macro. + when separating compiler and options in CF_CC_ENV_FLAGS, ensure that all options are split-off into CFLAGS or CPPFLAGS + restore some -I options removed in 20140726 because they appeared to be redundant. In fact, they are needed for a compiler that cannot combine -c and -o options. 20160514 + regenerate HTML manpages. + improve manual pages for wgetch and wget_wch to point out that they might return values without names in curses.h (Debian #822426). + make linux3.0 entry the default linux entry (Debian #823658) -TD + modify linux2.6 entry to improve line-drawing so that the linux3.0 entry can be used in non-UTF-8 mode -TD + document return value of use_extended_names (report by Mike Gran). 20160507 + amend change to _nc_do_color to restore the early return for the special case used in _nc_screen_wrap (report by Dick Streefland, cf: 20151017). + modify test/ncurses.c: + check return-value of putwin + correct ifdef which made the 'g' test's legend not reflect changes to keypad- and scroll-modes. + correct return-value of extended putwin (report by Mike Gran). 20160423 + modify test/ncurses.c 'd' edit-color menu to optionally read xterm color palette directly from terminal, as well as handling KEY_RESIZE and screen-repainting with control/L and control/R. + add 'oc' capability to xterm+256color, allowing palette reset for xterm -TD 20160416 + add workaround in configure script for inept transition to PIE vs PIC builds documented in https://fedoraproject.org/wiki/Changes/Harden_All_Packages + add "reset" to list of programs whose names might change in manpages due to program-transformation configure options. + drop long-obsolete "-n" option from tset. 20160409 + modify test/blue.c to use Unicode values for card-glyphs when available, as well as improving the check for CP437 and CP850. 20160402 + regenerate HTML manpages. + improve manual pages for utilities with respect to POSIX versus X/Open Curses. 20160326 + regenerate HTML manpages. + improve test/demo_menus.c, allowing mouse-click on the menu-headers to switch the active menu. This requires a new extension option O_MOUSE_MENU to tell the menu driver to put mouse events which do not apply to the active menu back into the queue so that the application can handle the event. 20160319 + improve description of tgoto parameters (report by Steffen Nurpmeso). + amend workaround for Solaris line-drawing to restore a special case that maps Unicode line-drawing characters into the acsc string for non-Unicode locales (Debian #816888). 20160312 + modified test/filter.c to illustrate an alternative to getnstr, that polls for input while updating a clock on the right margin as well as responding to window size-changes. 20160305 + omit a redefinition of "inline" when traces are enabled, since this does not work with gcc 5.3.x MinGW cross-compiling (cf: 20150912). 20160220 + modify test/configure script to check for pthread dependency of ncursest or ncursestw library when building ncurses examples, e.g., in case weak symbols are used. + modify configure macro for shared-library rules to use -Wl,-rpath rather than -rpath to work around a bug in scons (FreeBSD #178732, cf: 20061021). + double-width multibyte characters were not counted properly in winsnstr and wins_nwstr (report/example by Eric Pruitt). + update config.guess, config.sub from http://git.savannah.gnu.org/cgit/config.git 20160213 + amend fix for _nc_ripoffline from 20091031 to make test/ditto.c work in threaded configuration. + move _nc_tracebits, _tracedump and _tracemouse to curses.priv.h, since they are not part of the suggested ABI6. 20160206 + define WIN32_LEAN_AND_MEAN for MinGW port, making builds faster. + modify test/ditto.c to allow $XTERM_PROG environment variable to override "xterm" as the name of the program to run in the threaded configuration. 20160130 + improve formatting of man/curs_refresh.3x and man/tset.1 manpages + regenerate HTML manpages using newer man2html to eliminate some unwanted blank lines. 20160123 + ifdef'd header-file definition of mouse_trafo() with NCURSES_NOMACROS (report by Corey Minyard). + fix some strict compiler-warnings in traces. 20160116 + tidy up comments about hardcoded 256color palette (report by Leonardo Brondani Schenkel) -TD + add putty-noapp entry, and amend putty entry to use application mode for better consistency with xterm (report by Leonardo Brondani Schenkel) -TD + modify _nc_viscbuf2() and _tracecchar_t2() to trace wide-characters as a whole rather than their multibyte equivalents. + minor fix in wadd_wchnstr() to ensure that each cell has nonzero width. + move PUTC_INIT calls next to wcrtomb calls, to avoid carry-over of error status when processing Unicode values which are not mapped. 20160102 + modify ncurses c/C color test-screens to take advantage of wide screens, reducing the number of lines used for 88- and 256-colors. + minor refinement to check versus ncv to ignore two parameters of SGR 38 and 48 when those come from color-capabilities. 20151226 + add check in tic for use of bold, etc., video attributes in the color capabilities, accounting whether the feature is listed in ncv. + add check in tic for conflict between ritm, rmso, rmul versus sgr0. 20151219 + add a paragraph to curs_getch.3x discussing key naming (discussion with James Crippen). + amend workaround for Solaris vs line-drawing to take the configure check into account. + add a configure check for wcwidth() versus the ncurses line-drawing characters, to use in special-casing systems such as Solaris. 20151212 + improve CF_XOPEN_CURSES macro used in test/configure, to define as needed NCURSES_WIDECHAR for platforms where _XOPEN_SOURCE_EXTENDED does not work. Also modified the test program to ensure that if building with ncurses, that the cchar_t type is checked, since that normally is since 20111030 ifdef'd depending on this test. + improve 20121222 workaround for broken acs, letting Solaris "work" in spite of its misconfigured wcwidth which marks all of the line drawing characters as double-width. 20151205 + update form_cursor.3x, form_post.3x, menu_attributes.3x to list function names in NAME section (patch by Jason McIntyre). + minor fixes to manpage NAME/SYNOPSIS sections to consistently use rule that either all functions which are prototyped in SYNOPSIS are listed in the NAME section, or the manual-page name is the sole item listed in the NAME section. The latter is used to reduce clutter, e.g., for the top-level library manual pages as well as for certain feature-pages such as SP-funcs and threading (prompted by patches by Jason McIntyre). 20151128 + add option to preserve leading whitespace in form fields (patch by Leon Winter). + add missing assignment in lib_getch.c to make notimeout() work (Debian #805618). + add 't' toggle for notimeout() function in test/ncurses.c a/A screens + add viewdata terminal description (Alexandre Montaron). + fix a case in tic/infocmp for formatting capabilities where a backslash at the end of a string was mishandled. + fix some typos in curs_inopts.3x (Benno Schulenberg). 20151121 + fix some inconsistencies in the pccon* entries -TD + add bold to pccon+sgr+acs and pccon-base (Tati Chevron). + add keys f12-f124 to pccon+keys (Tati Chevron). + add test/test_sgr.c program to exercise all combinations of sgr. 20151107 + modify tset's assignment to TERM in its output to reflect the name by which the terminal description is found, rather than the primary name. That was an unnecessary part from the initial conversion of tset from termcap to terminfo. The termcap program in 4.3BSD did this to avoid using the short 2-character name (report by Rich Burridge). + minor fix to configure script to ensure that rules for resulting.map are only generated when needed (cf: 20151101). + modify configure script to handle the case where tic-library is renamed, but the --with-debug option is used by itself without normal or shared libraries (prompted by comment in Debian #803482). 20151101 + amend change for pkg-config which allows build of pc-files when no valid pkg-config library directory was configured to suppress the actual install if it is not overridden to a valid directory at install time (cf: 20150822). + modify editing script which generates resulting.map to work with the clang configuration on recent FreeBSD, which gives an error on an empty "local" section. + fix a spurious "(Part)" message in test/ncurses.c b/B tests due to incorrect attribute-masking. 20151024 + modify MKexpanded.c to update the expansion of a temporary filename to "expanded.c", for use in trace statements. + modify layout of b/B tests in test/ncurses.c to allow for additional annotation on the right margin; some terminals with partial support did not display well. + fix typo in curs_attr.3x (patch by Sven Joachim). + fix typo in INSTALL (patch by Tomas Cech). + improve configure check for setting WILDCARD_SYMS variable; on ppc64 the variable is in the Data section rather than Text (patch by Michel Normand, Novell #946048). + using configure option "--without-fallbacks" incorrectly caused FALLBACK_LIST to be set to "no" (patch by Tomas Cech). + updated minitel entries to fix kel problem with emacs, and add minitel1b-nb (Alexandre Montaron). + reviewed/updated nsterm entry Terminal.app in OSX -TD + replace some dead URLs in comments with equivalents from the Internet Archive -TD + update config.guess, config.sub from http://git.savannah.gnu.org/cgit/config.git 20151017 + modify ncurses/Makefile.in to sort keys.list in POSIX locale (Debian #801864, patch by Esa Peuha). + remove an early-return from _nc_do_color, which can interfere with data needed by bkgd when ncurses is configured with extended colors (patch by Denis Tikhomirov). > fixes for OS/2 (patches by KO Myung-Hun) + use button instead of kbuf[0] in EMX-specific part of lib_mouse.c + support building with libtool on OS/2 + use stdc++ on OS/2 kLIBC + clear cf_XOPEN_SOURCE on OS/2 20151010 + add configure check for openpty to test/configure script, for ditto. + minor fixes to test/view.c in investigating Debian #790847. + update autoconf patch to 2.52.20150926, incorporates a fix for Cdk. + add workaround for breakage of POSIX makefiles by recent binutils change. + improve check for working poll() by using posix_openpt() as a fallback in case there is no valid terminal on the standard input (prompted by discussion on bug-ncurses mailing list, Debian #676461). 20150926 + change makefile rule for removing resulting.map to distclean rather than clean. + add /lib/terminfo to terminfo-dirs in ".deb" test-package. + add note on portability of resizeterm and wresize to manual pages. 20150919 + clarify in resizeterm.3x how KEY_RESIZE is pushed onto the input stream. + clarify in curs_getch.3x that the keypad mode affects ability to read KEY_MOUSE codes, but does not affect KEY_RESIZE. + add overlooked build-fix needed with Cygwin for separate Ada95 configure script, cf: 20150606 (report by Nicolas Boulenguez) 20150912 + fixes for configure/build using clang on OSX (prompted by report by William Gallafent). + do not redefine "inline" in ncurses_cfg.h; this was originally to solve a problem with gcc/g++, but is aggravated by clang's misuse of symbols to pretend it is gcc. + add braces to configure script to prevent unwanted add of "-lstdc++" to the CXXLIBS symbol. + improve/update test-program used for checking existence of stdc++ library. + if $CXXLIBS is set, the linkage test uses that in addition to $LIBS 20150905 + add note in curs_addch.3x about line-drawing when it depends upon UTF-8. + add tic -q option for consistency with infocmp, use it to suppress all comments from the "tic -I" output. + modify infocmp -q option to suppress the "Reconstructed from" header. + add infocmp/tic -Q option, which allows one to dump the compiled form of the terminal entry, in hexadecimal or base64. 20150822 + sort options in usage message for infocmp, to make it simpler to see unused letters. + update usage message for tic, adding "-0" option. + documented differences in ESCDELAY versus AIX's implementation. + fix some compiler warnings from ports. + modify --with-pkg-config-libdir option to make it possible to install ".pc" files even if pkg-config is not found (adapted from patch by Joshua Root). 20150815 + disallow "no" as a possible value for "--with-shlib-version" option, overlooked in cleanup-changes for 20000708 (report by Tommy Alex). + update release notes in INSTALL. + regenerate llib-* files to help with review for release notes. 20150810 + workaround for Debian #65617, which was fixed in mawk's upstream releases in 2009 (report by Sven Joachim). See http://invisible-island.net/mawk/CHANGES.html#t20090727 20150808 6.0 release for upload to ftp.gnu.org 20150808 + build-fix for Ada95 on older platforms without stdint.h + build-fix for Solaris, whose /bin/sh and /usr/bin/sed are non-POSIX. + update release announcement, summarizing more than 800 changes across more than 200 snapshots. + minor fixes to manpages, etc., to simplify linking from announcement page. 20150725 + updated llib-* files. + build-fixes for ncurses library "test_progs" rule. + use alternate workaround for gcc 5.x feature (adapted from patch by Mikhail Peselnik). + add status line to tmux via xterm+sl (patch by Nicholas Marriott). + fixes for st 0.5 from testing with tack -TD + review/improve several manual pages to break up wall-of-text: curs_add_wch.3x, curs_attr.3x, curs_bkgd.3x, curs_bkgrnd.3x, curs_getcchar.3x, curs_getch.3x, curs_kernel.3x, curs_mouse.3x, curs_outopts.3x, curs_overlay.3x, curs_pad.3x, curs_termattrs.3x curs_trace.3x, and curs_window.3x 20150719 + correct an old logic error for %A and %O in tparm (report by "zreed"). + improve documentation for signal handlers by adding section in the curs_initscr.3x page. + modify logic in make_keys.c to not assume anything about the size of strnames and strfnames variables, since those may be functions in the thread- or broken-linker configurations (problem found by Coverity). + modify test/configure script to check for pthreads configuration, e.g., ncursestw library. 20150711 + modify scripts to build/use test-packages for the pthreads configuration of ncurses6. + add references to ttytype and termcap symbols in demo_terminfo.c and demo_termcap.c to ensure that when building ncursest.map, etc., that the corresponding names such as _nc_ttytype are added to the list of versioned symbols (report by Werner Fink) + fix regression from 20150704 (report/patch by Werner Fink). 20150704 + fix a few problems reported by Coverity. + fix comparison against "/usr/include" in misc/gen-pkgconfig.in (report by Daiki Ueno, Debian #790548, cf: 20141213). 20150627 + modify configure script to remove deprecated ABI 5 symbols when building ABI 6. + add symbols _nc_Default_Field, _nc_Default_Form, _nc_has_mouse to map-files, but marked as deprecated so that they can easily be suppressed from ABI 6 builds (Debian #788610). + comment-out "screen.xterm" entry, and inherit screen.xterm-256color from xterm-new (report by Richard Birkett) -TD + modify read_entry.c to set the error-return to -1 if no terminal databases were found, as documented for setupterm. + add test_setupterm.c to demonstrate normal/error returns from the setupterm and restartterm functions. + amend cleanup change from 20110813 which removed redundant definition of ret_error, etc., from tinfo_driver.c, to account for the fact that it should return a bool rather than int (report/analysis by Johannes Schindelin). 20150613 + fix overflow warning for OSX with lib_baudrate.c (cf: 20010630). + modify script used to generate map/sym files to mark 5.9.20150530 as the last "5.9" version, and regenerated the files. That makes the files not use ".current" for the post-5.9 symbols. This also corrects the label for _nc_sigprocmask used in when weak symbols are configured for the ncursest/ncursestw libraries (prompted by discussion with Sven Joachim). + fix typo in NEWS (report by Sven Joachim). 20150606 pre-release + make ABI 6 the default by updates to dist.mk and VERSION, with the intention that the existing ABI 5 should build as before using the "--with-abi-version=5" option. + regenerate ada- and man-html documentation. + minor fixes to color- and util-manpages. + fix a regression in Ada95/gen/Makefile.in, to handle special case of Cygwin, which uses the broken-linker feature. + amend fix for CF_NCURSES_CONFIG used in test/configure to assume that ncurses package scripts work when present for cross-compiling, as the lessor of two evils (cf: 20150530). + add check in configure script to disallow conflicting options "--with-termlib" and "--enable-term-driver". + move defaults for "--disable-lp64" and "--with-versioned-syms" into CF_ABI_DEFAULTS macro. 20150530 + change private type for Event_Mask in Ada95 binding to work when mmask_t is set to 32-bits. + remove spurious "%;" from st entry (report by Daniel Pitts) -TD + add vte-2014, update vte to use that -TD + modify tic and infocmp to "move" a diagnostic for tparm strings that have a syntax error to tic's "-c" option (report by Daniel Pitts). + fix two problems with configure script macros (Debian #786436, cf: 20150425, cf: 20100529). 20150523 + add 'P' menu item to test/ncurses.c, to show pad in color. + improve discussion in curs_color.3x about color rendering (prompted by comment on Stack Overflow forum): + remove screen-bce.mlterm, since mlterm does not do "bce" -TD + add several screen.XXX entries to support the respective variations for 256 colors -TD + add putty+fnkeys* building-block entries -TD + add smkx/rmkx to capabilities analyzed with infocmp "-i" option. 20150516 + amend change to ".pc" files to only use the extra loader flags which may have rpath options (report by Sven Joachim, cf: 20150502). + change versioning for dpkg's in test-packages for Ada95 and ncurses-examples for consistency with Debian, to work with package updates. + regenerate html manpages. + clarify handling of carriage return in waddch manual page; it was discussed only in the portability section (prompted by comment on Stack Overflow forum): 20150509 + add test-packages for cross-compiling ncurses-examples using the MinGW test-packages. These are only the Debian packages; RPM later. + cleanup format of debian/copyright files + add pc-files to the MinGW cross-compiling test-packages. + correct a couple of places in gen-pkgconfig.in to handle renaming of the tinfo library. 20150502 + modify the configure script to allow different default values for ABI 5 versus ABI 6. + add wgetch-events to test-packages. + add a note on how to build ncurses-examples to test/README. + fix a memory leak in delscreen (report by Daniel Kahn Gillmor, Debian #783486) -TD + remove unnecessary ';' from E3 capabilities -TD + add tmux entry, derived from screen (patch by Nicholas Marriott). + split-out recent change to nsterm-bce as nsterm-build326, and add nsterm-build342 to reflect changes with successive releases of OSX (discussion with Leonardo B Schenkel) + add xon, ich1, il1 to ibm3161 (patch by Stephen Powell, Debian #783806) + add sample "magic" file, to document ext-putwin. + modify gen-pkgconfig.in to add explicit -ltinfo, etc., to the generated ".pc" file when ld option "--as-needed" is used, or when ncurses and tinfo are installed without using rpath (prompted by discussion with Sylvain Bertrand). + modify test-package for ncurses6 to omit rpath feature when installed in /usr. + add OSX's "*.dSYM" to clean-rules in makefiles. + make extra-suffix work for OSX configuration, e.g., for shared libraries. + modify Ada95/configure script to work with pkg-config + move test-package for ncurses6 to /usr, since filename-conflicts have been eliminated. + corrected build rules for Ada95/gen/generate; it does not depend on the ncurses library aside from headers. + reviewed man pages, fixed a few other spelling errors. + fix a typo in curs_util.3x (Sven Joachim). + use extra-suffix in some overlooked shared library dependencies found by 20150425 changes for test-packages. + update config.guess, config.sub from http://git.savannah.gnu.org/cgit/config.git 20150425 + expanded description of tgetstr's area pointer in manual page (report by Todd M Lewis). + in-progress changes to modify test-packages to use ncursesw6 rather than ncursesw, with updated configure scripts. + modify CF_NCURSES_CONFIG in Ada95- and test-configure scripts to check for ".pc" files via pkg-config, but add a linkage check since frequently pkg-config configurations are broken. + modify misc/gen-pkgconfig.in to include EXTRA_LDFLAGS, e.g., for the rpath option. + add 'dim' capability to screen entry (report by Leonardo B Schenkel) + add several key definitions to nsterm-bce to match preconfigured keys, e.g., with OSX 10.9 and 10.10 (report by Leonardo B Schenkel) + fix repeated "extra-suffix" in ncurses-config.in (cf: 20150418). + improve term_variables manual page, adding section on the terminfo long-name symbols which are defined in the term.h header. + fix bug in lib_tracebits.c introduced in const-fixes (cf: 20150404). 20150418 + avoid a blank line in output from tabs program by ending it with a carriage return as done in FreeBSD (patch by James Clarke). + build-fix for the "--enable-ext-putwin" feature when not using wide characters (report by Werner Fink). + modify autoconf macros to use scripting improvement from xterm. + add -brtl option to compiler options on AIX 5-7, needed to link with the shared libraries. + add --with-extra-suffix option to help with installing nonconflicting ncurses6 packages, e.g., avoiding header- and library-conflicts. NOTE: as a side-effect, this renames adacurses-config to adacurses5-config and adacursesw-config to adacursesw5-config + modify debian/rules test package to suffix programs with "6". + clarify in curs_inopts.3x that window-specific settings do not inherit into new windows. 20150404 + improve description of start_color() in the manual. + modify several files in ncurses- and progs-directories to allow const data used in internal tables to be put by the linker into the readonly text segment. 20150329 + correct cut/paste error for "--enable-ext-putwin" that made it the same as "--enable-ext-colors" (report by Roumen Petrov) 20150328 + add "-f" option to test/savescreen.c to help with testing/debugging the extended putwin/getwin. + add logic for writing/reading combining characters in the extended putwin/getwin. + add "--enable-ext-putwin" configure option to turn on the extended putwin/getwin. 20150321 + in-progress changes to provide an extended version of putwin and getwin which will be capable of reading screen-dumps between the wide/normal ncurses configurations. These are text files, except for a magic code at the beginning: 0 string \210\210 Screen-dump (ncurses) 20150307 + document limitations of getwin in manual page (prompted by discussion with John S Urban). + extend test/savescreen.c to demonstrate that color pair values and graphic characters can be restored using getwin. 20150228 + modify win_driver.c to eliminate the constructor, to make it more usable in an application which may/may not need the console window (report by Grady Martin). 20150221 + capture define's related to -D_XOPEN_SOURCE from the configure check and add those to the *-config and *.pc files, to simplify use for the wide-character libraries. + modify ncurses.spec to accommodate Fedora21's location of pkg-config directory. + correct sense of "--disable-lib-suffixes" configure option (report by Nicolas Boos, cf: 20140426). 20150214 + regenerate html manpages using improved man2html from work on xterm. + regenerated ".map" and ".sym" files using improved script, accounting for the "--enable-weak-symbols" configure option (report by Werner Fink). 20150131 + regenerated ".map" and ".sym" files using improved script, showing the combinations of configure options used at each stage. 20150124 + add configure check to determine if "local: _*;" can be used in the ".map" files to selectively omit symbols beginning with "_". On at least recent FreeBSD, the wildcard applies to all "_" symbols. + remove obsolete/conflicting rule for ncurses.map from ncurses/Makefile.in (cf: 20130706). 20150117 + improve description in INSTALL of the --with-versioned-syms option. + add combination of --with-hashed-db and --with-ticlib to configurations for ".map" files (report by Werner Fink). 20150110 + add a step to generating ".map" files, to declare any remaining symbols beginning with "_" as local, at the last version node. + improve configure checks for pkg-config, addressing a variant found with FreeBSD ports. + modify win_driver.c to provide characters for special keys, like ansi.sys, when keypad mode is off, rather than returning nothing at all (discussion with Eli Zaretskii). + add "broken_linker" and "hashed-db" configure options to combinations use for generating the ".map" and ".sym" files. + avoid using "ld" directly when creating shared library, to simplify cross-compiles. Also drop "-Bsharable" option from shared-library rules for FreeBSD and DragonFly (FreeBSD #196592). + fix a memory leak in form library Free_RegularExpression_Type() (report by Pavel Balaev). 20150103 + modify_nc_flush() to retry if interrupted (patch by Stian Skjelstad). + change map files to make _nc_freeall a global, since it may be used via the Ada95 binding when checking for memory leaks. + improve sed script used in 20141220 to account for wide-, threaded- variations in ABI 6. 20141227 + regenerate ".map" files, using step overlooked in 20141213 to use the same patch-dates across each file to match ncurses.map (report by Sven Joachim). 20141221 + fix an incorrect variable assignment in 20141220 changes (report by Sven Joachim). 20141220 + updated Ada95/configure with macro changes from 20141213 + tie configure options --with-abi-version and --with-versioned-syms together, so that ABI 6 libraries have distinct symbol versions from the ABI 5 libraries. + replace obsolete/nonworking link to man2html with current one, regenerate html-manpages. 20141213 + modify misc/gen-pkgconfig.in to add -I option for include-directory when using both --prefix and --disable-overwrite (report by Misty De Meo). + add configure option --with-pc-suffix to allow minor renaming of ".pc" files and the corresponding library. Use this in the test package for ncurses6. + modify configure script so that if pkg-config is not installed, it is still possible to install ".pc" files (report by Misty De Meo). + updated ".sym" files, removing symbols which are marked as "local" in the corresponding ".map" files. + updated ".map" files to reflect move of comp_captab and comp_hash from tic-library to tinfo-library in 20090711 (report by Sven Joachim). 20141206 + updated ".map" files so that each symbol that may be shared across the different library configurations has the same label. Some review is needed to ensure these are really compatible. + modify MKlib_gen.sh to work around change in development version of gcc introduced here: https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html (reports by Marcus Shawcroft, Maohui Lei). + improved configure macro CF_SUBDIR_PATH, from lynx changes. 20141129 + improved ".map" files by generating them with a script that builds ncurses with several related configurations and merges the results. A further refinement is planned, to make the tic- and tinfo-library symbols use the same versions across each of the four configurations which are represented (reports by Sven Joachim, Werner Fink). 20141115 + improve description of limits for color values and color pairs in curs_color.3x (prompted by patch by Tim van der Molen). + add VERSION file, using first field in that to record the ABI version used for configure --with-libtool --disable-libtool-version + add configure options for applying the ".map" and ".sym" files to the ncurses, form, menu and panel libraries. + add ".map" and ".sym" files to show exported symbols, e.g., for symbol-versioning. 20141101 + improve strict compiler-warnings by adding a cast in TRACE_RETURN and making a new TRACE_RETURN1 macro for cases where the cast does not apply. 20141025 + in-progress changes to integrate the win32 console driver with the msys2 configuration. 20141018 + reviewed terminology 0.6.1, add function key definitions. None of the vt100-compatibility issues were improved -TD + improve infocmp conversion of extended capabilities to termcap by correcting the limit check against parametrized[], as well as filling in a check if the string happens to have parameters, e.g., "xm" in recent changes. + add check for zero/negative dimensions for resizeterm and resize_term (report by Mike Gran). 20141011 + add experimental support for xterm's 1005 mouse mode, to use in a demonstration of its limitations. + add experimental support for "%u" format to terminfo. + modify test/ncurses.c to also show position reports in 'a' test. + minor formatting fixes to _nc_trace_mmask_t, make this function exported to help with debugging mouse changes. + improve behavior of wheel-mice for xterm protocol, noting that there are only button-presses for buttons "4" and "5", so there is no need to wait to combine events into double-clicks (report/analysis by Greg Field). + provide examples xterm-1005 and xterm-1006 terminfo entries -TD + implement decoder for xterm SGR 1006 mouse mode. 20140927 + implement curs_set in win_driver.c + implement flash in win_driver.c + fix an infinite loop in win_driver.c if the command-window loses focus. + improve the non-buffered mode, i.e., NCURSES_CONSOLE2, of win_driver.c by temporarily changing the buffer-size to match the window-size to eliminate the scrollback. Also enforce a minimum screen-size of 24x80 in the non-buffered mode. + modify generated misc/Makefile to suppress install.data from the dependencies if the --disable-db-install option is used, compensating for the top-level makefile changes used to add ncurses*-config in the 20140920 changes (report by Steven Honeyman). 20140920 + add ncurses*-config to bin-directory of sample package-scripts. + add check to ensure that getopt is available; this is a problem in some older cross-compiler environments. + expanded on the description of --disable-overwrite in INSTALL (prompted by reports by Joakim Tjernlund, Thomas Klausner). See Gentoo #522586 and NetBSD #49200 for examples. which relates to the clarified guidelines. + remove special logic from CF_INCLUDE_DIRS which adds the directory for the --includedir from the build (report by Joakim Tjernlund). + add case for Unixware to CF_XOPEN_SOURCE, from lynx changes. + update config.sub from http://git.savannah.gnu.org/cgit/config.git 20140913 + add a configure check to ignore some of the plethora of non-working C++ cross-compilers. + build-fixes for Ada95 with gnat 4.9 20140906 + build-fix and other improvements for port of ncurses-examples to NetBSD. + minor compiler-warning fixes. 20140831 + modify test/demo_termcap.c and test/demo_terminfo.c to make their options more directly comparable, and add "-i" option to specify a terminal description filename to parse for names to lookup. 20140823 + fix special case where double-width character overwrites a single- width character in the first column (report by Egmont Koblinger, cf: 20050813). 20140816 + fix colors in ncurses 'b' test which did not work after changing it to put the test-strings in subwindows (cf: 20140705). + merge redundant SEE-ALSO sections in form and menu manpages. 20140809 + modify declarations for user-data pointers in C++ binding to use reinterpret_cast to facilitate converting typed pointers to void* in user's application (patch by Adam Jiang). + regenerated html manpages. + add note regarding cause and effect for TERM in ncurses manpage, having noted clueless verbiage in Terminal.app's "help" file which reverses cause/effect. + remove special fallback definition for NCURSES_ATTR_T, since macros have resolved type-mismatches using casts (cf: 970412). + fixes for win_driver.c: + handle repainting on endwin/refresh combination. + implement beep(). + minor cleanup. 20140802 + minor portability fixes for MinGW: + ensure WINVER is defined in makefiles rather than using headers + add check for gnatprep "-T" option + work around bug introduced by gcc 4.8.1 in MinGW which breaks "trace" feature: http://stackoverflow.com/questions/20877689/gcc-4-8-1-minggw-d-option-does-not-work-as-usual + fix most compiler warnings for Cygwin ncurses-examples. + restore "redundant" -I options in test/Makefile.in, since they are typically needed when building the derived ncurses-examples package (cf: 20140726). 20140726 + eliminate some redundant -I options used for building libraries, and ensure that ${srcdir} is added to the include-options (prompted by discussion with Paul Gilmartin). + modify configure script to work with Minix3.2 + add form library extension O_DYNAMIC_JUSTIFY option which can be used to override the different treatment of justification for static versus dynamic fields (adapted from patch by Leon Winter). + add a null pointer check in test/edit_field.c (report/analysis by Leon Winter, cf: 20130608). 20140719 + make workarounds for compiling test-programs with NetBSD curses. + improve configure macro CF_ADD_LIBS, to eliminate repeated -l/-L options, from xterm changes. 20140712 + correct Charable() macro check for A_ALTCHARSET in wide-characters. + build-fix for position-debug code in tty_update.c, to work with or without sp-funcs. 20140705 + add w/W toggle to ncurses.c 'B' test, to demonstrate permutation of video-attributes and colors with double-width character strings. 20140629 + correct check in win_driver.c for saving screen contents, e.g., when NCURSES_CONSOLE2 is set (cf: 20140503). + reorganize b/B menu items in ncurses.c, putting the test-strings into subwindows. This is needed for a planned change to use Unicode fullwidth characters in the test-screens. + correct update to form status for _NEWTOP, broken by fixes for compiler warnings (patch by Leon Winter, cf: 20120616). 20140621 + change shared-library suffix for AIX 5 and 6 to ".so", avoiding conflict with the static library (report by Ben Lentz). + document RPATH_LIST in INSTALLATION file, as part of workarounds for upgrading an ncurses library using the "--with-shared" option. + modify test/ncurses.c c/C tests to cycle through subsets of the total number of colors, to better illustrate 8/16/88/256-colors by providing directly comparable screens. + add test/dots_curses.c, for comparison with the low-level examples. 20140614 + fix dereference before null check found by Coverity in tic.c (cf: 20140524). + fix sign-extension bug in read_entry.c which prevented "toe" from reading empty "screen+italics" entry. + modify sgr for screen.xterm-new to support dim capability -TD + add dim capability to nsterm+7 -TD + cancel dim capability for iterm -TD + add dim, invis capabilities to vte-2012 -TD + add sitm/ritm to konsole-base and mlterm3 -TD 20140609 > fix regression in screen terminfo entries (reports by Christian Ebert, Gabriele Balducci) -TD + revert the change to screen; see notes for why this did not work -TD + cancel sitm/ritm for entries which extend "screen", to work around screen's hardcoded behavior for SGR 3 -TD 20140607 + separate masking for sgr in vidputs from sitm/ritm, which do not overlap with sgr functionality. + remove unneeded -i option from adacurses-config; put -a in the -I option for consistency (patch by Pascal Pignard). + update xterm-new terminfo entry to xterm patch #305 -TD + change format of test-scripts for Debian Ada95 and ncurses-examples packages to quilted to work around Debian #700177 (cf: 20130907). + build fix for form_driver_w.c as part of ncurses-examples package for older ncurses than 20131207. + add Hello World example to adacurses-config manpage. + remove unused --enable-pc-files option from Ada95/configure. + add --disable-gnat-projects option for testing. + revert changes to Ada95 project-files configuration (cf: 20140524). + corrected usage message in adacurses-config. 20140524 + fix typo in ncurses manpage for the NCURSES_NO_MAGIC_COOKIE environment variable. + improve discussion of input-echoing in curs_getch.3x + clarify discussion in curs_addch.3x of wrapping. + modify parametrized.h to make fln non-padded. + correct several entries which had termcap-style padding used in terminfo: adm21, aj510, alto-h19, att605-pc, x820 -TD + correct syntax for padding in some entries: dg211, h19 -TD + correct ti924-8 which had confused padding versus octal escapes -TD + correct padding in sbi entry -TD + fix an old bug in the termcap emulation; "%i" was ignored in tparm() because the parameters to be incremented were already on the internal stack (report by Corinna Vinschen). + modify tic's "-c" option to take into account the "-C" option to activate additional checks which compare the results from running tparm() on the terminfo expressions versus the translated termcap expressions. + modify tic to allow it to read from FIFOs (report by Matthieu Fronton, cf: 20120324). > patches by Nicolas Boulenguez: + explicit dereferences to suppress some style warnings. + when c_varargs_to_ada.c includes its header, use double quotes instead of <>. + samples/ncurses2-util.adb: removed unused with clause. The warning was removed by an obsolete pragma. + replaced Unreferenced pragmas with Warnings (Off). The latter, available with older GNATs, needs no configure test. This also replaces 3 untested Unreferenced pragmas. + simplified To_C usage in trace handling. Using two parameters allows some basic formatting, and avoids a warning about security with some compiler flags. + for generated Ada sources, replace many snippets with one pure package. + removed C_Chtype and its conversions. + removed C_AttrType and its conversions. + removed conversions between int, Item_Option_Set, Menu_Option_Set. + removed int, Field_Option_Set, Item_Option_Set conversions. + removed C_TraceType, Attribute_Option_Set conversions. + replaced C.int with direct use of Eti_Error, now enumerated. As it was used in a case statement, values were tested by the Ada compiler to be consecutive anyway. + src/Makefile.in: remove duplicate stanza + only consider using a project for shared libraries. + style. Silent gnat-4.9 warning about misplaced "then". + generate shared library project to honor ADAFLAGS, LDFLAGS. 20140510 + cleanup recently introduced compiler warnings for MingW port. + workaround for ${MAKEFLAGS} configure check versus GNU make 4.0, which introduces more than one gratuitous incompatibility. 20140503 + add vt520ansi terminfo entry (patch by Mike Gran) + further improve MinGW support for the scenario where there is an ANSI-escapes handler such as ansicon running in the console window (patch by Juergen Pfeifer). 20140426 + add --disable-lib-suffixes option (adapted from patch by Juergen Pfeifer). + merge some changes from Juergen Pfeifer's work with MSYS2, to simplify later merging: + use NC_ISATTY() macro for isatty() in library + add _nc_mingw_isatty() and related functions to windows-driver + rename terminal driver entrypoints to simplify grep's + remove a check in the sp-funcs flavor of newterm() which allowed only the first call to newterm() to succeed (report by Thomas Beierlein, cf: 20090927). 20140419 + update config.guess, config.sub from http://git.savannah.gnu.org/cgit/config.git 20140412 + modify configure script: + drop the -no-gcc option from Intel compiler, from lynx changes. + extend the --with-hashed-db configure option to simplify building with different versions of Berkeley database using FreeBSD ports. + improve initialization for MinGW port (Juergen Pfeifer): + enforce Windows-style path-separator if cross-compiling, + add a driver-name method to each of the drivers, + allow the Windows driver name to match "unknown", ignoring case, + lengthen the built-in name for the Windows console driver to "#win32console", and + move the comparison of driver-names allowing abbreviation, e.g., to "#win32con" into the Windows console driver. 20140329 + add check in tic for mismatch between ccc and initp/initc + cancel ccc in putty-256color and konsole-256color for consistency with the cancelled initc capability (patch by Sven Zuhlsdorf). + add xterm+256setaf building block for various terminals which only get the 256-color feature half-implemented -TD + updated "st" entry (leaving the 0.1.1 version as "simpleterm") to 0.4.1 -TD 20140323 + fix typo in "mlterm" entry (report by Gabriele Balducci) -TD 20140322 + use types from in sample build-scripts for chtype, etc. + modify configure script and curses.h.in to allow the types specified using --with-chtype and related options to be defined in + add terminology entry -TD + add mlterm3 entry, use that as "mlterm" -TD + inherit mlterm-256color from mlterm -TD 20140315 + modify _nc_New_TopRow_and_CurrentItem() to ensure that the menu's top-row is adjusted as needed to ensure that the current item is on the screen (patch by Johann Klammer). + add wgetdelay() to retrieve _delay member of WINDOW if it happens to be opaque, e.g., in the pthread configuration (prompted by patch by Soren Brinkmann). 20140308 + modify ifdef in read_entry.c to handle the case where NCURSES_USE_DATABASE is not defined (patch by Xin Li). + add cast in form_driver_w() to fix ARM build (patch by Xin Li). + add logic to win_driver.c to save/restore screen contents when not allocating a console-buffer (cf: 20140215). 20140301 + clarify error-returns from newwin (report by Ruslan Nabioullin). 20140222 + fix some compiler warnings in win_driver.c + updated notes for wsvt25 based on tack and vttest -TD + add teken entry to show actual properties of FreeBSD's "xterm" console -TD 20140215 + in-progress changes to win_driver.c to implement output without allocating a console-buffer. This uses a pre-existing environment variable NCGDB used by Juergen Pfeifer for debugging (prompted by discussion with Erwin Waterlander regarding Console2, which hangs when reading in an allocated console-buffer). + add -t option to gdc.c, and modify to accept "S" to step through the scrolling-stages. + regenerate NCURSES-Programming-HOWTO.html to fix some of the broken html emitted by docbook. 20140209 + modify CF_XOPEN_SOURCE macro to omit followup check to determine if _XOPEN_SOURCE can/should be defined. g++ 4.7.2 built on Solaris 10 has some header breakage due to its own predefinition of this symbol (report by Jean-Pierre Flori, Sage #15796). 20140201 + add/use symbol NCURSES_PAIRS_T like NCURSES_COLOR_T, to illustrate which "short" types are for color pairs and which are color values. + fix build for s390x, by correcting field bit offsets in generated representation clauses when int=32 long=64 and endian=big, or at least on s390x (patch by Nicolas Boulenguez). + minor cleanup change to test/form_driver_w.c (patch by Gaute Hope). 20140125 + remove unnecessary ifdef's in Ada95/gen/gen.c, which reportedly do not work as is with gcc 4.8 due to fixes using chtype cast made for new compiler warnings by gcc 4.8 in 20130824 (Debian #735753, patch by Nicolas Boulenguez). 20140118 + apply includesubdir variable which was introduced in 20130805 to gen-pkgconfig.in (Debian #735782). 20131221 + further improved man2html, used this to fix broken links in html manpages. See ftp://invisible-island.net/ncurses/patches/man2html 20131214 + modify configure-script/ifdef's to allow OLD_TTY feature to be suppressed if the type of ospeed is configured using the option --with-ospeed to not be a short. By default, it is a short for termcap-compatibility (adapted from suggestion by Christian Weisgerber). + correct a typo in _nc_baudrate() (patch by Christian Weisgerber, cf: 20061230). + fix a few -Wlogical-op warnings. + updated llib-l* files. 20131207 + add form_driver_w() entrypoint to wide-character forms library, as well as test program form_driver_w (adapted from patch by Gaute Hope). 20131123 + minor fix for CF_GCC_WARNINGS to special-case options which are not recognized by clang. 20131116 + add special case to configure script to move _XOPEN_SOURCE_EXTENDED definition from CPPFLAGS to CFLAGS if it happens to be needed for Solaris, because g++ errors with that definition (report by Jean-Pierre Flori, Sage #15268). + correct logic in infocmp's -i option which was intended to ignore strings which correspond to function-keys as candidates for piecing together initialization- or reset-strings. The problem dates to 1.9.7a, but was overlooked until changes in -Wlogical-op warnings for gcc 4.8 (report by David Binderman). + updated CF_GCC_WARNINGS to documented options for gcc 4.9.0, moving checks for -Wextra and -Wdeclaration-after-statement into the macro, and adding checks for -Wignored-qualifiers, -Wlogical-op and -Wvarargs + updated CF_CURSES_UNCTRL_H and CF_SHARED_OPTS macros from ongoing work on cdk. + update config.sub from http://git.savannah.gnu.org/cgit/config.git 20131110 + minor cleanup of terminfo.tail 20131102 + use TS extension to describe xterm's title-escapes -TD + modify terminator and nsterm-s to use xterm+sl-twm building block -TD + update hurd.ti, add xenl to reflect 2011-03-06 change in http://git.savannah.gnu.org/cgit/hurd/hurd.git/log/console/display.c (Debian #727119). + simplify pfkey expression in ansi.sys -TD 20131027 + correct/simplify ifdef's for cur_term versus broken-linker and reentrant options (report by Jean-Pierre Flori, cf: 20090530). + modify release/version combinations in test build-scripts to make them more consistent with other packages. 20131019 + add nc_mingw.h to installed headers for MinGW port; needed for compiling ncurses-examples. + add rpm-script for testing cross-compile of ncurses-examples. 20131014 + fix new typo in CF_ADA_INCLUDE_DIRS macro (report by Roumen Petrov). 20131012 + fix a few compiler warnings in progs and test. + minor fix to package/debian-mingw/rules, do not strip dll's. + minor fixes to configure script for empty $prefix, e.g., when doing cross-compiles to MinGW. + add script for building test-packages of binaries cross-compiled to MinGW using NSIS. 20131005 + minor fixes for ncurses-example package and makefile. + add scripts for test-builds of cross-compiler packages for ncurses6 to MinGW. 20130928 + some build-fixes for ncurses-examples with NetBSD-6.0 curses, though it lacks some common functions such as use_env() which is not yet addressed. + build-fix and some compiler warning fixes for ncurses-examples with OpenBSD 5.3 + fix a possible null-pointer reference in a trace message from newterm. + quiet a few warnings from NetBSD 6.0 namespace pollution by nonstandard popcount() function in standard strings.h header. + ignore g++ 4.2.1 warnings for "-Weffc++" in c++/cursesmain.cc + fix a few overlooked places for --enable-string-hacks option. 20130921 + fix typo in curs_attr.3x (patch by Sven Joachim, cf: 20130831). + build-fix for --with-shared option for DragonFly and FreeBSD (report by Rong-En Fan, cf: 20130727). 20130907 + build-fixes for MSYS for two test-programs (patches by Ray Donnelly, Alexey Pavlov). + revert change to two of the dpkg format files, to work with dpkg before/after Debian #700177. + fix gcc -Wconversion warning in wattr_get() macro. + add msys and msysdll to known host/configuration types (patch by Alexey Pavlov). + modify CF_RPATH_HACK configure macro to not rely upon "-u" option of sort, improving portability. + minor improvements for test-programs from reviewing Solaris port. + update config.guess, config.sub from http://git.savannah.gnu.org/cgit/config.git 20130831 + modify test/ncurses.c b/B tests to display lines only for the attributes which a given terminal supports, to make room for an italics test. + completed ncv table in terminfo.tail; it did not list the wide character codes listed in X/Open Curses issue 7. + add A_ITALIC extension (prompted by discussion with Egmont Koblinger). 20130824 + fix some gcc 4.8 -Wconversion warnings. + change format of dpkg test-scripts to quilted to work around bug introduced by Debian #700177. + discard cached keyname() values if meta() is changed after a value was cached using (report by Kurban Mallachiev). 20130816 + add checks in tic to warn about terminals which lack cursor addressing, capabilities or having those, are marked as hard_copy or generic_type. + use --without-progs in mingw-ncurses rpm. + split out _nc_init_termtype() from alloc_entry.c to use in MinGW port when tic and other programs are not needed. 20130805 + minor fixes to the --disable-overwrite logic, to ensure that the configured $(includedir) is not cancelled by the mingwxx-filesystem rpm macros. + add --disable-db-install configure option, to simplify building cross-compile support packages. + add mingw-ncurses.spec file, for testing cross-compiles. 20130727 + improve configure macros from ongoing work on cdk, dialog, xterm: + CF_ADD_LIB_AFTER - fix a problem with -Wl options + CF_RPATH_HACK - add missing result-message + CF_SHARED_OPTS - modify to use $rel_builddir in cygwin and mingw dll symbols (which can be overridden) rather than explicit "../". + CF_SHARED_OPTS - modify NetBSD and DragonFly symbols to use ${CC} rather than ${LD} to improve rpath support. + CF_SHARED_OPTS - add a symbol to denote the temporary files that are created by the macro, to simplify clean-rules. + CF_X_ATHENA - trim extra libraries to work with -Wl,--as-needed + fix a regression in hashed-database support for NetBSD, which uses the key-size differently from other implementations (cf: 20121229). 20130720 + further improvements for setupterm manpage, clarifying the initialization of cur_term. 20130713 + improve manpages for initscr and setupterm. + minor compiler-warning fixes 20130706 + add fallback defs for and (cf: 20120225). + add check for size of wchar_t, use that to suppress a chunk of wcwidth.h in MinGW port. + quiet linker warnings for MinGW cross-compile with dll's using the --enable-auto-import flag. + add ncurses.map rule to ncurses/Makefile to help diagnose symbol table issues. 20130622 + modify the clear program to take into account the E3 extended capability to clear the terminal's scrollback buffer (patch by Miroslav Lichvar, Redhat #815790). + clarify in resizeterm manpage that LINES and COLS are updated. + updated ansi example in terminfo.tail, correct misordered example of sgr. + fix other doclifter warnings for manpages + remove unnecessary ".ta" in terminfo.tail, add missing ".fi" (patch by Eric Raymond). 20130615 + minor changes to some configure macros to make them more reusable. + fixes for tabs program (prompted by report by Nick Andrik). + corrected logic in command-line parsing of -a and -c predefined tab-lists options. + allow "-0" and "-8" options to be combined with others, e.g.,"-0d". + make warning messages more consistent with the other utilities by not printing the full pathname of the program. + add -V option for consistency with other utilities. + fix off-by-one in columns for tabs program when processing an option such as "-5" (patch by Nick Andrik). 20130608 + add to test/demo_forms.c examples of using the menu-hooks as well as showing how the menu item user-data can be used to pass a callback function pointer. + add test/dots_termcap.c + remove setupterm call from test/demo_termcap.c + build-fix if --disable-ext-funcs configure option is used. + modified test/edit_field.c and test/demo_forms.c to move the lengths into a user-data structure, keeping the original string for later expansion to free-format input/out demo. + modified test/demo_forms.c to load data from file. + added note to clarify Terminal.app's non-emulation of the various terminal types listed in the preferences dialog -TD + fix regression in error-reporting in lib_setup.c (Debian #711134, cf: 20121117). + build-fix for a case where --enable-broken_linker and --enable-reentrant options are combined (report by George R Goffe). 20130525 + modify mvcur() to distinguish between internal use by the ncurses library, and external callers, preventing it from reading the content of the screen which is only nonblank when curses calls have updated it. This makes test/dots_mvcur.c avoid painting colored cells in the left margin of the display. + minor fix to test/dots_mvcur.c + move configured symbols USE_DATABASE and USE_TERMCAP to term.h as NCURSES_USE_DATABASE and NCURSES_USE_TERMCAP to allow consistent use of these symbols in term_entry.h 20130518 + corrected ifdefs in test/testcurs.c to allow comparison of mouse interface versus pdcurses (cf: 20130316). + add pow() to configure-check for math library, needed since 20121208 for test/hanoi (Debian #708056). + regenerated html manpages. + update doctype used for html documentation. 20130511 + move nsterm-related entries out of "obsolete" section to more plausible "ansi consoles" -TD + additional cleanup of table-of-contents by reordering -TD + revise fix for check for 8-bit value in _nc_insert_ch(); prior fix prevented inserts when video attributes were attached to the data (cf: 20121215) (Redhat #959534). 20130504 + fixes for issues found by Coverity: + correct FNKEY() macro in progs/dump_entry.c, allowing kf11-kf63 to display when infocmp's -R option is used for HP or AIX subsets. + fix dead-code issue with test/movewindow.c + improve limited-checking in _nc_read_termtype(). 20130427 + fix clang 3.2 warning in progs/dump_entry.c + drop AC_TYPE_SIGNAL check; ncurses relies on c89 and later. 20130413 + add MinGW to cases where ncurses installs by default into /usr (prompted by discussion with Daniel Silva Ferreira). + add -D option to infocmp's usage-message (patch by Miroslav Lichvar). + add a missing 'int' type for main function in configure check for type of bool variable, to work with clang 3.2 (report by Dmitri Gribenko). + improve configure check for static_cast, to work with clang 3.2 (report by Dmitri Gribenko). + re-order rule for demo.o and macros defining header dependencies in c++/Makefile.in to accommodate gmake (report by Dmitri Gribenko). 20130406 + improve parameter checking in copywin(). + modify configure script to work around OS X's "libtool" program, to choose glibtool instead. At the same time, chance the autoconf macro to look for a "tool" rather than a "prog", to help with potential use in cross-compiling. + separate the rpath usage for c++ library from demo program (Redhat #911540) + update/correct header-dependencies in c++ makefile (report by Werner Fink). + add --with-cxx-shared to dpkg-script, as done for rpm-script. 20130324 + build-fix for libtool configuration (reports by Daniel Silva Ferreira and Roumen Petrov). 20130323 + build-fix for OS X, to handle changes for --with-cxx-shared feature (report by Christian Ebert). + change initialization for vt220, similar entries for consistency with cursor-key strings (NetBSD #47674) -TD + further improvements to linux-16color (Benjamin Sittler) 20130316 + additional fix for tic.c, to allocate missing buffer space. + eliminate configure-script warnings for gen-pkgconfig.in + correct typo in sgr string for sun-color, add bold for consistency with sgr, change smso for consistency with sgr -TD + correct typo in sgr string for terminator -TD + add blink to the attributes masked by ncv in linux-16color (report by Benjamin Sittler) + improve warning message from post-load checking for missing "%?" operator by tic/infocmp by showing the entry name and capability. + minor formatting improvement to tic/infocmp -f option to ensure line split after "%;". + amend scripting for --with-cxx-shared option to handle the debug library "libncurses++_g.a" (report by Sven Joachim). 20130309 + amend change to toe.c for reading from /dev/zero, to ensure that there is a buffer for the temporary filename (cf: 20120324). + regenerated html manpages. + fix typo in terminfo.head (report by Sven Joachim, cf: 20130302). + updated some autoconf macros: + CF_ACVERSION_CHECK, from byacc 1.9 20130304 + CF_INTEL_COMPILER, CF_XOPEN_SOURCE from luit 2.0-20130217 + add configure option --with-cxx-shared to permit building libncurses++ as a shared library when using g++, e.g., the same limitations as libtool but better integrated with the usual build configuration (Redhat #911540). + modify MKkey_defs.sh to filter out build-path which was unnecessarily shown in curses.h (Debian #689131). 20130302 + add section to terminfo manpage discussing user-defined capabilities. + update manpage description of NCURSES_NO_SETBUF, explaining why it is obsolete. + add a check in waddch_nosync() to ensure that tab characters are treated as control characters; some broken locales claim they are printable. + add some traces to the Windows console driver. + initialize a temporary array in _nc_mbtowc, needed for some cases of raw input in MinGW port. 20130218 + correct ifdef on change to lib_twait.c (report by Werner Fink). + update config.guess, config.sub 20130216 + modify test/testcurs.c to work with mouse for ncurses as it does for pdcurses. + modify test/knight.c to work with mouse for pdcurses as it does for ncurses. + modify internal recursion in wgetch() which handles cooked mode to check if the call to wgetnstr() returned an error. This can happen when both nocbreak() and nodelay() are set, for instance (report by Nils Christopher Brause) (cf: 960418). + fixes for issues found by Coverity: + add a check for valid position in ClearToEOS() + fix in lib_twait.c when --enable-wgetch-events is used, pointer use after free. + improve a limit-check in make_hash.c + fix a memory leak in hashed_db.c 20130209 + modify test/configure script to make it simpler to override names of curses-related libraries, to help with linking with pdcurses in MinGW environment. + if the --with-terminfo-dirs configure option is not used, there is no corresponding compiled-in value for that. Fill in "no default value" for that part of the manpage substitution. 20130202 + correct initialization in knight.c which let it occasionally make an incorrect move (cf: 20001028). + improve documentation of the terminfo/termcap search path. 20130126 + further fixes to mvcur to pass callback function (cf: 20130112), needed to make test/dots_mvcur work. + reduce calls to SetConsoleActiveScreenBuffer in win_driver.c, to help reduce flicker. + modify configure script to omit "+b" from linker options for very old HP-UX systems (report by Dennis Grevenstein) + add HP-UX workaround for missing EILSEQ on old HP-UX systems (patch by Dennis Grevenstein). + restore memmove/strdup support for antique systems (request by Dennis Grevenstein). + change %l behavior in tparm to push the string length onto the stack rather than saving the formatted length into the output buffer (report by Roy Marples, cf: 980620). 20130119 + fixes for issues found by Coverity: + fix memory leak in safe_sprintf.c + add check for return-value in tty_update.c + correct initialization for -s option in test/view.c + add check for numeric overflow in lib_instr.c + improve error-checking in copywin + add advice in infocmp manpage for termcap users (Debian #698469). + add "-y" option to test/demo_termcap and test/demo_terminfo to demonstrate behavior with/without extended capabilities. + updated termcap manpage to document legacy termcap behavior for matching capability names. + modify name-comparison for tgetstr, etc., to accommodate legacy applications as well as to improve compatbility with BSD 4.2 termcap implementations (Debian #698299) (cf: 980725). 20130112 + correct prototype in manpage for vid_puts. + drop ncurses/tty/tty_display.h, ncurses/tty/tty_input.h, since they are unused in the current driver model. + modify mvcur to use stdout except when called within the ncurses library. + modify vidattr and vid_attr to use stdout as documented in manpage. + amend changes made to buffering in 20120825 so that the low-level putp() call uses stdout rather than ncurses' internal buffering. The putp_sp() call does the same, for consistency (Redhat #892674). 20130105 + add "-s" option to test/view.c to allow it to start in single-step mode, reducing size of trace files when it is used for debugging MinGW changes. + revert part of 20121222 change to tinfo_driver.c + add experimental logic in win_driver.c to improve optimization of screen updates. This does not yet work with double-width characters, so it is ifdef'd out for the moment (prompted by report by Erwin Waterlander regarding screen flicker). 20121229 + fix coverity warnings regarding copying into fixed-size buffers. + add throw-declarations in the c++ binding per Coverity warning. + minor changes to new-items for consistent reference to bug-report numbers. 20121222 + add *.dSYM directories to clean-rule in ncurses directory makefile, for Mac OS builds. + add a configure check for gcc option -no-cpp-precomp, which is not available in all Mac OS X configurations (report by Andras Salamon, cf: 20011208). + improve 20021221 workaround for broken acs, handling a case where that ACS_xxx character is not in the acsc string but there is a known wide-character which can be used. 20121215 + fix several warnings from clang 3.1 --analyze, includes correcting a null-pointer check in _nc_mvcur_resume. + correct display of double-width characters with MinGW port (report by Erwin Waterlander). + replace MinGW's wcrtomb(), fixing a problem with _nc_viscbuf > fixes based on Coverity report: + correct coloring in test/bs.c + correct check for 8-bit value in _nc_insert_ch(). + remove dead code in progs/tset.c, test/linedata.h + add null-pointer checks in lib_tracemse.c, panel.priv.h, and some test-programs. 20121208 + modify test/knight.c to show the number of choices possible for each position in automove option, e.g., to allow user to follow Warnsdorff's rule to solve the puzzle. + modify test/hanoi.c to show the minimum number of moves possible for the given number of tiles (prompted by patch by Lucas Gioia). > fixes based on Coverity report: + remove a few redundant checks. + correct logic in test/bs.c, when randomly placing a specific type of ship. + check return value from remove/unlink in tic. + check return value from sscanf in test/ncurses.c + fix a null dereference in c++/cursesw.cc + fix two instances of uninitialized variables when configuring for the terminal driver. + correct scope of variable used in SetSafeOutcWrapper macro. + set umask when calling mkstemp in tic. + initialize wbkgrndset() temporary variable when extended-colors are used. 20121201 + also replace MinGW's wctomb(), fixing a problem with setcchar(). + modify test/view.c to load UTF-8 when built with MinGW by using regular win32 API because the MinGW functions mblen() and mbtowc() do not work. 20121124 + correct order of color initialization versus display in some of the test-programs, e.g., test_addstr.c > fixes based on Coverity report: + delete windows on exit from some of the test-programs. 20121117 > fixes based on Coverity report: + add missing braces around FreeAndNull in two places. + various fixes in test/ncurses.c + improve limit-checks in tinfo/make_hash.c, tinfo/read_entry.c + correct malloc size in progs/infocmp.c + guard against negative array indices in test/knight.c + fix off-by-one limit check in test/color_name.h + add null-pointer check in progs/tabs.c, test/bs.c, test/demo_forms.c, test/inchs.c + fix memory-leak in tinfo/lib_setup.c, progs/toe.c, test/clip_printw.c, test/demo_menus.c + delete unused windows in test/chgat.c, test/clip_printw.c, test/insdelln.c, test/newdemo.c on error-return. 20121110 + modify configure macro CF_INCLUDE_DIRS to put $CPPFLAGS after the local -I include options in case someone has set conflicting -I options in $CPPFLAGS (prompted by patch for ncurses/Makefile.in by Vassili Courzakis). + modify the ncurses*-config scripts to eliminate relative paths from the RPATH_LIST variable, e.g., "../lib" as used in installing shared libraries or executables. 20121102 + realign these related pages: curs_add_wchstr.3x curs_addchstr.3x curs_addstr.3x curs_addwstr.3x and fix a long-ago error in curs_addstr.3x which said that a -1 length parameter would only write as much as fit onto one line (report by Reuben Thomas). + remove obsolete fallback _nc_memmove() for memmove()/bcopy(). + remove obsolete fallback _nc_strdup() for strdup(). + cancel any debug-rpm in package/ncurses.spec + reviewed vte-2012, reverted most of the change since it was incorrect based on testing with tack -TD + un-cancel the initc in vte-256color, since this was implemented starting with version 0.20 in 2009 -TD 20121026 + improve malloc/realloc checking (prompted by discussion in Redhat #866989). + add ncurses test-program as "ncurses6" to the rpm- and dpkg-scripts. + updated configure macros CF_GCC_VERSION and CF_WITH_PATHLIST. The first corrects pattern used for Mac OS X's customization of gcc. 20121017 + fix change to _nc_scroll_optimize(), which incorrectly freed memory (Redhat #866989). 20121013 + add vte-2012, gnome-2012, making these the defaults for vte/gnome (patch by Christian Persch). 20121006 + improve CF_GCC_VERSION to work around Debian's customization of gcc --version message. + improve configure macros as done in byacc: + drop 2.13 compatibility; use 2.52.xxxx version only since EMX port has used that for a while. + add 3rd parameter to AC_DEFINE's to allow autoheader to run, i.e., for experimental use. + remove unused configure macros. + modify configure script and makefiles to quiet new autoconf warning for LIBS_TO_MAKE variable. + modify configure script to show $PATH_SEPARATOR variable. + update config.guess, config.sub 20120922 + modify setupterm to set its copy of TERM to "unknown" if configured for the terminal driver and TERM was null or empty. + modify treatment of TERM variable for MinGW port to allow explicit use of the windows console driver by checking if $TERM is set to "#win32con" or an abbreviation of that. + undo recent change to fallback definition of vsscanf() to build with older Solaris compilers (cf: 20120728). 20120908 + add test-screens to test/ncurses to show 256-characters at a time, to help with MinGW port. 20120903 + simplify varargs logic in lib_printw.c; va_copy is no longer needed there. + modifications for MinGW port to make wide-character display usable. 20120902 + regenerate configure script (report by Sven Joachim, cf: 20120901). 20120901 + add a null-pointer check in _nc_flush (cf: 20120825). + fix a case in _nc_scroll_optimize() where the _oldnums_list array might not be allocated. + improve comparisons in configure.in for unset shell variables. 20120826 + increase size of ncurses' output-buffer, in case of very small initial screen-sizes. + fix evaluation of TERMINFO and TERMINFO_DIRS default values as needed after changes to use --datarootdir (reports by Gabriele Balducci, Roumen Petrov). 20120825 + change output buffering scheme, using buffer maintained by ncurses rather than stdio, to avoid problems with SIGTSTP handling (report by Brian Bloniarz). 20120811 + update autoconf patch to 2.52.20120811, adding --datarootdir (prompted by discussion with Erwin Waterlander). + improve description of --enable-reentrant option in README and the INSTALL file. + add nsterm-256color, make this the default nsterm -TD + remove bw from nsterm-bce, per testing with tack -TD 20120804 + update test/configure, adding check for tinfo library. + improve limit-checks for the getch fifo (report by Werner Fink). + fix a remaining mismatch between $with_echo and the symbols updated for CF_DISABLE_ECHO affecting parameters for mk-2nd.awk (report by Sven Joachim, cf: 20120317). + modify followup check for pkg-config's library directory in the --enable-pc-files option to validate syntax (report by Sven Joachim, cf: 20110716). 20120728 + correct path for ncurses_mingw.h in include/headers, in case build is done outside source-tree (patch by Roumen Petrov). + modify some older xterm entries to align with xterm source -TD + separate "xterm-old" alias from "xterm-r6" -TD + add E3 extended capability to xterm-basic and putty -TD + parenthesize parameters of other macros in curses.h -TD + parenthesize parameter of COLOR_PAIR and PAIR_NUMBER in curses.h in case it happens to be a comma-expression, etc. (patch by Nick Black). 20120721 + improved form_request_by_name() and menu_request_by_name(). + eliminate two fixed-size buffers in toe.c + extend use_tioctl() to have expected behavior when use_env(FALSE) and use_tioctl(TRUE) are called. + modify ncurses test-program, adding -E and -T options to demonstrate use_env() versus use_tioctl(). 20120714 + add use_tioctl() function (adapted from patch by Werner Fink, Novell #769788): 20120707 + add ncurses_mingw.h to installed headers (prompted by patch by Juergen Pfeifer). + clarify return-codes from wgetch() in response to SIGWINCH (prompted by Novell #769788). + modify resizeterm() to always push a KEY_RESIZE onto the fifo, even if screensize is unchanged. Modify _nc_update_screensize() to push a KEY_RESIZE if there was a SIGWINCH, even if it does not call resizeterm(). These changes eliminate the case where a SIGWINCH is received, but ERR returned from wgetch or wgetnstr because the screen dimensions did not change (Novell #769788). 20120630 + add --enable-interop to sample package scripts (suggested by Juergen Pfeifer). + update CF_PATH_SYNTAX macro, from mawk changes. + modify mk-0th.awk to allow for generating llib-ltic, etc., though some work is needed on cproto to work with lib_gen.c to update llib-lncurses. + remove redundant getenv() cal in database-iterator leftover from cleanup in 20120622 changes (report by Sven Joachim). 20120622 + add -d, -e and -q options to test/demo_terminfo and test/demo_termcap + fix caching of environment variables in database-iterator (patch by Philippe Troin, Redhat #831366). 20120616 + add configure check to distinguish clang from gcc to eliminate warnings about unused command-line parameters when compiler warnings are enabled. + improve behavior when updating terminfo entries which are hardlinked by allowing for the possibility that an alias has been repurposed to a new primary name. + fix some strict compiler warnings based on package scripts. + further fixes for configure check for working poll (Debian #676461). 20120608 + fix an uninitialized variable in -c/-n logic for infocmp changes (cf: 20120526). + corrected fix for building c++ binding with clang 3.0 (report/patch by Richard Yao, Gentoo #417613, cf: 20110409) + correct configure check for working poll, fixing the case where stdin is redirected, e.g., in rpm/dpkg builds (Debian #676461). + add rpm- and dpkg-scripts, to test those build-environments. The resulting packages are used only for testing. 20120602 + add kdch1 aka "Remove" to vt220 and vt220-8 entries -TD + add kdch1, etc., to qvt108 -TD + add dl1/il1 to some entries based on dl/il values -TD + add dl to simpleterm -TD + add consistency-checks in tic for insert-line vs delete-line controls, and insert/delete-char keys + correct no-leaks logic in infocmp when doing comparisons, fixing duplicate free of entries given via the command-line, and freeing entries loaded from the last-but-one of files specified on the command-line. + add kdch1 to wsvt25 entry from NetBSD CVS (reported by David Lord, analysis by Martin Husemann). + add cnorm/civis to wsvt25 entry from NetBSD CVS (report/analysis by Onno van der Linden). 20120526 + extend -c and -n options of infocmp to allow comparing more than two entries. + correct check in infocmp for number of terminal names when more than two are given. + correct typo in curs_threads.3x (report by Yanhui Shen on freebsd-hackers mailing list). 20120512 + corrected 'op' for bterm (report by Samuel Thibault) -TD + modify test/background.c to demonstrate a background character holding a colored ACS_HLINE. The behavior differs from SVr4 due to the thick- and double-line extension (cf: 20091003). + modify handling of acs characters in PutAttrChar to avoid mapping an unmapped character to a space with A_ALTCHARSET set. + rewrite vt520 entry based on vt420 -TD 20120505 + remove p6 (bold) from opus3n1+ for consistency -TD + remove acs stuff from env230 per clues in Ingres termcap -TD + modify env230 sgr/sgr0 to match other capabilities -TD + modify smacs/rmacs in bq300-8 to match sgr/sgr0 -TD + make sgr for dku7202 agree with other caps -TD + make sgr for ibmpc agree with other caps -TD + make sgr for tek4107 agree with other caps -TD + make sgr for ndr9500 agree with other caps -TD + make sgr for sco-ansi agree with other caps -TD + make sgr for d410 agree with other caps -TD + make sgr for d210 agree with other caps -TD + make sgr for d470c, d470c-7b agree with other caps -TD + remove redundant AC_DEFINE for NDEBUG versus Makefile definition. + fix a back-link in _nc_delink_entry(), which is needed if ncurses is configured with --enable-termcap and --disable-getcap. 20120428 + fix some inconsistencies between vt320/vt420, e.g., cnorm/civis -TD + add eslok flag to dec+sl -TD + dec+sl applies to vt320 and up -TD + drop wsl width from xterm+sl -TD + reuse xterm+sl in putty and nsca-m -TD + add ansi+tabs to vt520 -TD + add ansi+enq to vt220-vt520 -TD + fix a compiler warning in example in ncurses-intro.doc (Paul Waring). + added paragraph in keyname manpage telling how extended capabilities are interpreted as key definitions. + modify tic's check of conflicting key definitions to include extended capability strings in addition to the existing check on predefined keys. 20120421 + improve cleanup of temporary files in tic using atexit(). + add msgr to vt420, similar DEC vtXXX entries -TD + add several missing vt420 capabilities from vt220 -TD + factor out ansi+pp from several entries -TD + change xterm+sl and xterm+sl-twm to include only the status-line capabilities and not "use=xterm", making them more generally useful as building-blocks -TD + add dec+sl building block, as example -TD 20120414 + add XT to some terminfo entries to improve usefulness for other applications than screen, which would like to pretend that xterm's title is a status-line. -TD + change use-clauses in ansi-mtabs, hp2626, and hp2622 based on review of ordering and overrides -TD + add consistency check in tic for screen's "XT" capability. + add section in terminfo.src summarizing the user-defined capabilities used in that file -TD 20120407 + fix an inconsistency between tic/infocmp "-x" option; tic omits all non-standard capabilities, while infocmp was ignoring only the user definable capabilities. + improve special case in tic parsing of description to allow it to be followed by terminfo capabilities. Previously the description had to be the last field on an input line to allow tic to distinguish between termcap and terminfo format while still allowing commas to be embedded in the description. + correct variable name in gen_edit.sh which broke configurability of the --with-xterm-kbs option. + revert 2011-07-16 change to "linux" alias, return to "linux2.2" -TD + further amend 20110910 change, providing for configure-script override of the "linux" terminfo entry to install and changing the default for that to "linux2.2" (Debian #665959). 20120331 + update Ada95/configure to use CF_DISABLE_ECHO (cf: 20120317). + correct order of use-clauses in st-256color -TD + modify configure script to look for gnatgcc if the Ada95 binding is built, in preference to the default gcc/cc (suggested by Nicolas Boulenguez). + modify configure script to ensure that the same -On option used for the C compiler in CFLAGS is used for ADAFLAGS rather than simply using "-O3" (suggested by Nicolas Boulenguez) 20120324 + amend an old fix so that next_char() exits properly for empty files, e.g., from reading /dev/null (cf: 20080804). + modify tic so that it can read from the standard input, or from a character device. Because tic uses seek's, this requires writing the data to a temporary file first (prompted by remark by Sven Joachim) (cf: 20000923). 20120317 + correct a check made in lib_napms.c, so that terminfo applications can again use napms() (cf: 20110604). + add a note in tic.h regarding required casts for ABSENT_BOOLEAN (cf: 20040327). + correct scripting for --disable-echo option in test/configure. + amend check for missing c++ compiler to work when no error is reported, and no variables set (cf: 20021206). + add/use configure macro CF_DISABLE_ECHO. 20120310 + fix some strict compiler warnings for abi6 and 64-bits. + use begin_va_copy/end_va_copy macros in lib_printw.c (cf: 20120303). + improve a limit-check in infocmp.c (Werner Fink): 20120303 + minor tidying of terminfo.tail, clarify reason for limitation regarding mapping of \0 to \200 + minor improvement to _nc_copy_termtype(), using memcpy to replace loops. + fix no-leaks checking in test/demo_termcap.c to account for multiple calls to setupterm(). + modified the libgpm change to show previous load as a problem in the debug-trace. > merge some patches from OpenSUSE rpm (Werner Fink): + ncurses-5.7-printw.dif, fixes for varargs handling in lib_printw.c + ncurses-5.7-gpm.dif, do not dlopen libgpm if already loaded by runtime linker + ncurses-5.6-fallback.dif, do not free arrays and strings from static fallback entries 20120228 + fix breakage in tic/infocmp from 20120225 (report by Werner Fink). 20120225 + modify configure script to allow creating dll's for MinGW when cross-compiling. + add --enable-string-hacks option to control whether strlcat and strlcpy may be used. The same issue applies to OpenBSD's warnings about snprintf, noting that this function is weakly standardized. + add configure checks for strlcat, strlcpy and snprintf, to help reduce bogus warnings with OpenBSD builds. + build-fix for OpenBSD 4.9 to supply consistent intptr_t declaration (cf:20111231) + update config.guess, config.sub 20120218 + correct CF_ETIP_DEFINES configure macro, making it exit properly on the first success (patch by Pierre Labastie). + improve configure macro CF_MKSTEMP by moving existence-check for mkstemp out of the AC_TRY_RUN, to help with cross-compiles. + improve configure macro CF_FUNC_POLL from luit changes to detect broken implementations, e.g., with Mac OS X. + add configure option --with-tparm-arg + build-fix for MinGW cross-compiling, so that make_hash does not depend on TTY definition (cf: 20111008). 20120211 + make sgr for xterm-pcolor agree with other caps -TD + make sgr for att5425 agree with other caps -TD + make sgr for att630 agree with other caps -TD + make sgr for linux entries agree with other caps -TD + make sgr for tvi9065 agree with other caps -TD + make sgr for ncr260vt200an agree with other caps -TD + make sgr for ncr160vt100pp agree with other caps -TD + make sgr for ncr260vt300an agree with other caps -TD + make sgr for aaa-60-dec-rv, aaa+dec agree with other caps -TD + make sgr for cygwin, cygwinDBG agree with other caps -TD + add configure option --with-xterm-kbs to simplify configuration for Linux versus most other systems. 20120204 + improved tic -D option, avoid making target directory and provide better diagnostics. 20120128 + add mach-gnu (Debian #614316, patch by Samuel Thibault) + add mach-gnu-color, tweaks to mach-gnu terminfo -TD + make sgr for sun-color agree with smso -TD + make sgr for prism9 agree with other caps -TD + make sgr for icl6404 agree with other caps -TD + make sgr for ofcons agree with other caps -TD + make sgr for att5410v1, att4415, att620 agree with other caps -TD + make sgr for aaa-unk, aaa-rv agree with other caps -TD + make sgr for avt-ns agree with other caps -TD + amend fix intended to separate fixups for acsc to allow "tic -cv" to give verbose warnings (cf: 20110730). + modify misc/gen-edit.sh to make the location of the tabset directory consistent with misc/Makefile.in, i.e., using ${datadir}/tabset (Debian #653435, patch by Sven Joachim). 20120121 + add --with-lib-prefix option to allow configuring for old/new flavors of OS/2 EMX. + modify check for gnat version to allow for year, as used in FreeBSD port. + modify check_existence() in db_iterator.c to simply check if the path is a directory or file, according to the need. Checking for directory size also gives no usable result with OS/2 (cf: 20120107). + support OS/2 kLIBC (patch by KO Myung-Hun). 20120114 + several improvements to test/movewindow.c (prompted by discussion on Linux Mint forum): + modify movement commands to make them continuous + rewrote the test for mvderwin + rewrote the test for recursive mvwin + split-out reusable CF_WITH_NCURSES_ETC macro in test/configure.in + updated configure macro CF_XOPEN_SOURCE, build-fixes for Mac OS X and OpenBSD. + regenerated html manpages. 20120107 + various improvments for MinGW (Juergen Pfeifer): + modify stat() calls to ignore the st_size member + drop mk-dlls.sh script. + change recommended regular expression library. + modify rain.c to allow for threaded configuraton. + modify tset.c to allow for case when size-change logic is not used. 20111231 + modify toe's report when -a and -s options are combined, to add a column showing which entries belong to a given database. + add -s option to toe, to sort its output. + modify progs/toe.c, simplifying use of db-iterator results to use caching improvements from 20111001 and 20111126. + correct generation of pc-files when ticlib or termlib options are given to rename the corresponding tic- or tinfo-libraries (report by Sven Joachim). 20111224 + document a portability issue with tput, i.e., that scripts which work with ncurses may fail in other implementations that do no parameter analysis. + add putty-sco entry -TD 20111217 + review/fix places in manpages where --program-prefix configure option was not being used. + add -D option to infocmp, to show the database locations that it could use. + fix build for the special case where term-driver, ticlib and termlib are all enabled. The terminal driver depends on a few features in the base ncurses library, so tic's dependencies include both ncurses and termlib. + fix build work for term-driver when --enable-wgetch-events option is enabled. + use types to fix some questionable casts to void*. 20111210 + modify configure script to check if thread library provides pthread_mutexattr_settype(), e.g., not provided by Solaris 2.6 + modify configure script to suppress check to define _XOPEN_SOURCE for IRIX64, since its header files have a conflict versus _SGI_SOURCE. + modify configure script to add ".pc" files for tic- and tinfo-libraries, which were omitted in recent change (cf: 20111126). + fix inconsistent checks on $PKG_CONFIG variable in configure script. 20111203 + modify configure-check for etip.h dependencies, supplying a temporary copy of ncurses_dll.h since it is a generated file (prompted by Debian #646977). + modify CF_CPP_PARAM_INIT "main" function to work with current C++. 20111126 + correct database iterator's check for duplicate entries (cf: 20111001). + modify database iterator to ignore $TERMCAP when it is not an absolute pathname. + add -D option to tic, to show the database locations that it could use. + improve description of database locations in tic manpage. + modify the configure script to generate a list of the ".pc" files to generate, rather than deriving the list from the libraries which have been built (patch by Mike Frysinger). + use AC_CHECK_TOOLS in preference to AC_PATH_PROGS when searching for ncurses*-config, e.g., in Ada95/configure and test/configure (adapted from patch by Mike Frysinger). 20111119 + remove obsolete/conflicting fallback definition for _POSIX_SOURCE from curses.priv.h, fixing a regression with IRIX64 and Tru64 (cf: 20110416) + modify _nc_tic_dir() to ensure that its return-value is nonnull, i.e., the database iterator was not initialized. This case is needed to when tic is translating to termcap, rather than loading the database (cf: 20111001). 20111112 + add pccon entries for OpenBSD console (Alexei Malinin). + build-fix for OpenBSD 4.9 with gcc 4.2.1, setting _XOPEN_SOURCE to 600 to work around inconsistent ifdef'ing of wcstof between C and C++ header files. + modify capconvert script to accept more than exact match on "xterm", e.g., the "xterm-*" variants, to exclude from the conversion (patch by Robert Millan). + add -lc_r as alternative for -lpthread, allows build of threaded code in older FreeBSD machines. + build-fix for MirBSD, which fails when either _XOPEN_SOURCE or _POSIX_SOURCE are defined. + fix a typo misc/Makefile.in, used in uninstalling pc-files. 20111030 + modify make_db_path() to allow creating "terminfo.db" in the same directory as an existing "terminfo" directory. This fixes a case where switching between hashed/filesystem databases would cause the new hashed database to be installed in the next best location - root's home directory. + add variable cf_cv_prog_gnat_correct to those passed to config.status, fixing a problem with Ada95 builds (cf: 20111022). + change feature test from _XPG5 to _XOPEN_SOURCE in two places, to accommodate broken implementations for _XPG6. + eliminate usage of NULL symbol from etip.h, to reduce header interdependencies. + add configure check to decide when to add _XOPEN_SOURCE define to compiler options, i.e., for Solaris 10 and later (cf: 20100403). This is a workaround for gcc 4.6, which fails to build the c++ binding if that symbol is defined by the application, due to incorrectly combining the corresponding feature test macros (report by Peter Kruse). 20111022 + correct logic for discarding mouse events, retaining the partial events used to build up click, double-click, etc, until needed (cf: 20110917). + fix configure script to avoid creating unused Ada95 makefile when gnat does not work. + cleanup width-related gcc 3.4.3 warnings for 64-bit platform, for the internal functions of libncurses. The external interface of courses uses bool, which still produces these warnings. 20111015 + improve description of --disable-tic-depends option to make it clear that it may be useful whether or not the --with-termlib option is also given (report by Sven Joachim). + amend termcap equivalent for set_pglen_inch to use the X/Open "YI" rather than the obsolete Solaris 2.5 "sL" (cf: 990109). + improve manpage for tgetent differences from termcap library. 20111008 + moved static data from db_iterator.c to lib_data.c + modify db_iterator.c for memory-leak checking, fix one leak. + modify misc/gen-pkgconfig.in to use Requires.private for the parts of ncurses rather than Requires, as well as Libs.private for the other library dependencies (prompted by Debian #644728). 20111001 + modify tic "-K" option to only set the strict-flag rather than force source-output. That allows the same flag to control the parser for input and output of termcap source. + modify _nc_getent() to ignore backslash at the end of a comment line, making it consistent with ncurses' parser. + restore a special-case check for directory needed to make termcap text files load as if they were databases (cf: 20110924). + modify tic's resolution/collision checking to attempt to remove the conflicting alias from the second entry in the pair, which is normally following in the source file. Also improved the warning message to make it simpler to see which alias is the problem. + improve performance of the database iterator by caching search-list. 20110925 + add a missing "else" in changes to _nc_read_tic_entry(). 20110924 + modify _nc_read_tic_entry() so that hashed-database is checked before filesystem. + updated CF_CURSES_LIBS check in test/configure script. + modify configure script and makefiles to split TIC_ARGS and TINFO_ARGS into pieces corresponding to LDFLAGS and LIBS variables, to help separate searches for tic- and tinfo-libraries (patch by Nick Alcock aka "Nix"). + build-fix for lib_mouse.c changes (cf: 20110917). 20110917 + fix compiler warning for clang 2.9 + improve merging of mouse events (integrated patch by Damien Guibouret). + correct mask-check used in lib_mouse for wheel mouse buttons 4/5 (patch by Damien Guibouret). 20110910 + modify misc/gen_edit.sh to select a "linux" entry which works with the current kernel rather than assuming it is always "linux3.0" (cf: 20110716). + revert a change to getmouse() which had the undesirable side-effect of suppressing button-release events (report by Damien Guibouret, cf: 20100102). + add xterm+kbs fragment from xterm #272 -TD + add configure option --with-pkg-config-libdir to provide control over the actual directory into which pc-files are installed, do not use the pkg-config environment variables (discussion with Frederic L W Meunier). + add link to mailing-list archive in announce.html.in, as done in FAQ (prompted by question by Andrius Bentkus). + improve manpage install by adjusting the "#include" examples to show the ncurses-subdirectory used when --disable-overwrite option is used. + install an alias for "curses" to the ncurses manpage, tied to the --with-curses-h configure option (suggested by Reuben Thomas). 20110903 + propagate error-returns from wresize, i.e., the internal increase_size and decrease_size functions through resize_term (report by Tim van der Molen, cf: 20020713). + fix typo in tset manpage (patch by Sven Joachim). 20110820 + add a check to ensure that termcap files which might have "^?" do not use the terminfo interpretation as "\177". + minor cleanup of X-terminal emulator section of terminfo.src -TD + add terminator entry -TD + add simpleterm entry -TD + improve wattr_get macros by ensuring that if the window pointer is null, then the attribute and color values returned will be zero (cf: 20110528). 20110813 + add substitution for $RPATH_LIST to misc/ncurses-config.in + improve performance of tic with hashed-database by caching the database connection, using atexit() to cleanup. + modify treatment of 2-character aliases at the beginning of termcap entries so they are not counted in use-resolution, since these are guaranteed to be unique. Also ignore these aliases when reporting the primary name of the entry (cf: 20040501) + double-check gn (generic) flag in terminal descriptions to accommodate old/buggy termcap databases which misused that feature. + minor fixes to _nc_tgetent(), ensure buffer is initialized even on error-return. 20110807 + improve rpath fix from 20110730 by ensuring that the new $RPATH_LIST variable is defined in the makefiles which use it. + build-fix for DragonFlyBSD's pkgsrc in test/configure script. + build-fixes for NetBSD 5.1 with termcap support enabled. + corrected k9 in dg460-ansi, add other features based on manuals -TD + improve trimming of whitespace at the end of terminfo/termcap output from tic/infocmp. + when writing termcap source, ensure that colons in the description field are translated to a non-delimiter, i.e., "=". + add "-0" option to tic/infocmp, to make the termcap/terminfo source use a single line. + add a null-pointer check when handling the $CC variable. 20110730 + modify configure script and makefiles in c++ and progs to allow the directory used for rpath option to be overridden, e.g., to work around updates to the variables used by tic during an install. + add -K option to tic/infocmp, to provide stricter BSD-compatibility for termcap output. + add _nc_strict_bsd variable in tic library which controls the "strict" BSD termcap compatibility from 20110723, plus these features: + allow escapes such as "\8" and "\9" when reading termcap + disallow "\a", "\e", "\l", "\s" and "\:" escapes when reading termcap files, passing through "a", "e", etc. + expand "\:" as "\072" on output. + modify _nc_get_token() to reset the token's string value in case there is a string-typed token lacking the "=" marker. + fix a few memory leaks in _nc_tgetent. + fix a few places where reading from a termcap file could refer to freed memory. + add an overflow check when converting terminfo/termcap numeric values, since terminfo stores those in a short, and they must be positive. + correct internal variables used for translating to termcap "%>" feature, and translating from termcap %B to terminfo, needed by tctest (cf: 19991211). + amend a minor fix to acsc when loading a termcap file to separate it from warnings needed for tic (cf: 20040710) + modify logic in _nc_read_entry() and _nc_read_tic_entry() to allow a termcap file to be handled via TERMINFO_DIRS. + modify _nc_infotocap() to include non-mandatory padding when translating to termcap. + modify _nc_read_termcap_entry(), passing a flag in the case where getcap is used, to reduce interactive warning messages. 20110723 + add a check in start_color() to limit color-pairs to 256 when extended colors are not supported (patch by David Benjamin). + modify setcchar to omit no-longer-needed OR'ing of color pair in the SetAttr() macro (patch by David Benjamin). + add kich1 to sun terminfo entry (Yuri Pankov) + use bold rather than reverse for smso in sun-color terminfo entry (Yuri Pankov). + improve generation of termcap using tic/infocmp -C option, e.g., to correspond with 4.2BSD (prompted by discussion with Yuri Pankov regarding Schilling's test program): + translate %02 and %03 to %2 and %3 respectively. + suppress string capabilities which use %s, not supported by tgoto + use \040 rather than \s + expand null characters as \200 rather than \0 + modify configure script to support shared libraries for DragonFlyBSD. 20110716 + replace an assert() in _nc_Free_Argument() with a regular null pointer check (report/analysis by Franjo Ivancic). + modify configure --enable-pc-files option to take into account the PKG_CONFIG_PATH variable (report by Frederic L W Meunier). + add/use xterm+tmux chunk from xterm #271 -TD + resync xterm-new entry from xterm #271 -TD + add E3 extended capability to linux-basic (Miroslav Lichvar) + add linux2.2, linux2.6, linux3.0 entries to give context for E3 -TD + add SI/SO change to linux2.6 entry (Debian #515609) -TD + fix inconsistent tabset path in pcmw (Todd C. Miller). + remove a backslash which continued comment, obscuring altos3 definition with OpenBSD toolset (Nicholas Marriott). 20110702 + add workaround from xterm #271 changes to ensure that compiler flags are not used in the $CC variable. + improve support for shared libraries, tested with AIX 5.3, 6.1 and 7.1 with both gcc 4.2.4 and cc. + modify configure checks for AIX to include release 7.x + add loader flags/libraries to libtool options so that dynamic loading works properly, adapted from ncurses-5.7-ldflags-with-libtool.patch at gentoo prefix repository (patch by Michael Haubenwallner). 20110626 + move include of nc_termios.h out of term_entry.h, since the latter is installed, e.g., for tack while the former is not (report by Sven Joachim). 20110625 + improve cleanup() function in lib_tstp.c, using _exit() rather than exit() and checking for SIGTERM rather than SIGQUIT (prompted by comments forwarded by Nicholas Marriott). + reduce name pollution from term.h, moving fallback #define's for tcgetattr(), etc., to new private header nc_termios.h (report by Sergio NNX). + two minor fixes for tracing (patch by Vassili Courzakis). + improve trace initialization by starting it in use_env() and ripoffline(). + review old email, add details for some changelog entries. 20110611 + update minix entry to minix 3.2 (Thomas Cort). + fix a strict compiler warning in change to wattr_get (cf: 20110528). 20110604 + fixes for MirBSD port: + set default prefix to /usr. + add support for shared libraries in configure script. + use S_ISREG and S_ISDIR consistently, with fallback definitions. + add a few more checks based on ncurses/link_test. + modify MKlib_gen.sh to handle sp-funcs renaming of NCURSES_OUTC type. 20110528 + add case to CF_SHARED_OPTS for Interix (patch by Markus Duft). + used ncurses/link_test to check for behavior when the terminal has not been initialized and when an application passes null pointers to the library. Added checks to cover this (prompted by Redhat #707344). + modify MKlib_gen.sh to make its main() function call each function with zero parameters, to help find inconsistent checking for null pointers, etc. 20110521 + fix warnings from clang 2.7 "--analyze" 20110514 + compiler-warning fixes in panel and progs. + modify CF_PKG_CONFIG macro, from changes to tin -TD + modify CF_CURSES_FUNCS configure macro, used in test directory configure script: + work around (non-optimizer) bug in gcc 4.2.1 which caused test-expression to be omitted from executable. + force the linker to see a link-time expression of a symbol, to help work around weak-symbol issues. 20110507 + update discussion of MKfallback.sh script in INSTALL; normally the script is used automatically via the configured makefiles. However there are still occasions when it might be used directly by packagers (report by Gunter Schaffler). + modify misc/ncurses-config.in to omit the "-L" option from the "--libs" output if the library directory is /usr/lib. + change order of tests for curses.h versus ncurses.h headers in the configure scripts for Ada95 and test-directories, to look for ncurses.h, from fixes to tin -TD + modify ncurses/tinfo/access.c to account for Tandem's root uid (report by Joachim Schmitz). 20110430 + modify rules in Ada95/src/Makefile.in to ensure that the PIC option is not used when building a static library (report by Nicolas Boulenguez): + Ada95 build-fix for big-endian architectures such as sparc. This undoes one of the fixes from 20110319, which added an "Unused" member to representation clauses, replacing that with pragmas to suppress warnings about unused bits (patch by Nicolas Boulenguez). 20110423 + add check in test/configure for use_window, use_screen. + add configure-checks for getopt's variables, which may be declared as different types on some Unix systems. + add check in test/configure for some legacy curses types of the function pointer passed to tputs(). + modify init_pair() to accept -1's for color value after assume_default_colors() has been called (Debian #337095). + modify test/background.c, adding commmand-line options to demonstrate assume_default_colors() and use_default_colors(). 20110416 + modify configure script/source-code to only define _POSIX_SOURCE if the checks for sigaction and/or termios fail, and if _POSIX_C_SOURCE and _XOPEN_SOURCE are undefined (report by Valentin Ochs). + update config.guess, config.sub 20110409 + fixes to build c++ binding with clang 3.0 (patch by Alexander Kolesen). + add check for unctrl.h in test/configure, to work around breakage in some ncurses packages. + add "--disable-widec" option to test/configure script. + add "--with-curses-colr" and "--with-curses-5lib" options to the test/configure script to address testing with very old machines. 20110404 5.9 release for upload to ftp.gnu.org 20110402 + various build-fixes for the rpm/dpkg scripts. + add "--enable-rpath-link" option to Ada95/configure, to allow packages to suppress the rpath feature which is normally used for the in-tree build of sample programs. + corrected definition of libdir variable in Ada95/src/Makefile.in, needed for rpm script. + add "--with-shared" option to Ada95/configure script, to allow making the C-language parts of the binding use appropriate compiler options if building a shared library with gnat. 20110329 > portability fixes for Ada95 binding: + add configure check to ensure that SIGINT works with gnat. This is needed for the "rain" sample program. If SIGINT does not work, omit that sample program. + correct typo in check of $PKG_CONFIG variable in Ada95/configure + add ncurses_compat.c, to supply functions used in the Ada95 binding which were added in 5.7 and later. + modify sed expression in CF_NCURSES_ADDON to eliminate a dependency upon GNU sed. 20110326 + add special check in Ada95/configure script for ncurses6 reentrant code. + regen Ada html documentation. + build-fix for Ada shared libraries versus the varargs workaround. + add rpm and dpkg scripts for Ada95 and test directories, for test builds. + update test/configure macros CF_CURSES_LIBS, CF_XOPEN_SOURCE and CF_X_ATHENA_LIBS. + add configure check to determine if gnat's project feature supports libraries, i.e., collections of .ali files. + make all dereferences in Ada95 samples explicit. + fix typo in comment in lib_add_wch.c (patch by Petr Pavlu). + add configure check for, ifdef's for math.h which is in a separate package on Solaris and potentially not installed (report by Petr Pavlu). > fixes for Ada95 binding (Nicolas Boulenguez): + improve type-checking in Ada95 by eliminating a few warning-suppress pragmas. + suppress unreferenced warnings. + make all dereferences in binding explicit. 20110319 + regen Ada html documentation. + change order of -I options from ncurses*-config script when the --disable-overwrite option was used, so that the subdirectory include is listed first. + modify the make-tar.sh scripts to add a MANIFEST and NEWS file. + modify configure script to provide value for HTML_DIR in Ada95/gen/Makefile.in, which depends on whether the Ada95 binding is distributed separately (report by Nicolas Boulenguez). + modify configure script to add "-g" and/or "-O3" to ADAFLAGS if the CFLAGS for the build has these options. + amend change from 20070324, to not add 1 to the result of getmaxx and getmaxy in the Ada binding (report by Nicolas Boulenguez for thread in comp.lang.ada). + build-fix Ada95/samples for gnat 4.5 + spelling fixes for Ada95/samples/explain.txt > fixes for Ada95 binding (Nicolas Boulenguez): + add item in Trace_Attribute_Set corresponding to TRACE_ATTRS. + add workaround for binding to set_field_type(), which uses varargs. The original binding from 990220 relied on the prevalent implementation of varargs which did not support or need va_copy(). + add dependency on gen/Makefile.in needed for *-panels.ads + add Library_Options to library.gpr + add Languages to library.gpr, for gprbuild 20110307 + revert changes to limit-checks from 20110122 (Debian #616711). > minor type-cleanup of Ada95 binding (Nicolas Boulenguez): + corrected a minor sign error in a field of Low_Level_Field_Type, to conform to form.h. + replaced C_Int by Curses_Bool as return type for some callbacks, see fieldtype(3FORM). + modify samples/sample-explain.adb to provide explicit message when explain.txt is not found. 20110305 + improve makefiles for Ada95 tree (patch by Nicolas Boulenguez). + fix an off-by-one error in _nc_slk_initialize() from 20100605 fixes for compiler warnings (report by Nicolas Boulenguez). + modify Ada95/gen/gen.c to declare unused bits in generated layouts, needed to compile when chtype is 64-bits using gnat 4.4.5 20110226 5.8 release for upload to ftp.gnu.org 20110226 + update release notes, for 5.8. + regenerated html manpages. + change open() in _nc_read_file_entry() to fopen() for consistency with write_file(). + modify misc/run_tic.in to create parent directory, in case this is a new install of hashed database. + fix typo in Ada95/mk-1st.awk which causes error with original awk. 20110220 + configure script rpath fixes from xterm #269. + workaround for cygwin's non-functional features.h, to force ncurses' configure script to define _XOPEN_SOURCE_EXTENDED when building wide-character configuration. + build-fix in run_tic.sh for OS/2 EMX install + add cons25-debian entry (patch by Brian M Carlson, Debian #607662). 20110212 + regenerated html manpages. + use _tracef() in show_where() function of tic, to work correctly with special case of trace configuration. 20110205 + add xterm-utf8 entry as a demo of the U8 feature -TD + add U8 feature to denote entries for terminal emulators which do not support VT100 SI/SO when processing UTF-8 encoding -TD + improve the NCURSES_NO_UTF8_ACS feature by adding a check for an extended terminfo capability U8 (prompted by mailing list discussion). 20110122 + start documenting interface changes for upcoming 5.8 release. + correct limit-checks in derwin(). + correct limit-checks in newwin(), to ensure that windows have nonzero size (report by Garrett Cooper). + fix a missing "weak" declaration for pthread_kill (patch by Nicholas Alcock). + improve documentation of KEY_ENTER in curs_getch.3x manpage (prompted by discussion with Kevin Martin). 20110115 + modify Ada95/configure script to make the --with-curses-dir option work without requiring the --with-ncurses option. + modify test programs to allow them to be built with NetBSD curses. + document thick- and double-line symbols in curs_add_wch.3x manpage. + document WACS_xxx constants in curs_add_wch.3x manpage. + fix some warnings for clang 2.6 "--analyze" + modify Ada95 makefiles to make html-documentation with the project file configuration if that is used. + update config.guess, config.sub 20110108 + regenerated html manpages. + minor fixes to enable lint when trace is not enabled, e.g., with clang --analyze. + fix typo in man/default_colors.3x (patch by Tim van der Molen). + update ncurses/llib-lncurses* 20110101 + fix remaining strict compiler warnings in ncurses library ABI=5, except those dealing with function pointers, etc. 20101225 + modify nc_tparm.h, adding guards against repeated inclusion, and allowing TPARM_ARG to be overridden. + fix some strict compiler warnings in ncurses library. 20101211 + suppress ncv in screen entry, allowing underline (patch by Alejandro R Sedeno). + also suppress ncv in konsole-base -TD + fixes in wins_nwstr() and related functions to ensure that special characters, i.e., control characters are handled properly with the wide-character configuration. + correct a comparison in wins_nwstr() (Redhat #661506). + correct help-messages in some of the test-programs, which still referred to quitting with 'q'. 20101204 + add special case to _nc_infotocap() to recognize the setaf/setab strings from xterm+256color and xterm+88color, and provide a reduced version which works with termcap. + remove obsolete emacs "Local Variables" section from documentation (request by Sven Joachim). + update doc/html/index.html to include NCURSES-Programming-HOWTO.html (report by Sven Joachim). 20101128 + modify test/configure and test/Makefile.in to handle this special case of building within a build-tree (Debian #34182): mkdir -p build && cd build && ../test/configure && make 20101127 + miscellaneous build-fixes for Ada95 and test-directories when built out-of-tree. + use VPATH in makefiles to simplify out-of-tree builds (Debian #34182). + fix typo in rmso for tek4106 entry -Goran Weinholt 20101120 + improve checks in test/configure for X libraries, from xterm #267 changes. + modify test/configure to allow it to use the build-tree's libraries e.g., when using that to configure the test-programs without the rpath feature (request by Sven Joachim). + repurpose "gnome" terminfo entries as "vte", retaining "gnome" items for compatibility, but generally deprecating those since the VTE library is what actually defines the behavior of "gnome", etc., since 2003 -TD 20101113 + compiler warning fixes for test programs. + various build-fixes for test-programs with pdcurses. + updated configure checks for X packages in test/configure from xterm #267 changes. + add configure check to gnatmake, to accommodate cygwin. 20101106 + correct list of sub-directories needed in Ada95 tree for building as a separate package. + modify scripts in test-directory to improve builds as a separate package. 20101023 + correct parsing of relative tab-stops in tabs program (report by Philip Ganchev). + adjust configure script so that "t" is not added to library suffix when weak-symbols are used, allowing the pthread configuration to more closely match the non-thread naming (report by Werner Fink). + modify configure check for tic program, used for fallbacks, to a warning if not found. This makes it simpler to use additonal scripts to bootstrap the fallbacks code using tic from the build tree (report by Werner Fink). + fix several places in configure script using ${variable-value} form. + modify configure macro CF_LDFLAGS_STATIC to accommodate some loaders which do not support selectively linking against static libraries (report by John P. Hartmann) + fix an unescaped dash in man/tset.1 (report by Sven Joachim). 20101009 + correct comparison used for setting 16-colors in linux-16color entry (Novell #644831) -TD + improve linux-16color entry, using "dim" for color-8 which makes it gray rather than black like color-0 -TD + drop misc/ncu-indent and misc/jpf-indent; they are provided by an external package "cindent". 20101002 + improve linkages in html manpages, adding references to the newer pages, e.g., *_variables, curs_sp_funcs, curs_threads. + add checks in tic for inconsistent cursor-movement controls, and for inconsistent printer-controls. + fill in no-parameter forms of cursor-movement where a parameterized form is available -TD + fill in missing cursor controls where the form of the controls is ANSI -TD + fix inconsistent punctuation in form_variables manpage (patch by Sven Joachim). + add parameterized cursor-controls to linux-basic (report by Dae) -TD > patch by Juergen Pfeifer: + document how to build 32-bit libraries in README.MinGW + fixes to filename computation in mk-dlls.sh.in + use POSIX locale in mk-dlls.sh.in rather than en_US (report by Sven Joachim). + add a check in mk-dlls.sh.in to obtain the size of a pointer to distinguish between 32-bit and 64-bit hosts. The result is stored in mingw_arch 20100925 + add "XT" capability to entries for terminals that support both xterm-style mouse- and title-controls, for "screen" which special-cases TERM beginning with "xterm" or "rxvt" -TD > patch by Juergen Pfeifer: + use 64-Bit MinGW toolchain (recommended package from TDM, see README.MinGW). + support pthreads when using the TDM MinGW toolchain 20100918 + regenerated html manpages. + minor fixes for symlinks to curs_legacy.3x and curs_slk.3x manpages. + add manpage for sp-funcs. + add sp-funcs to test/listused.sh, for documentation aids. 20100911 + add manpages for summarizing public variables of curses-, terminfo- and form-libraries. + minor fixes to manpages for consistency (patch by Jason McIntyre). + modify tic's -I/-C dump to reformat acsc strings into canonical form (sorted, unique mapping) (cf: 971004). + add configure check for pthread_kill(), needed for some old platforms. 20100904 + add configure option --without-tests, to suppress building test programs (request by Frederic L W Meunier). 20100828 + modify nsterm, xnuppc and tek4115 to make sgr/sgr0 consistent -TD + add check in terminfo source-reader to provide more informative message when someone attempts to run tic on a compiled terminal description (prompted by Debian #593920). + note in infotocap and captoinfo manpages that they read terminal descriptions from text-files (Debian #593920). + improve acsc string for vt52, show arrow keys (patch by Benjamin Sittler). 20100814 + document in manpages that "mv" functions first use wmove() to check the window pointer and whether the position lies within the window (suggested by Poul-Henning Kamp). + fixes to curs_color.3x, curs_kernel.3x and wresize.3x manpages (patch by Tim van der Molen). + modify configure script to transform library names for tic- and tinfo-libraries so that those build properly with Mac OS X shared library configuration. + modify configure script to ensure that it removes conftest.dSYM directory leftover on checks with Mac OS X. + modify configure script to cleanup after check for symbolic links. 20100807 + correct a typo in mk-1st.awk (patch by Gabriele Balducci) (cf: 20100724) + improve configure checks for location of tic and infocmp programs used for installing database and for generating fallback data, e.g., for cross-compiling. + add Markus Kuhn's wcwidth function for compiling MinGW + add special case to CF_REGEX for cross-compiling to MinGW target. 20100731 + modify initialization check for win32con driver to eliminate need for special case for TERM "unknown", using terminal database if available (prompted by discussion with Roumen Petrov). + for MinGW port, ensure that terminal driver is setup if tgetent() is called (patch by Roumen Petrov). + document tabs "-0" and "-8" options in manpage. + fix Debian "lintian" issues with manpages reported in http://lintian.debian.org/full/csmall@debian.org.html#ncurses 20100724 + add a check in tic for missing set_tab if clear_all_tabs given. + improve use of symbolic links in makefiles by using "-f" option if it is supported, to eliminate temporary removal of the target (prompted by http://www.t2-project.org/packages/ncurses.html) + minor improvement to test/ncurses.c, reset color pairs in 'd' test after exit from 'm' main-menu command. + improved ncu-indent, from mawk changes, allows more than one of GCC_NORETURN, GCC_PRINTFLIKE and GCC_SCANFLIKE on a single line. 20100717 + add hard-reset for rs2 to wsvt25 to help ensure that reset ends the alternate character set (patch by Nicholas Marriott) + remove tar-copy.sh and related configure/Makefile chunks, since the Ada95 binding is now installed using rules in Ada95/src. 20100703 + continue integrating changes to use gnatmake project files in Ada95 + add/use configure check to turn on project rules for Ada95/src. + revert the vfork change from 20100130, since it does not work. 20100626 + continue integrating changes to use gnatmake project files in Ada95 + old gnatmake (3.15) does not produce libraries using project-file; work around by adding script to generate alternate makefile. 20100619 + continue integrating changes to use gnatmake project files in Ada95 + add configure --with-ada-sharedlib option, for the test_make rule. + move Ada95-related logic into aclocal.m4, since additional checks will be needed to distinguish old/new implementations of gnat. 20100612 + start integrating changes to use gnatmake project files in Ada95 tree + add test_make / test_clean / test_install rules in Ada95/src + change install-path for adainclude directory to /usr/share/ada (was /usr/lib/ada). + update Ada95/configure. + add mlterm+256color entry, for mlterm 3.0.0 -TD + modify test/configure to use macros to ensure consistent order of updating LIBS variable. 20100605 + change search order of options for Solaris in CF_SHARED_OPTS, to work with 64-bit compiles. + correct quoting of assignment in CF_SHARED_OPTS case for aix (cf: 20081227) 20100529 + regenerated html documentation. + modify test/configure to support pkg-config for checking X libraries used by PDCurses. + add/use configure macro CF_ADD_LIB to force consistency of assignments to $LIBS, etc. + fix configure script for combining --with-pthread and --enable-weak-symbols options. 20100522 + correct cross-compiling configure check for CF_MKSTEMP macro, by adding a check cache variable set by AC_CHECK_FUNC (report by Pierre Labastie). + simplify include-dependencies of make_hash and make_keys, to reduce the need for setting BUILD_CPPFLAGS in cross-compiling when the build- and target-machines differ. + repair broken-linker configuration by restoring a definition of SP variable to curses.priv.h, and adjusting for cases where sp-funcs are used. + improve configure macro CF_AR_FLAGS, allowing ARFLAGS environment variable to override (prompted by report by Pablo Cazallas). 20100515 + add configure option --enable-pthreads-eintr to control whether the new EINTR feature is enabled. + modify logic in pthread configuration to allow EINTR to interrupt a read operation in wgetch() (Novell #540571, patch by Werner Fink). + drop mkdirs.sh, use "mkdir -p". + add configure option --disable-libtool-version, to use the "-version-number" feature which was added in libtool 1.5 (report by Peter Haering). The default value for the option uses the newer feature, which makes libraries generated using libtool compatible with the standard builds of ncurses. + updated test/configure to match configure script macros. + fixes for configure script from lynx changes: + improve CF_FIND_LINKAGE logic for the case where a function is found in predefined libraries. + revert part of change to CF_HEADER (cf: 20100424) 20100501 + correct limit-check in wredrawln, accounting for begy/begx values (patch by David Benjamin). + fix most compiler warnings from clang. + amend build-fix for OpenSolaris, to ensure that a system header is included in curses.h before testing feature symbols, since they may be defined by that route. 20100424 + fix some strict compiler warnings in ncurses library. + modify configure macro CF_HEADER_PATH to not look for variations in the predefined include directories. + improve configure macros CF_GCC_VERSION and CF_GCC_WARNINGS to work with gcc 4.x's c89 alias, which gives warning messages for cases where older versions would produce an error. 20100417 + modify _nc_capcmp() to work with cancelled strings. + correct translation of "^" in _nc_infotocap(), used to transform terminfo to termcap strings + add configure --disable-rpath-hack, to allow disabling the feature which adds rpath options for libraries in unusual places. + improve CF_RPATH_HACK_2 by checking if the rpath option for a given directory was already added. + improve CF_RPATH_HACK_2 by using ldd to provide a standard list of directories (which will be ignored). 20100410 + improve win_driver.c handling of mouse: + discard motion events + avoid calling _nc_timed_wait when there is a mouse event + handle 4th and "rightmost" buttons. + quote substitutions in CF_RPATH_HACK_2 configure macro, needed for cases where there are embedded blanks in the rpath option. 20100403 + add configure check for exctags vs ctags, to work around pkgsrc. + simplify logic in _nc_get_screensize() to make it easier to see how environment variables may override system- and terminfo-values (prompted by discussion with Igor Bujna). + make debug-traces for COLOR_PAIR and PAIR_NUMBER less verbose. + improve handling of color-pairs embedded in attributes for the extended-colors configuration. + modify MKlib_gen.sh to build link_test with sp-funcs. + build-fixes for OpenSolaris aka Solaris 11, for wide-character configuration as well as for rpath feature in *-config scripts. 20100327 + refactor CF_SHARED_OPTS configure macro, making CF_RPATH_HACK more reusable. + improve configure CF_REGEX, similar fixes. + improve configure CF_FIND_LINKAGE, adding add check between system (default) and explicit paths, where we can find the entrypoint in the given library. + add check if Gpm_Open() returns a -2, e.g., for "xterm". This is normally suppressed but can be overridden using $NCURSES_GPM_TERMS. Ensure that Gpm_Close() is called in this case. 20100320 + rename atari and st52 terminfo entries to atari-old, st52-old, use newer entries from FreeMiNT by Guido Flohr (from patch/report by Alan Hourihane). 20100313 + modify install-rule for manpages so that *-config manpages will install when building with --srcdir (report by Sven Joachim). + modify CF_DISABLE_LEAKS configure macro so that the --enable-leaks option is not the same as --disable-leaks (GenToo #305889). + modify #define's for build-compiler to suppress cchar_t symbol from compile of make_hash and make_keys, improving cross-compilation of ncursesw (report by Bernhard Rosenkraenzer). + modify CF_MAN_PAGES configure macro to replace all occurrences of TPUT in tput.1's manpage (Debian #573597, report/analysis by Anders Kaseorg). 20100306 + generate manpages for the *-config scripts, adapted from help2man (suggested by Sven Joachim). + use va_copy() in _nc_printf_string() to avoid conflicting use of va_list value in _nc_printf_length() (report by Wim Lewis). 20100227 + add Ada95/configure script, to use in tar-file created by Ada95/make-tar.sh + fix typo in wresize.3x (patch by Tim van der Molen). + modify screen-bce.XXX entries to exclude ech, since screen's color model does not clear with color for that feature -TD 20100220 + add make-tar.sh scripts to Ada95 and test subdirectories to help with making those separately distributable. + build-fix for static libraries without dlsym (Debian #556378). + fix a syntax error in man/form_field_opts.3x (patch by Ingo Schwarze). 20100213 + add several screen-bce.XXX entries -TD 20100206 + update mrxvt terminfo entry -TD + modify win_driver.c to support mouse single-clicks. + correct name for termlib in ncurses*-config, e.g., if it is renamed to provide a single file for ncurses/ncursesw libraries (patch by Miroslav Lichvar). 20100130 + use vfork in test/ditto.c if available (request by Mike Frysinger). + miscellaneous cleanup of manpages. + fix typo in curs_bkgd.3x (patch by Tim van der Molen). + build-fix for --srcdir (patch by Miroslav Lichvar). 20100123 + for term-driver configuration, ensure that the driver pointer is initialized in setupterm so that terminfo/termcap programs work. + amend fix for Debian #542031 to ensure that wattrset() returns only OK or ERR, rather than the attribute value (report by Miroslav Lichvar). + reorder WINDOWLIST to put WINDOW data after SCREEN pointer, making _nc_screen_of() compatible between normal/wide libraries again (patch by Miroslav Lichvar) + review/fix include-dependencies in modules files (report by Miroslav Lichvar). 20100116 + modify win_driver.c to initialize acs_map for win32 console, so that line-drawing works. + modify win_driver.c to initialize TERMINAL struct so that programs such as test/lrtest.c and test/ncurses.c which test string capabilities can run. + modify term-driver modules to eliminate forward-reference declarations. 20100109 + modify configure macro CF_XOPEN_SOURCE, etc., to use CF_ADD_CFLAGS consistently to add new -D's while removing duplicates. + modify a few configure macros to consistently put new options before older in the list. + add tiparm(), based on review of X/Open Curses Issue 7. + minor documentation cleanup. + update config.guess, config.sub from http://savannah.gnu.org/projects/config (caveat - its maintainer put 2010 copyright date on files dated 2009) 20100102 + minor improvement to tic's checking of similar SGR's to allow for the most common case of SGR 0. + modify getmouse() to act as its documentation implied, returning on each call the preceding event until none are left. When no more events remain, it will return ERR. 20091227 + change order of lookup in progs/tput.c, looking for terminfo data first. This fixes a confusion between termcap "sg" and terminfo "sgr" or "sgr0", originally from 990123 changes, but exposed by 20091114 fixes for hashing. With this change, only "dl" and "ed" are ambiguous (Mandriva #56272). 20091226 + add bterm terminfo entry, based on bogl 0.1.18 -TD + minor fix to rxvt+pcfkeys terminfo entry -TD + build-fixes for Ada95 tree for gnat 4.4 "style". 20091219 + remove old check in mvderwin() which prevented moving a derived window whose origin happened to coincide with its parent's origin (report by Katarina Machalkova). + improve test/ncurses.c to put mouse droppings in the proper window. + update minix terminfo entry -TD + add bw (auto-left-margin) to nsterm* entries (Benjamin Sittler) 20091212 + correct transfer of multicolumn characters in multirow field_buffer(), which stopped at the end of the first row due to filling of unused entries in a cchar_t array with nulls. + updated nsterm* entries (Benjamin Sittler, Emanuele Giaquinta) + modify _nc_viscbuf2() and _tracecchar_t2() to show wide-character nulls. + use strdup() in set_menu_mark(), restore .marklen struct member on failure. + eliminate clause 3 from the UCB copyrights in read_termcap.c and tset.c per ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change (patch by Nicholas Marriott). + replace a malloc in tic.c with strdup, checking for failure (patch by Nicholas Marriott). + update config.guess, config.sub from http://savannah.gnu.org/projects/config 20091205 + correct layout of working window used to extract data in wide-character configured by set_field_buffer (patch by Rafael Garrido Fernandez) + improve some limit-checks related to filename length in reading and writing terminfo entries. + ensure that filename is always filled in when attempting to read a terminfo entry, so that infocmp can report the filename (patch by Nicholas Marriott). 20091128 + modify mk-1st.awk to allow tinfo library to be built when term-driver is enabled. + add error-check to configure script to ensure that sp-funcs is enabled if term-driver is, since some internal interfaces rely upon this. 20091121 + fix case where progs/tput is used while sp-funcs is configure; this requires save/restore of out-character function from _nc_prescreen rather than the SCREEN structure (report by Charles Wilson). + fix typo in man/curs_trace.3x which caused incorrect symbolic links + improved configure macros CF_GCC_ATTRIBUTES, CF_PROG_LINT. 20091114 + updated man/curs_trace.3x + limit hashing for termcap-names to 2-characters (Ubuntu #481740). + change a variable name in lib_newwin.c to make it clearer which value is being freed on error (patch by Nicholas Marriott). 20091107 + improve test/ncurses.c color-cycling test by reusing attribute- and color-cycling logic from the video-attributes screen. + add ifdef'd with NCURSES_INTEROP_FUNCS experimental bindings in form library which help make it compatible with interop applications (patch by Juergen Pfeifer). + add configure option --enable-interop, for integrating changes for generic/interop support to form-library by Juergen Pfeifer 20091031 + modify use of $CC environment variable which is defined by X/Open as a curses feature, to ignore it if it is not a single character (prompted by discussion with Benjamin C W Sittler). + add START_TRACE in slk_init + fix a regression in _nc_ripoffline which made test/ncurses.c not show soft-keys, broken in 20090927 merging. + change initialization of "hidden" flag for soft-keys from true to false, broken in 20090704 merging (Ubuntu #464274). + update nsterm entries (patch by Benjamin C W Sittler, prompted by discussion with Fabian Groffen in GenToo #206201). + add test/xterm-256color.dat 20091024 + quiet some pedantic gcc warnings. + modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a SIGWINCH, and discard that value, to avoid confusing application (patch by Eygene Ryabinkin, FreeBSD #136223). 20091017 + modify handling of $PKG_CONFIG_LIBDIR to use only the first item in a possibly colon-separated list (Debian #550716). 20091010 + supply a null-terminator to buffer in _nc_viswibuf(). + fix a sign-extension bug in unget_wch() (report by Mike Gran). + minor fixes to error-returns in default function for tputs, as well as in lib_screen.c 20091003 + add WACS_xxx definitions to wide-character configuration for thick- and double-lines (discussion with Slava Zanko). + remove unnecessary kcan assignment to ^C from putty (Sven Joachim) + add ccc and initc capabilities to xterm-16color -TD > patch by Benjamin C W Sittler: + add linux-16color + correct initc capability of linux-c-nc end-of-range + similar change for dg+ccc and dgunix+ccc 20090927 + move leak-checking for comp_captab.c into _nc_leaks_tinfo() since that module since 20090711 is in libtinfo. + add configure option --enable-term-driver, to allow compiling with terminal-driver. That is used in MinGW port, and (being somewhat more complicated) is an experimental alternative to the conventional termlib internals. Currently, it requires the sp-funcs feature to be enabled. + completed integrating "sp-funcs" by Juergen Pfeifer in ncurses library (some work remains for forms library). 20090919 + document return code from define_key (report by Mike Gran). + make some symbolic links in the terminfo directory-tree shorter (patch by Daniel Jacobowitz, forwarded by Sven Joachim).). + fix some groff warnings in terminfo.5, etc., from recent Debian changes. + change ncv and op capabilities in sun-color terminfo entry to match Sun's entry for this (report by Laszlo Peter). + improve interix smso terminfo capability by using reverse rather than bold (report by Kristof Zelechovski). 20090912 + add some test programs (and make these use the same special keys by sharing linedata.h functions): test/test_addstr.c test/test_addwstr.c test/test_addchstr.c test/test_add_wchstr.c + correct internal _nc_insert_ch() to use _nc_insert_wch() when inserting wide characters, since the wins_wch() function that it used did not update the cursor position (report by Ciprian Craciun). 20090906 + fix typo s/is_timeout/is_notimeout/ which made "man is_notimeout" not work. + add null-pointer checks to other opaque-functions. + add is_pad() and is_subwin() functions for opaque access to WINDOW (discussion with Mark Dickinson). + correct merge to lib_newterm.c, which broke when sp-funcs was enabled. 20090905 + build-fix for building outside source-tree (report by Sven Joachim). + fix Debian lintian warning for man/tabs.1 by making section number agree with file-suffix (report by Sven Joachim). + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). 20090829 + workaround for bug in g++ 4.1-4.4 warnings for wattrset() macro on amd64 (Debian #542031). + fix typo in curs_mouse.3x (Debian #429198). 20090822 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). 20090815 + correct use of terminfo capabilities for initializing soft-keys, broken in 20090510 merging. + modify wgetch() to ensure it checks SIGWINCH when it gets an error in non-blocking mode (patch by Clemens Ladisch). + use PATH_SEPARATOR symbol when substituting into run_tic.sh, to help with builds on non-Unix platforms such as OS/2 EMX. + modify scripting for misc/run_tic.sh to test configure script's $cross_compiling variable directly rather than comparing host/build compiler names (prompted by comment in GenToo #249363). + fix configure script option --with-database, which was coded as an enable-type switch. + build-fixes for --srcdir (report by Frederic L W Meunier). 20090808 + separate _nc_find_entry() and _nc_find_type_entry() from implementation details of hash function. 20090803 + add tabs.1 to man/man_db.renames + modify lib_addch.c to compensate for removal of wide-character test from unctrl() in 20090704 (Debian #539735). 20090801 + improve discussion in INSTALL for use of system's tic/infocmp for cross-compiling and building fallbacks. + modify test/demo_termcap.c to correspond better to options in test/demo_terminfo.c + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + fix logic for 'V' in test/ncurses.c tests f/F. 20090728 + correct logic in tigetnum(), which caused tput program to treat all string capabilities as numeric (report by Rajeev V Pillai, cf: 20090711). 20090725 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). 20090718 + fix a null-pointer check in _nc_format_slks() in lib_slk.c, from 20090704 changes. + modify _nc_find_type_entry() to use hashing. + make CCHARW_MAX value configurable, noting that changing this would change the size of cchar_t, and would be ABI-incompatible. + modify test-programs, e.g,. test/view.c, to address subtle differences between Tru64/Solaris and HPUX/AIX getcchar() return values. + modify length returned by getcchar() to count the trailing null which is documented in X/Open (cf: 20020427). + fixes for test programs to build/work on HPUX and AIX, etc. 20090711 + improve performance of tigetstr, etc., by using hashing code from tic. + minor fixes for memory-leak checking. + add test/demo_terminfo, for comparison with demo_termcap 20090704 + remove wide-character checks from unctrl() (patch by Clemens Ladisch). + revise wadd_wch() and wecho_wchar() to eliminate dependency on unctrl(). + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). 20090627 + update llib-lncurses[wt] to use sp-funcs. + various code-fixes to build/work with --disable-macros configure option. + add several new files from Juergen Pfeifer which will be used when integration of "sp-funcs" is complete. This includes a port to MinGW. 20090613 + move definition for NCURSES_WRAPPED_VAR back to ncurses_dll.h, to make includes of term.h without curses.h work (report by "Nix"). + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). 20090607 + fix a regression in lib_tputs.c, from ongoing merges. 20090606 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). 20090530 + fix an infinite recursion when adding a legacy-coding 8-bit value using insch() (report by Clemens Ladisch). + free home-terminfo string in del_curterm() (patch by Dan Weber). + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). 20090523 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). 20090516 + work around antique BSD game's manipulation of stdscr, etc., versus SCREEN's copy of the pointer (Debian #528411). + add a cast to wattrset macro to avoid compiler warning when comparing its result against ERR (adapted from patch by Matt Kraii, Debian #528374). 20090510 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). 20090502 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + add vwmterm terminfo entry (patch by Bryan Christ). 20090425 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). 20090419 + build fix for _nc_free_and_exit() change in 20090418 (report by Christian Ebert). 20090418 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). 20090411 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). This change finishes merging for menu and panel libraries, does part of the form library. 20090404 + suppress configure check for static/dynamic linker flags for gcc on Darwin (report by Nelson Beebe). 20090328 + extend ansi.sys pfkey capability from kf1-kf10 to kf1-kf48, moving function key definitions from emx-base for consistency -TD + correct missing final 'p' in pfkey capability of ansi.sys-old (report by Kalle Olavi Niemitalo). + improve test/ncurses.c 'F' test, show combining characters in color. + quiet a false report by cppcheck in c++/cursesw.cc by eliminating a temporary variable. + use _nc_doalloc() rather than realloc() in a few places in ncurses library to avoid leak in out-of-memory condition (reports by William Egert and Martin Ettl based on cppcheck tool). + add --with-ncurses-wrap-prefix option to test/configure (discussion with Charles Wilson). + use ncurses*-config scripts if available for test/configure. + update test/aclocal.m4 and test/configure > patches by Charles Wilson: + modify CF_WITH_LIBTOOL configure check to allow unreleased libtool version numbers (e.g. which include alphabetic chars, as well as digits, after the final '.'). + improve use of -no-undefined option for libtool by setting an intermediate variable LT_UNDEF in the configure script, and then using that in the libtool link-commands. + fix an missing use of NCURSES_PUBLIC_VAR() in tinfo/MKcodes.awk from 20090321 changes. + improve mk-1st.awk script by writing separate cases for the LIBTOOL_LINK command, depending on which library (ncurses, ticlib, termlib) is to be linked. + modify configure.in to allow broken-linker configurations, not just enable-reentrant, to set public wrap prefix. 20090321 + add TICS_LIST and SHLIB_LIST to allow libtool 2.2.6 on Cygwin to build with tic and term libraries (patch by Charles Wilson). + add -no-undefined option to libtool for Cygwin, MinGW, U/Win and AIX (report by Charles Wilson). + fix definition for c++/Makefile.in's SHLIB_LIST, which did not list the form, menu or panel libraries (patch by Charles Wilson). + add configure option --with-wrap-prefix to allow setting the prefix for functions used to wrap global variables to something other than "_nc_" (discussion with Charles Wilson). 20090314 + modify scripts to generate ncurses*-config and pc-files to add dependency for tinfo library (patch by Charles Wilson). + improve comparison of program-names when checking for linked flavors such as "reset" by ignoring the executable suffix (reports by Charles Wilson, Samuel Thibault and Cedric Bretaudeau on Cygwin mailing list). + suppress configure check for static/dynamic linker flags for gcc on Solaris 10, since gcc is confused by absence of static libc, and does not switch back to dynamic mode before finishing the libraries (reports by Joel Bertrand, Alan Pae). + minor fixes to Intel compiler warning checks in configure script. + modify _nc_leaks_tinfo() so leak-checking in test/railroad.c works. + modify set_curterm() to make broken-linker configuration work with changes from 20090228 (report by Charles Wilson). 20090228 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + modify declaration of cur_term when broken-linker is used, but enable-reentrant is not, to match pre-5.7 (report by Charles Wilson). 20090221 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). 20090214 + add configure script --enable-sp-funcs to enable the new set of extended functions. + start integrating patches by Juergen Pfeifer: + add extended functions which specify the SCREEN pointer for several curses functions which use the global SP (these are incomplete; some internals work is needed to complete these). + add special cases to configure script for MinGW port. 20090207 + update several configure macros from lynx changes + append (not prepend) to CFLAGS/CPPFLAGS + change variable from PATHSEP to PATH_SEPARATOR + improve install-rules for pc-files (patch by Miroslav Lichvar). + make it work with $DESTDIR + create the pkg-config library directory if needed. 20090124 + modify init_pair() to allow caller to create extra color pairs beyond the color_pairs limit, which use default colors (request by Emanuele Giaquinta). + add misc/terminfo.tmp and misc/*.pc to "sources" rule. + fix typo "==" where "=" is needed in ncurses-config.in and gen-pkgconfig.in files (Debian #512161). 20090117 + add -shared option to MK_SHARED_LIB when -Bsharable is used, for *BSD's, without which "main" might be one of the shared library's dependencies (report/analysis by Ken Dickey). + modify waddch_literal(), updating line-pointer after a multicolumn character is found to not fit on the current row, and wrapping is done. Since the line-pointer was not updated, the wrapped multicolumn character was written to the beginning of the current row (cf: 20041023, reported by "Nick" regarding problem with ncmpc http://musicpd.org/mantis/bug_view_page.php?bug_id=1930). 20090110 + add screen.Eterm terminfo entry (GenToo #124887) -TD + modify adacurses-config to look for ".ali" files in the adalib directory. + correct install for Ada95, which omitted libAdaCurses.a used in adacurses-config + change install for adacurses-config to provide additional flavors such as adacursesw-config, for ncursesw (GenToo #167849). 20090105 + remove undeveloped feature in ncurses-config.in for setting prefix variable. + recent change to ncurses-config.in did not take into account the --disable-overwrite option, which sets $includedir to the subdirectory and using just that for a -I option does not work - fix (report by Frederic L W Meunier). 20090104 + modify gen-pkgconfig.in to eliminate a dependency on rpath when deciding whether to add $LIBS to --libs output; that should be shown for the ncurses and tinfo libraries without taking rpath into account. + fix an overlooked change from $AR_OPTS to $ARFLAGS in mk-1st.awk, used in static libraries (report by Marty Jack). 20090103 + add a configure-time check to pick a suitable value for CC_SHARED_OPTS for Solaris (report by Dagobert Michelsen). + add configure --with-pkg-config and --enable-pc-files options, along with misc/gen-pkgconfig.in which can be used to generate ".pc" files for pkg-config (request by Jan Engelhardt). + use $includedir symbol in misc/ncurses-config.in, add --includedir option. + change makefiles to use $ARFLAGS rather than $AR_OPTS, provide a configure check to detect whether a "-" is needed before "ar" options. + update config.guess, config.sub from http://savannah.gnu.org/projects/config 20081227 + modify mk-1st.awk to work with extra categories for tinfo library. + modify configure script to allow building shared libraries with gcc on AIX 5 or 6 (adapted from patch by Lital Natan). 20081220 + modify to omit the opaque-functions from lib_gen.o when --disable-ext-funcs is used. + add test/clip_printw.c to illustrate how to use printw without wrapping. + modify ncurses 'F' test to demo wborder_set() with colored lines. + modify ncurses 'f' test to demo wborder() with colored lines. 20081213 + add check for failure to open hashed-database needed for db4.6 (GenToo #245370). + corrected --without-manpages option; previous change only suppressed the auxiliary rules install.man and uninstall.man + add case for FreeMINT to configure macro CF_XOPEN_SOURCE (patch from GenToo #250454). + fixes from NetBSD port at http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/ncurses/patches patch-ac (build-fix for DragonFly) patch-ae (use INSTALL_SCRIPT for installing misc/ncurses*-config). + improve configure script macros CF_HEADER_PATH and CF_LIBRARY_PATH by adding CFLAGS, CPPFLAGS and LDFLAGS, LIBS values to the search-lists. + correct title string for keybound manpage (patch by Frederic Culot, OpenBSD documentation/6019), 20081206 + move del_curterm() call from _nc_freeall() to _nc_leaks_tinfo() to work for progs/clear, progs/tabs, etc. + correct buffer-size after internal resizing of wide-character set_field_buffer(), broken in 20081018 changes (report by Mike Gran). + add "-i" option to test/filter.c to tell it to use initscr() rather than newterm(), to investigate report on comp.unix.programmer that ncurses would clear the screen in that case (it does not - the issue was xterm's alternate screen feature). + add check in mouse-driver to disable connection if GPM returns a zero, indicating that the connection is closed (Debian #506717, adapted from patch by Samuel Thibault). 20081129 + improve a workaround in adding wide-characters, when a control character is found. The library (cf: 20040207) uses unctrl() to obtain a printable version of the control character, but was not passing color or video attributes. + improve test/ncurses.c 'a' test, using unctrl() more consistently to display meta-characters. + turn on _XOPEN_CURSES definition in curses.h + add eterm-color entry (report by Vincent Lefevre) -TD + correct use of key_name() in test/ncurses.c 'A' test, which only displays wide-characters, not key-codes since 20070612 (report by Ricardo Cantu). 20081122 + change _nc_has_mouse() to has_mouse(), reflect its use in C++ and Ada95 (patch by Juergen Pfeifer). + document in TO-DO an issue with Cygwin's package for GNAT (report by Mike Dennison). + improve error-checking of command-line options in "tabs" program. 20081115 + change several terminfo entries to make consistent use of ANSI clear-all-tabs -TD + add "tabs" program (prompted by Debian #502260). + add configure --without-manpages option (request by Mike Frysinger). 20081102 5.7 release for upload to ftp.gnu.org 20081025 + add a manpage to discuss memory leaks. + add support for shared libraries for QNX (other than libtool, which does not work well on that platform). + build-fix for QNX C++ binding. 20081018 + build-fixes for OS/2 EMX. + modify form library to accept control characters such as newline in set_field_buffer(), which is compatible with Solaris (report by Nit Khair). + modify configure script to assume --without-hashed-db when --disable-database is used. + add "-e" option in ncurses/Makefile.in when generating source-files to force earlier exit if the build environment fails unexpectedly (prompted by patch by Adrian Bunk). + change configure script to use CF_UTF8_LIB, improved variant of CF_LIBUTF8. 20081012 + add teraterm4.59 terminfo entry, use that as primary teraterm entry, rename original to teraterm2.3 -TD + update "gnome" terminfo to 2.22.3 -TD + update "konsole" terminfo to 1.6.6, needs today's fix for tic -TD + add "aterm" terminfo -TD + add "linux2.6.26" terminfo -TD + add logic to tic for cancelling strings in user-defined capabilities, overlooked til now. 20081011 + regenerated html documentation. + add -m and -s options to test/keynames.c and test/key_names.c to test the meta() function with keyname() or key_name(), respectively. + correct return value of key_name() on error; it is null. + document some unresolved issues for rpath and pthreads in TO-DO. + fix a missing prototype for ioctl() on OpenBSD in tset.c + add configure option --disable-tic-depends to make explicit whether tic library depends on ncurses/ncursesw library, amends change from 20080823 (prompted by Debian #501421). 20081004 + some build-fixes for configure --disable-ext-funcs (incomplete, but works for C/C++ parts). + improve configure-check for awks unable to handle large strings, e.g. AIX 5.1 whose awk silently gives up on large printf's. 20080927 + fix build for --with-dmalloc by workaround for redefinition of strndup between string.h and dmalloc.h + fix build for --disable-sigwinch + add environment variable NCURSES_GPM_TERMS to allow override to use GPM on terminals other than "linux", etc. + disable GPM mouse support when $TERM does not happen to contain "linux", since Gpm_Open() no longer limits its assertion to terminals that it might handle, e.g., within "screen" in xterm. + reset mouse file-descriptor when unloading GPM library (report by Miroslav Lichvar). + fix build for --disable-leaks --enable-widec --with-termlib > patch by Juergen Pfeifer: + use improved initialization for soft-label keys in Ada95 sample code. + discard internal symbol _nc_slk_format (unused since 20080112). + move call of slk_paint_info() from _nc_slk_initialize() to slk_intern_refresh(), improving initialization. 20080925 + fix bug in mouse code for GPM from 20080920 changes (reported in Debian #500103, also Miroslav Lichvar). 20080920 + fix shared-library rules for cygwin with tic- and tinfo-libraries. + fix a memory leak when failure to connect to GPM. + correct check for notimeout() in wgetch() (report on linux.redhat newsgroup by FurtiveBertie). + add an example warning-suppression file for valgrind, misc/ncurses.supp (based on example from Reuben Thomas) 20080913 + change shared-library configuration for OpenBSD, make rpath work. + build-fixes for using libutf8, e.g., on OpenBSD 3.7 20080907 + corrected fix for --enable-weak-symbols (report by Frederic L W Meunier). 20080906 + corrected gcc options for building shared libraries on IRIX64. + add configure check for awk programs unable to handle big-strings, use that to improve the default for --enable-big-strings option. + makefile-fixes for --enable-weak-symbols (report by Frederic L W Meunier). + update test/configure script. + adapt ifdef's from library to make test/view.c build when mbrtowc() is unavailable, e.g., with HPUX 10.20. + add configure check for wcsrtombs, mbsrtowcs, which are used in test/ncurses.c, and use wcstombs, mbstowcs instead if available, fixing build of ncursew for HPUX 11.00 20080830 + fixes to make Ada95 demo_panels() example work. + modify Ada95 'rain' test program to accept keyboard commands like the C-version. + modify BeOS-specific ifdef's to build on Haiku (patch by Scott Mccreary). + add configure-check to see if the std namespace is legal for cerr and endl, to fix a build issue with Tru64. + consistently use NCURSES_BOOL in lib_gen.c + filter #line's from lib_gen.c + change delimiter in MKlib_gen.sh from '%' to '@', to avoid substitution by IBM xlc to '#' as part of its extensions to digraphs. + update config.guess, config.sub from http://savannah.gnu.org/projects/config (caveat - its maintainer removed support for older Linux systems). 20080823 + modify configure check for pthread library to work with OSF/1 5.1, which uses #define's to associate its header and library. + use pthread_mutexattr_init() for initializing pthread_mutexattr_t, makes threaded code work on HPUX 11.23 + fix a bug in demo_menus in freeing menus (cf: 20080804). + modify configure script for the case where tic library is used (and possibly renamed) to remove its dependency upon ncurses/ncursew library (patch by Dr Werner Fink). + correct manpage for menu_fore() which gave wrong default for the attribute used to display a selected entry (report by Mike Gran). + add Eterm-256color, Eterm-88color and rxvt-88color (prompted by Debian #495815) -TD 20080816 + add configure option --enable-weak-symbols to turn on new feature. + add configure-check for availability of weak symbols. + modify linkage with pthread library to use weak symbols so that applications not linked to that library will not use the mutexes, etc. This relies on gcc, and may be platform-specific (patch by Dr Werner Fink). + add note to INSTALL to document limitation of renaming of tic library using the --with-ticlib configure option (report by Dr Werner Fink). + document (in manpage) why tputs does not detect I/O errors (prompted by comments by Samuel Thibault). + fix remaining warnings from Klocwork report. 20080804 + modify _nc_panelhook() data to account for a permanent memory leak. + fix memory leaks in test/demo_menus + fix most warnings from Klocwork tool (report by Larry Zhou). + modify configure script CF_XOPEN_SOURCE macro to add case for "dragonfly" from xterm #236 changes. + modify configure script --with-hashed-db to let $LIBS override the search for the db library (prompted by report by Samson Pierre). 20080726 + build-fixes for gcc 4.3.1 (changes to gnat "warnings", and C inlining thresholds). 20080713 + build-fix (reports by Christian Ebert, Funda Wang). 20080712 + compiler-warning fixes for Solaris. 20080705 + use NCURSES_MOUSE_MASK() in definition of BUTTON_RELEASE(), etc., to make those work properly with the "--enable-ext-mouse" configuration (cf: 20050205). + improve documentation of build-cc options in INSTALL. + work-around a bug in gcc 4.2.4 on AIX, which does not pass the -static/-dynamic flags properly to linker, causing test/bs to not link. 20080628 + correct some ifdef's needed for the broken-linker configuration. + make debugging library's $BAUDRATE feature work for termcap interface. + make $NCURSES_NO_PADDING feature work for termcap interface (prompted by comment on FreeBSD mailing list). + add screen.mlterm terminfo entry -TD + improve mlterm and mlterm+pcfkeys terminfo entries -TD 20080621 + regenerated html documentation. + expand manpage description of parameters for form_driver() and menu_driver() (prompted by discussion with Adam Spragg). + add null-pointer checks for cur_term in baudrate() and def_shell_mode(), def_prog_mode() + fix some memory leaks in delscreen() and wide acs. 20080614 + modify test/ditto.c to illustrate multi-threaded use_screen(). + change CC_SHARED_OPTS from -KPIC to -xcode=pic32 for Solaris. + add "-shared" option to MK_SHARED_LIB for gcc on Solaris (report by Poor Yorick). 20080607 + finish changes to wgetch(), making it switch as needed to the window's actual screen when calling wrefresh() and wgetnstr(). That allows wgetch() to get used concurrently in different threads with some minor restrictions, e.g., the application should not delete a window which is being used in a wgetch(). + simplify mutex's, combining the window- and screen-mutex's. 20080531 + modify wgetch() to use the screen which corresponds to its window parameter rather than relying on SP; some dependent functions still use SP internally. + factor out most use of SP in lib_mouse.c, using parameter. + add internal _nc_keyname(), replacing keyname() to associate with a particular SCREEN rather than the global SP. + add internal _nc_unctrl(), replacing unctrl() to associate with a particular SCREEN rather than the global SP. + add internal _nc_tracemouse(), replacing _tracemouse() to eliminate its associated global buffer _nc_globals.tracemse_buf now in SCREEN. + add internal _nc_tracechar(), replacing _tracechar() to use SCREEN in preference to the global _nc_globals.tracechr_buf buffer. 20080524 + modify _nc_keypad() to make it switch temporarily as needed to the screen which must be updated. + wrap cur_term variable to help make _nc_keymap() thread-safe, and always set the screen's copy of this variable in set_curterm(). + restore curs_set() state after endwin()/refresh() (report/patch Miroslav Lichvar) 20080517 + modify configure script to note that --enable-ext-colors and --enable-ext-mouse are not experimental, but extensions from the ncurses ABI 5. + corrected manpage description of setcchar() (discussion with Emanuele Giaquinta). + fix for adding a non-spacing character at the beginning of a line (report/patch by Miroslav Lichvar). 20080503 + modify screen.* terminfo entries using new screen+fkeys to fix overridden keys in screen.rxvt (Debian #478094) -TD + modify internal interfaces to reduce wgetch()'s dependency on the global SP. + simplify some loops with macros each_screen(), each_window() and each_ripoff(). 20080426 + continue modifying test/ditto.c toward making it demonstrate multithreaded use_screen(), using fifos to pass data between screens. + fix typo in form.3x (report by Mike Gran). 20080419 + add screen.rxvt terminfo entry -TD + modify tic -f option to format spaces as \s to prevent them from being lost when that is read back in unformatted strings. + improve test/ditto.c, using a "talk"-style layout. 20080412 + change test/ditto.c to use openpty() and xterm. + add locks for copywin(), dupwin(), overlap(), overlay() on their window parameters. + add locks for initscr() and newterm() on updates to the SCREEN pointer. + finish table in curs_thread.3x manpage. 20080405 + begin table in curs_thread.3x manpage describing the scope of data used by each function (or symbol) for threading analysis. + add null-pointer checks to setsyx() and getsyx() (prompted by discussion by Martin v. Lowis and Jeroen Ruigrok van der Werven on python-dev2 mailing list). 20080329 + add null-pointer checks in set_term() and delscreen(). + move _nc_windows into _nc_globals, since windows can be pads, which are not associated with a particular screen. + change use_screen() to pass the SCREEN* parameter rather than stdscr to the callback function. + force libtool to use tag for 'CC' in case it does not detect this, e.g., on aix when using CC=powerpc-ibm-aix5.3.0.0-gcc (report/patch by Michael Haubenwallner). + override OBJEXT to "lo" when building with libtool, to work on platforms such as AIX where libtool may use a different suffix for the object files than ".o" (report/patch by Michael Haubenwallner). + add configure --with-pthread option, for building with the POSIX thread library. 20080322 + fill in extended-color pair two more places in wbkgrndset() and waddch_nosync() (prompted by Sedeno's patch). + fill in extended-color pair in _nc_build_wch() to make colors work for wide-characters using extended-colors (patch by Alejandro R Sedeno). + add x/X toggles to ncurses.c C color test to test/demo wide-characters with extended-colors. + add a/A toggles to ncurses.c c/C color tests. + modify test/ditto.c to use use_screen(). + finish modifying test/rain.c to demonstrate threads. 20080308 + start modifying test/rain.c for threading demo. + modify test/ncurses.c to make 'f' test accept the f/F/b/F/ toggles that the 'F' accepts. + modify test/worm.c to show trail in reverse-video when other threads are working concurrently. + fix a deadlock from improper nesting of mutexes for windowlist and window. 20080301 + fixes from 20080223 resolved issue with mutexes; change to use recursive mutexes to fix memory leak in delwin() as called from _nc_free_and_exit(). 20080223 + fix a size-difference in _nc_globals which caused hanging of mutex lock/unlock when termlib was built separately. 20080216 + avoid using nanosleep() in threaded configuration since that often is implemented to suspend the entire process. 20080209 + update test programs to build/work with various UNIX curses for comparisons. This was to reinvestigate statement in X/Open curses that insnstr and winsnstr perform wrapping. None of the Unix-branded implementations do this, as noted in manpage (cf: 20040228). 20080203 + modify _nc_setupscreen() to set the legacy-coding value the same for both narrow/wide models. It had been set only for wide model, but is needed to make unctrl() work with locale in the narrow model. + improve waddch() and winsch() handling of EILSEQ from mbrtowc() by using unctrl() to display illegal bytes rather than trying to append further bytes to make up a valid sequence (reported by Andrey A Chernov). + modify unctrl() to check codes in 128-255 range versus isprint(). If they are not printable, and locale was set, use a "M-" or "~" sequence. 20080126 + improve threading in test/worm.c (wrap refresh calls, and KEY_RESIZE handling). Now it hangs in napms(), no matter whether nanosleep() or poll() or select() are used on Linux. 20080119 + fixes to build with --disable-ext-funcs + add manpage for use_window and use_screen. + add set_tabsize() and set_escdelay() functions. 20080112 + remove recursive-mutex definitions, finish threading demo for worm.c + remove a redundant adjustment of lines in resizeterm.c's adjust_window() which caused occasional misadjustment of stdscr when softkeys were used. 20080105 + several improvements to terminfo entries based on xterm #230 -TD + modify MKlib_gen.sh to handle keyname/key_name prototypes, so the "link_test" builds properly. + fix for toe command-line options -u/-U to ensure filename is given. + fix allocation-size for command-line parsing in infocmp from 20070728 (report by Miroslav Lichvar) + improve resizeterm() by moving ripped-off lines, and repainting the soft-keys (report by Katarina Machalkova) + add clarification in wclear's manpage noting that the screen will be cleared even if a subwindow is cleared (prompted by Christer Enfors question). + change test/ncurses.c soft-key tests to work with KEY_RESIZE. 20071222 + continue implementing support for threading demo by adding mutex for delwin(). 20071215 + add several functions to C++ binding which wrap C functions that pass a WINDOW* parameter (request by Chris Lee). 20071201 + add note about configure options needed for Berkeley database to the INSTALL file. + improve checks for version of Berkeley database libraries. + amend fix for rpath to not modify LDFLAGS if the platform has no applicable transformation (report by Christian Ebert, cf: 20071124). 20071124 + modify configure option --with-hashed-db to accept a parameter which is the install-prefix of a given Berkeley Database (prompted by pierre4d2 comments). + rewrite wrapper for wcrtomb(), making it work on Solaris. This is used in the form library to determine the length of the buffer needed by field_buffer (report by Alfred Fung). + remove unneeded window-parameter from C++ binding for wresize (report by Chris Lee). 20071117 + modify the support for filesystems which do not support mixed-case to generate 2-character (hexadecimal) codes for the lower-level of the filesystem terminfo database (request by Michail Vidiassov). + add configure option --enable-mixed-case, to allow overriding the configure script's check if the filesystem supports mixed-case filenames. + add wresize() to C++ binding (request by Chris Lee). + define NCURSES_EXT_FUNCS and NCURSES_EXT_COLORS in curses.h to make it simpler to tell if the extended functions and/or colors are declared. 20071103 + update memory-leak checks for changes to names.c and codes.c + correct acsc strings in h19, z100 (patch by Benjamin C W Sittler). 20071020 + continue implementing support for threading demo by adding mutex for use_window(). + add mrxvt terminfo entry, add/fix xterm building blocks for modified cursor keys -TD + compile with FreeBSD "contemporary" TTY interface (patch by Rong-En Fan). 20071013 + modify makefile rules to allow clear, tput and tset to be built without libtic. The other programs (infocmp, tic and toe) rely on that library. + add/modify null-pointer checks in several functions for SP and/or the WINDOW* parameter (report by Thorben Krueger). + fixes for field_buffer() in formw library (see Redhat #310071, patches by Miroslav Lichvar). + improve performance of NCURSES_CHAR_EQ code (patch by Miroslav Lichvar). + update/improve mlterm and rxvt terminfo entries, e.g., for the modified cursor- and keypad-keys -TD 20071006 + add code to curses.priv.h ifdef'd with NCURSES_CHAR_EQ, which changes the CharEq() macro to an inline function to allow comparing cchar_t struct's without comparing gaps in a possibly unpacked memory layout (report by Miroslav Lichvar). 20070929 + add new functions to lib_trace.c to setup mutex's for the _tracef() calls within the ncurses library. + for the reentrant model, move _nc_tputs_trace and _nc_outchars into the SCREEN. + start modifying test/worm.c to provide threading demo (incomplete). + separated ifdef's for some BSD-related symbols in tset.c, to make it compile on LynxOS (report by Greg Gemmer). 20070915 + modify Ada95/gen/Makefile to use shlib script, to simplify building shared-library configuration on platforms lacking rpath support. + build-fix for Ada95/src/Makefile to reflect changed dependency for the terminal-interface-curses-aux.adb file which is now generated. + restructuring test/worm.c, for use_window() example. 20070908 + add use_window() and use_screen() functions, to develop into support for threaded library (incomplete). + fix typos in man/curs_opaque.3x which kept the install script from creating symbolic links to two aliases created in 20070818 (report by Rong-En Fan). 20070901 + remove a spurious newline from output of html.m4, which caused links for Ada95 html to be incorrect for the files generated using m4. + start investigating mutex's for SCREEN manipulation (incomplete). + minor cleanup of codes.c/names.c for --enable-const + expand/revise "Routine and Argument Names" section of ncurses manpage to address report by David Givens in newsgroup discussion. + fix interaction between --without-progs/--with-termcap configure options (report by Michail Vidiassov). + fix typo in "--disable-relink" option (report by Michail Vidiassov). 20070825 + fix a sign-extension bug in infocmp's repair_acsc() function (cf: 971004). + fix old configure script bug which prevented "--disable-warnings" option from working (patch by Mike Frysinger). 20070818 + add 9term terminal description (request by Juhapekka Tolvanen) -TD + modify comp_hash.c's string output to avoid misinterpreting a null "\0" followed by a digit. + modify MKnames.awk and MKcodes.awk to support big-strings. This only applies to the cases (broken linker, reentrant) where the corresponding arrays are accessed via wrapper functions. + split MKnames.awk into two scripts, eliminating the shell redirection which complicated the make process and also the bogus timestamp file which was introduced to fix "make -j". + add test/test_opaque.c, test/test_arrays.c + add wgetscrreg() and wgetparent() for applications that may need it when NCURSES_OPAQUE is defined (prompted by Bryan Christ). 20070812 + amend treatment of infocmp "-r" option to retain the 1023-byte limit unless "-T" is given (cf: 981017). + modify comp_captab.c generation to use big-strings. + make _nc_capalias_table and _nc_infoalias_table private accessed via _nc_get_alias_table() since the tables are used only within the tic library. + modify configure script to skip Intel compiler in CF_C_INLINE. + make _nc_info_hash_table and _nc_cap_hash_table private accessed via _nc_get_hash_table() since the tables are used only within the tic library. 20070728 + make _nc_capalias_table and _nc_infoalias_table private, accessed via _nc_get_alias_table() since they are used only by parse_entry.c + make _nc_key_names private since it is used only by lib_keyname.c + add --disable-big-strings configure option to control whether unctrl.c is generated using the big-string optimization - which may use strings longer than supported by a given compiler. + reduce relocation tables for tic, infocmp by changing type of internal hash tables to short, and make those private symbols. + eliminate large fixed arrays from progs/infocmp.c 20070721 + change winnstr() to stop at the end of the line (cf: 970315). + add test/test_get_wstr.c + add test/test_getstr.c + add test/test_inwstr.c + add test/test_instr.c 20070716 + restore a call to obtain screen-size in _nc_setupterm(), which is used in tput and other non-screen applications via setupterm() (Debian #433357, reported by Florent Bayle, Christian Ohm, cf: 20070310). 20070714 + add test/savescreen.c test-program + add check to trace-file open, if the given name is a directory, add ".log" to the name and try again. + add konsole-256color entry -TD + add extra gcc warning options from xterm. + minor fixes for ncurses/hashmap test-program. + modify configure script to quiet c++ build with libtool when the --disable-echo option is used. + modify configure script to disable ada95 if libtool is selected, writing a warning message (addresses FreeBSD #114493). + update config.guess, config.sub 20070707 + add continuous-move "M" to demo_panels to help test refresh changes. + improve fix for refresh of window on top of multi-column characters, taking into account some split characters on left/right window boundaries. 20070630 + add "widec" row to _tracedump() output to help diagnose remaining problems with multi-column characters. + partial fix for refresh of window on top of multi-column characters which are partly overwritten (report by Sadrul H Chowdhury). + ignore A_CHARTEXT bits in vidattr() and vid_attr(), in case multi-column extension bits are passed there. + add setlocale() call to demo_panels.c, needed for wide-characters. + add some output flags to _nc_trace_ttymode to help diagnose a bug report by Larry Virden, i.e., ONLCR, OCRNL, ONOCR and ONLRET, 20070623 + add test/demo_panels.c + implement opaque version of setsyx() and getsyx(). 20070612 + corrected xterm+pcf2 terminfo modifiers for F1-F4, to match xterm #226 -TD + split-out key_name() from MKkeyname.awk since it now depends upon wunctrl() which is not in libtinfo (report by Rong-En Fan). 20070609 + add test/key_name.c + add stdscr cases to test/inchs.c and test/inch_wide.c + update test/configure + correct formatting of DEL (0x7f) in _nc_vischar(). + null-terminate result of wunctrl(). + add null-pointer check in key_name() (report by Andreas Krennmair, cf: 20020901). 20070602 + adapt mouse-handling code from menu library in form-library (discussion with Clive Nicolson). + add a modification of test/dots.c, i.e., test/dots_mvcur.c to illustrate how to use mvcur(). + modify wide-character flavor of SetAttr() to preserve the WidecExt() value stored in the .attr field, e.g., in case it is overwritten by chgat (report by Aleksi Torhamo). + correct buffer-size for _nc_viswbuf2n() (report by Aleksi Torhamo). + build-fixes for Solaris 2.6 and 2.7 (patch by Peter O'Gorman). 20070526 + modify keyname() to use "^X" form only if meta() has been called, or if keyname() is called without initializing curses, e.g., via initscr() or newterm() (prompted by LinuxBase #1604). + document some portability issues in man/curs_util.3x + add a shadow copy of TTY buffer to _nc_prescreen to fix applications broken by moving that data into SCREEN (cf: 20061230). 20070512 + add 'O' (wide-character panel test) in ncurses.c to demonstrate a problem reported by Sadrul H Chowdhury with repainting parts of a fullwidth cell. + modify slk_init() so that if there are preceding calls to ripoffline(), those affect the available lines for soft-keys (adapted from patch by Clive Nicolson). + document some portability issues in man/curs_getyx.3x 20070505 + fix a bug in Ada95/samples/ncurses which caused a variable to become uninitialized in the "b" test. + fix Ada95/gen/Makefile.in adahtml rule to account for recent movement of files, fix a few incorrect manpage references in the generated html. + add Ada95 binding to _nc_freeall() as Curses_Free_All to help with memory-checking. + correct some functions in Ada95 binding which were using return value from C where none was returned: idcok(), immedok() and wtimeout(). + amend recent changes for Ada95 binding to make it build with Cygwin's linker, e.g., with configure options --enable-broken-linker --with-ticlib 20070428 + add a configure check for gcc's options for inlining, use that to quiet a warning message where gcc's default behavior changed from 3.x to 4.x. + improve warning message when checking if GPM is linked to curses library by not warning if its use of "wgetch" is via a weak symbol. + add loader options when building with static libraries to ensure that an installed shared library for ncurses does not conflict. This is reported as problem with Tru64, but could affect other platforms (report Martin Mokrejs, analysis by Tim Mooney). + fix build on cygwin after recent ticlib/termlib changes, i.e., + adjust TINFO_SUFFIX value to work with cygwin's dll naming + revert a change from 20070303 which commented out dependency of SHLIB_LIST in form/menu/panel/c++ libraries. + fix initialization of ripoff stack pointer (cf: 20070421). 20070421 + move most static variables into structures _nc_globals and _nc_prescreen, to simplify storage. + add/use configure script macro CF_SIG_ATOMIC_T, use the corresponding type for data manipulated by signal handlers (prompted by comments in mailing.openbsd.bugs newsgroup). + modify CF_WITH_LIBTOOL to allow one to pass options such as -static to the libtool create- and link-operations. 20070414 + fix whitespace in curs_opaque.3x which caused a spurious ';' in the installed aliases (report by Peter Santoro). + fix configure script to not try to generate adacurses-config when Ada95 tree is not built. 20070407 + add man/curs_legacy.3x, man/curs_opaque.3x + fix acs_map binding for Ada95 when --enable-reentrant is used. + add adacurses-config to the Ada95 install, based on version from FreeBSD port, in turn by Juergen Pfeifer in 2000 (prompted by comment on comp.lang.ada newsgroup). + fix includes in c++ binding to build with Intel compiler (cf: 20061209). + update install rule in Ada95 to use mkdirs.sh > other fixes prompted by inspection for Coverity report: + modify ifdef's for c++ binding to use try/catch/throw statements + add a null-pointer check in tack/ansi.c request_cfss() + fix a memory leak in ncurses/base/wresize.c + corrected check for valid memu/meml capabilities in progs/dump_entry.c when handling V_HPUX case. > fixes based on Coverity report: + remove dead code in test/bs.c + remove dead code in test/demo_defkey.c + remove an unused assignment in progs/infocmp.c + fix a limit check in tack/ansi.c tools_charset() + fix tack/ansi.c tools_status() to perform the VT320/VT420 tests in request_cfss(). The function had exited too soon. + fix a memory leak in tic.c's make_namelist() + fix a couple of places in tack/output.c which did not check for EOF. + fix a loop-condition in test/bs.c + add index checks in lib_color.c for color palettes + add index checks in progs/dump_entry.c for version_filter() handling of V_BSD case. + fix a possible null-pointer dereference in copywin() + fix a possible null-pointer dereference in waddchnstr() + add a null-pointer check in _nc_expand_try() + add a null-pointer check in tic.c's make_namelist() + add a null-pointer check in _nc_expand_try() + add null-pointer checks in test/cardfile.c + fix a double-free in ncurses/tinfo/trim_sgr0.c + fix a double-free in ncurses/base/wresize.c + add try/catch block to c++/cursesmain.cc 20070331 + modify Ada95 binding to build with --enable-reentrant by wrapping global variables (bug: acs_map does not yet work). + modify Ada95 binding to use the new access-functions, allowing it to build/run when NCURSES_OPAQUE is set. + add access-functions and macros to return properties of the WINDOW structure, e.g., when NCURSES_OPAQUE is set. + improved install-sh's quoting. + use mkdirs.sh rather than mkinstalldirs, e.g., to use fixes from other programs. 20070324 + eliminate part of the direct use of WINDOW data from Ada95 interface. + fix substitutions for termlib filename to make configure option --enable-reentrant work with --with-termlib. + change a constructor for NCursesWindow to allow compiling with NCURSES_OPAQUE set, since we cannot pass a reference to an opaque pointer. 20070317 + ignore --with-chtype=unsigned since unsigned is always added to the type in curses.h; do the same for --with-mmask-t. + change warning regarding --enable-ext-colors and wide-character in the configure script to an error. + tweak error message in CF_WITH_LIBTOOL to distinguish other programs such as Darwin's libtool program (report by Michail Vidiassov) + modify edit_man.sh to allow for multiple substitutions per line. + set locale in misc/ncurses-config.in since it uses a range + change permissions libncurses++.a install (report by Michail Vidiassov). + corrected length of temporary buffer in wide-character version of set_field_buffer() (related to report by Bryan Christ). 20070311 + fix mk-1st.awk script install_shlib() function, broken in 20070224 changes for cygwin (report by Michail Vidiassov). 20070310 + increase size of array in _nc_visbuf2n() to make "tic -v" work properly in its similar_sgr() function (report/analysis by Peter Santoro). + add --enable-reentrant configure option for ongoing changes to implement a reentrant version of ncurses: + libraries are suffixed with "t" + wrap several global variables (curscr, newscr, stdscr, ttytype, COLORS, COLOR_PAIRS, COLS, ESCDELAY, LINES and TABSIZE) as functions returning values stored in SCREEN or cur_term. + move some initialization (LINES, COLS) from lib_setup.c, i.e., setupterm() to _nc_setupscreen(), i.e., newterm(). 20070303 + regenerated html documentation. + add NCURSES_OPAQUE symbol to curses.h, will use to make structs opaque in selected configurations. + move the chunk in lib_acs.c which resets acs capabilities when running on a terminal whose locale interferes with those into _nc_setupscreen(), so the libtinfo/libtinfow files can be made identical (requested by Miroslav Lichvar). + do not use configure variable SHLIB_LIBS for building libraries outside the ncurses directory, since that symbol is customized only for that directory, and using it introduces an unneeded dependency on libdl (requested by Miroslav Lichvar). + modify mk-1st.awk so the generated makefile rules for linking or installing shared libraries do not first remove the library, in case it is in use, e.g., libncurses.so by /bin/sh (report by Jeff Chua). + revised section "Using NCURSES under XTERM" in ncurses-intro.html (prompted by newsgroup comment by Nick Guenther). 20070224 + change internal return codes of _nc_wgetch() to check for cases where KEY_CODE_YES should be returned, e.g., if a KEY_RESIZE was ungetch'd, and read by wget_wch(). + fix static-library build broken in 20070217 changes to remove "-ldl" (report by Miroslav Lichvar). + change makefile/scripts for cygwin to allow building termlib. + use Form_Hook in manpages to match form.h + use Menu_Hook in manpages, as well as a few places in menu.h + correct form- and menu-manpages to use specific Field_Options, Menu_Options and Item_Options types. + correct prototype for _tracechar() in manpage (cf: 20011229). + correct prototype for wunctrl() in manpage. 20070217 + fixes for $(TICS_LIST) in ncurses/Makefile (report by Miroslav Lichvar). + modify relinking of shared libraries to apply only when rpath is enabled, and add --disable-relink option which can be used to disable the feature altogether (reports by Michail Vidiassov, Adam J Richter). + fix --with-termlib option for wide-character configuration, stripping the "w" suffix in one place (report by Miroslav Lichvar). + remove "-ldl" from some library lists to reduce dependencies in programs (report by Miroslav Lichvar). + correct description of --enable-signed-char in configure --help (report by Michail Vidiassov). + add pattern for GNU/kFreeBSD configuration to CF_XOPEN_SOURCE, which matches an earlier change to CF_SHARED_OPTS, from xterm #224 fixes. + remove "${DESTDIR}" from -install_name option used for linking shared libraries on Darwin (report by Michail Vidiassov). 20070210 + add test/inchs.c, test/inch_wide.c, to test win_wchnstr(). + remove libdl from library list for termlib (report by Miroslav Lichvar). + fix configure.in to allow --without-progs --with-termlib (patch by Miroslav Lichvar). + modify win_wchnstr() to ensure that only a base cell is returned for each multi-column character (prompted by report by Wei Kong regarding change in mvwin_wch() cf: 20041023). 20070203 + modify fix_wchnstr() in form library to strip attributes (and color) from the cchar_t array (field cells) read from a field's window. Otherwise, when copying the field cells back to the window, the associated color overrides the field's background color (report by Ricardo Cantu). + improve tracing for form library, showing created forms, fields, etc. + ignore --enable-rpath configure option if --with-shared was omitted. + add _nc_leaks_tinfo(), _nc_free_tic(), _nc_free_tinfo() entrypoints to allow leak-checking when both tic- and tinfo-libraries are built. + drop CF_CPP_VSCAN_FUNC macro from configure script, since C++ binding no longer relies on it. + disallow combining configure script options --with-ticlib and --enable-termcap (report by Rong-En Fan). + remove tack from ncurses tree. 20070128 + fix typo in configure script that broke --with-termlib option (report by Rong-En Fan). 20070127 + improve fix for FreeBSD gnu/98975, to allow for null pointer passed to tgetent() (report by Rong-en Fan). + update tack/HISTORY and tack/README to tell how to build it after it is removed from the ncurses tree. + fix configure check for libtool's version to trim blank lines (report by sci-fi@hush.ai). + review/eliminate other original-file artifacts in cursesw.cc, making its license consistent with ncurses. + use ncurses vw_scanw() rather than reading into a fixed buffer in the c++ binding for scanw() methods (prompted by report by Nuno Dias). + eliminate fixed-buffer vsprintf() calls in c++ binding. 20070120 + add _nc_leaks_tic() to separate leak-checking of tic library from term/ncurses libraries, and thereby eliminate a library dependency. + fix test/mk-test.awk to ignore blank lines. + correct paths in include/headers, for --srcdir (patch by Miroslav Lichvar). 20070113 + add a break-statement in misc/shlib to ensure that it exits on the _first_ matched directory (report by Paul Novak). + add tack/configure, which can be used to build tack outside the ncurses build-tree. + add --with-ticlib option, to build/install the tic-support functions in a separate library (suggested by Miroslav Lichvar). 20070106 + change MKunctrl.awk to reduce relocation table for unctrl.o + change MKkeyname.awk to reduce relocation table for keyname.o (patch by Miroslav Lichvar). 20061230 + modify configure check for libtool's version to trim blank lines (report by sci-fi@hush.ai). + modify some modules to allow them to be reentrant if _REENTRANT is defined: lib_baudrate.c, resizeterm.c (local data only) + eliminate static data from some modules: add_tries.c, hardscroll.c, lib_ttyflags.c, lib_twait.c + improve manpage install to add aliases for the transformed program names, e.g., from --program-prefix. + used linklint to verify links in the HTML documentation, made fixes to manpages as needed. + fix a typo in curs_mouse.3x (report by William McBrine). + fix install-rule for ncurses5-config to make the bin-directory. 20061223 + modify configure script to omit the tic (terminfo compiler) support from ncurses library if --without-progs option is given. + modify install rule for ncurses5-config to do this via "install.libs" + modify shared-library rules to allow FreeBSD 3.x to use rpath. + update config.guess, config.sub 20061217 5.6 release for upload to ftp.gnu.org 20061217 + add ifdef's for for HPUX, which has the corresponding definitions in . + revert the va_copy() change from 20061202, since it was neither correct nor portable. + add $(LOCAL_LIBS) definition to progs/Makefile.in, needed for rpath on Solaris. + ignore wide-acs line-drawing characters that wcwidth() claims are not one-column. This is a workaround for Solaris' broken locale support. 20061216 + modify configure --with-gpm option to allow it to accept a parameter, i.e., the name of the dynamic GPM library to load via dlopen() (requested by Bryan Henderson). + add configure option --with-valgrind, changes from vile. + modify configure script AC_TRY_RUN and AC_TRY_LINK checks to use 'return' in preference to 'exit()'. 20061209 + change default for --with-develop back to "no". + add XTABS to tracing of TTY bits. + updated autoconf patch to ifdef-out the misfeature which declares exit() for configure tests. This fixes a redefinition warning on Solaris. + use ${CC} rather than ${LD} in shared library rules for IRIX64, Solaris to help ensure that initialization sections are provided for extra linkage requirements, e.g., of C++ applications (prompted by comment by Casper Dik in newsgroup). + rename "$target" in CF_MAN_PAGES to make it easier to distinguish from the autoconf predefined symbol. There was no conflict, since "$target" was used only in the generated edit_man.sh file, but SuSE's rpm package contains a patch. 20061202 + update man/term.5 to reflect extended terminfo support and hashed database configuration. + updates for test/configure script. + adapted from SuSE rpm package: + remove long-obsolete workaround for broken-linker which declared cur_term in tic.c + improve error recovery in PUTC() macro when wcrtomb() does not return usable results for an 8-bit character. + patches from rpm package (SuSE): + use va_copy() in extra varargs manipulation for tracing version of printw, etc. + use a va_list rather than a null in _nc_freeall()'s call to _nc_printf_string(). + add some see-also references in manpages to show related wide-character functions (suggested by Claus Fischer). 20061125 + add a check in lib_color.c to ensure caller does not increase COLORS above max_colors, which is used as an array index (discussion with Simon Sasburg). + add ifdef's allowing ncurses to be built with tparm() using either varargs (the existing status), or using a fixed-parameter list (to match X/Open). 20061104 + fix redrawing of windows other than stdscr using wredrawln() by touching the corresponding rows in curscr (discussion with Dan Gookin). + add test/redraw.c + add test/echochar.c + review/cleanup manpage descriptions of error-returns for form- and menu-libraries (prompted by FreeBSD docs/46196). 20061028 + add AUTHORS file -TD + omit the -D options from output of the new config script --cflags option (suggested by Ralf S Engelschall). + make NCURSES_INLINE unconditionally defined in curses.h 20061021 + revert change to accommodate bash 3.2, since that breaks other platforms, e.g., Solaris. + minor fixes to NEWS file to simplify scripting to obtain list of contributors. + improve some shared-library configure scripting for Linux, FreeBSD and NetBSD to make "--with-shlib-version" work. + change configure-script rules for FreeBSD shared libraries to allow for rpath support in versions past 3. + use $(DESTDIR) in makefile rules for installing/uninstalling the package config script (reports/patches by Christian Wiese, Ralf S Engelschall). + fix a warning in the configure script for NetBSD 2.0, working around spurious blanks embedded in its ${MAKEFLAGS} symbol. + change test/Makefile to simplify installing test programs in a different directory when --enable-rpath is used. 20061014 + work around bug in bash 3.2 by adding extra quotes (Jim Gifford). + add/install a package config script, e.g., "ncurses5-config" or "ncursesw5-config", according to configuration options. 20061007 + add several GNU Screen terminfo variations with 16- and 256-colors, and status line (Alain Bench). + change the way shared libraries (other than libtool) are installed. Rather than copying the build-tree's libraries, link the shared objects into the install directory. This makes the --with-rpath option work except with $(DESTDIR) (cf: 20000930). 20060930 + fix ifdef in c++/internal.h for QNX 6.1 + test-compiled with (old) egcs-1.1.2, modified configure script to not unset the $CXX and related variables which would prevent this. + fix a few terminfo.src typos exposed by improvments to "-f" option. + improve infocmp/tic "-f" option formatting. 20060923 + make --disable-largefile option work (report by Thomas M Ott). + updated html documentation. + add ka2, kb1, kb3, kc2 to vt220-keypad as an extension -TD + minor improvements to rxvt+pcfkeys -TD 20060916 + move static data from lib_mouse.c into SCREEN struct. + improve ifdef's for _POSIX_VDISABLE in tset to work with Mac OS X (report by Michail Vidiassov). + modify CF_PATH_SYNTAX to ensure it uses the result from --prefix option (from lynx changes) -TD + adapt AC_PROG_EGREP check, noting that this is likely to be another place aggravated by POSIXLY_CORRECT. + modify configure check for awk to ensure that it is found (prompted by report by Christopher Parker). + update config.sub 20060909 + add kon, kon2 and jfbterm terminfo entry (request by Till Maas) -TD + remove invis capability from klone+sgr, mainly used by linux entry, since it does not really do this -TD 20060903 + correct logic in wadd_wch() and wecho_wch(), which did not guard against passing the multi-column attribute into a call on waddch(), e.g., using data returned by win_wch() (cf: 20041023) (report by Sadrul H Chowdhury). 20060902 + fix kterm's acsc string -TD + fix for change to tic/infocmp in 20060819 to ensure no blank is embedded into a termcap description. + workaround for 20050806 ifdef's change to allow visbuf.c to compile when using --with-termlib --with-trace options. + improve tgetstr() by making the return value point into the user's buffer, if provided (patch by Miroslav Lichvar (see Redhat #202480)). + correct libraries needed for foldkeys (report by Stanislav Ievlev) 20060826 + add terminfo entries for xfce terminal (xfce) and multi gnome terminal (mgt) -TD + add test/foldkeys.c 20060819 + modify tic and infocmp to avoid writing trailing blanks on terminfo source output (Debian #378783). + modify configure script to ensure that if the C compiler is used rather than the loader in making shared libraries, the $(CFLAGS) variable is also used (Redhat #199369). + port hashed-db code to db2 and db3. + fix a bug in tgetent() from 20060625 and 20060715 changes (patch/analysis by Miroslav Lichvar (see Redhat #202480)). 20060805 + updated xterm function-keys terminfo to match xterm #216 -TD + add configure --with-hashed-db option (tested only with FreeBSD 6.0, e.g., the db 1.8.5 interface). 20060729 + modify toe to access termcap data, e.g., via cgetent() functions, or as a text file if those are not available. + use _nc_basename() in tset to improve $SHELL check for csh/sh. + modify _nc_read_entry() and _nc_read_termcap_entry() so infocmp, can access termcap data when the terminfo database is disabled. 20060722 + widen the test for xterm kmous a little to allow for other strings than \E[M, e.g., for xterm-sco functionality in xterm. + update xterm-related terminfo entries to match xterm patch #216 -TD + update config.guess, config.sub 20060715 + fix for install-rule in Ada95 to add terminal_interface.ads and terminal_interface.ali (anonymous posting in comp.lang.ada). + correction to manpage for getcchar() (report by William McBrine). + add test/chgat.c + modify wchgat() to mark updated cells as changed so a refresh will repaint those cells (comments by Sadrul H Chowdhury and William McBrine). + split up dependency of names.c and codes.c in ncurses/Makefile to work with parallel make (report/analysis by Joseph S Myers). + suppress a warning message (which is ignored) for systems without an ldconfig program (patch by Justin Hibbits). + modify configure script --disable-symlinks option to allow one to disable symlink() in tic even when link() does not work (report by Nigel Horne). + modify MKfallback.sh to use tic -x when constructing fallback tables to allow extended capabilities to be retrieved from a fallback entry. + improve leak-checking logic in tgetent() from 20060625 to ensure that it does not free the current screen (report by Miroslav Lichvar). 20060708 + add a check for _POSIX_VDISABLE in tset (NetBSD #33916). + correct _nc_free_entries() and related functions used for memory leak checking of tic. 20060701 + revert a minor change for magic-cookie support from 20060513, which caused unexpected reset of attributes, e.g., when resizing test/view in color mode. + note in clear manpage that the program ignores command-line parameters (prompted by Debian #371855). + fixes to make lib_gen.c build properly with changes to the configure --disable-macros option and NCURSES_NOMACROS (cf: 20060527) + update/correct several terminfo entries -TD + add some notes regarding copyright to terminfo.src -TD 20060625 + fixes to build Ada95 binding with gnat-4.1.0 + modify read_termtype() so the term_names data is always allocated as part of the str_table, a better fix for a memory leak (cf: 20030809). + reduce memory leaks in repeated calls to tgetent() by remembering the last TERMINAL* value allocated to hold the corresponding data and freeing that if the tgetent() result buffer is the same as the previous call (report by "Matt" for FreeBSD gnu/98975). + modify tack to test extended capability function-key strings. + improved gnome terminfo entry (GenToo #122566). + improved xterm-256color terminfo entry (patch by Alain Bench). 20060617 + fix two small memory leaks related to repeated tgetent() calls with TERM=screen (report by "Matt" for FreeBSD gnu/98975). + add --enable-signed-char to simplify Debian package. + reduce name-pollution in term.h by removing #define's for HAVE_xxx symbols. + correct typo in curs_terminfo.3x (Debian #369168). 20060603 + enable the mouse in test/movewindow.c + improve a limit-check in frm_def.c (John Heasley). + minor copyright fixes. + change configure script to produce test/Makefile from data file. 20060527 + add a configure option --enable-wgetch-events to enable NCURSES_WGETCH_EVENTS, and correct the associated loop-logic in lib_twait.c (report by Bernd Jendrissek). + remove include/nomacros.h from build, since the ifdef for NCURSES_NOMACROS makes that obsolete. + add entrypoints for some functions which were only provided as macros to make NCURSES_NOMACROS ifdef work properly: getcurx(), getcury(), getbegx(), getbegy(), getmaxx(), getmaxy(), getparx() and getpary(), wgetbkgrnd(). + provide ifdef for NCURSES_NOMACROS which suppresses most macro definitions from curses.h, i.e., where a macro is defined to override a function to improve performance. Allowing a developer to suppress these definitions can simplify some application (discussion with Stanislav Ievlev). + improve description of memu/meml in terminfo manpage. 20060520 + if msgr is false, reset video attributes when doing an automargin wrap to the next line. This makes the ncurses 'k' test work properly for hpterm. + correct caching of keyname(), which was using only half of its table. + minor fixes to memory-leak checking. + make SCREEN._acs_map and SCREEN._screen_acs_map pointers rather than arrays, making ACS_LEN less visible to applications (suggested by Stanislav Ievlev). + move chunk in SCREEN ifdef'd for USE_WIDEC_SUPPORT to the end, so _screen_acs_map will have the same offset in both ncurses/ncursesw, making the corresponding tinfo/tinfow libraries binary-compatible (cf: 20041016, report by Stanislav Ievlev). 20060513 + improve debug-tracing for EmitRange(). + change default for --with-develop to "yes". Add NCURSES_NO_HARD_TABS and NCURSES_NO_MAGIC_COOKIE environment variables to allow runtime suppression of the related hard-tabs and xmc-glitch features. + add ncurses version number to top-level manpages, e.g., ncurses, tic, infocmp, terminfo as well as form, menu, panel. + update config.guess, config.sub + modify ncurses.c to work around a bug in NetBSD 3.0 curses (field_buffer returning null for a valid field). The 'r' test appears to not work with that configuration since the new_fieldtype() function is broken in that implementation. 20060506 + add hpterm-color terminfo entry -TD + fixes to compile test-programs with HPUX 11.23 20060422 + add copyright notices to files other than those that are generated, data or adapted from pdcurses (reports by William McBrine, David Taylor). + improve rendering on hpterm by not resetting attributes at the end of doupdate() if the terminal has the magic-cookie feature (report by Bernd Rieke). + add 256color variants of terminfo entries for programs which are reported to implement this feature -TD 20060416 + fix typo in change to NewChar() macro from 20060311 changes, which broke tab-expansion (report by Frederic L W Meunier). 20060415 + document -U option of tic and infocmp. + modify tic/infocmp to suppress smacs/rmacs when acsc is suppressed due to size limit, e.g., converting to termcap format. Also suppress them if the output format does not contain acsc and it was not VT100-like, i.e., a one-one mapping (Novell #163715). + add configure check to ensure that SIGWINCH is defined on platforms such as OS X which exclude that when _XOPEN_SOURCE, etc., are defined (report by Nicholas Cole) 20060408 + modify write_object() to not write coincidental extensions of an entry made due to it being referenced in a use= clause (report by Alain Bench). + another fix for infocmp -i option, which did not ensure that some escape sequences had comparable prefixes (report by Alain Bench). 20060401 + improve discussion of init/reset in terminfo and tput manpages (report by Alain Bench). + use is3 string for a fallback of rs3 in the reset program; it was using is2 (report by Alain Bench). + correct logic for infocmp -i option, which did not account for multiple digits in a parameter (cf: 20040828) (report by Alain Bench). + move _nc_handle_sigwinch() to lib_setup.c to make --with-termlib option work after 20060114 changes (report by Arkadiusz Miskiewicz). + add copyright notices to test-programs as needed (report by William McBrine). 20060318 + modify ncurses.c 'F' test to combine the wide-characters with color and/or video attributes. + modify test/ncurses to use CTL/Q or ESC consistently for exiting a test-screen (some commands used 'x' or 'q'). 20060312 + fix an off-by-one in the scrolling-region change (cf_ 20060311). 20060311 + add checks in waddchnstr() and wadd_wchnstr() to stop copying when a null character is found (report by Igor Bogomazov). + modify progs/Makefile.in to make "tput init" work properly with cygwin, i.e., do not pass a ".exe" in the reference string used in check_aliases (report by Samuel Thibault). + add some checks to ensure current position is within scrolling region before scrolling on a new line (report by Dan Gookin). + change some NewChar() usage to static variables to work around stack garbage introduced when cchar_t is not packed (Redhat #182024). 20060225 + workarounds to build test/movewindow with PDcurses 2.7. + fix for nsterm-16color entry (patch by Alain Bench). + correct a typo in infocmp manpage (Debian #354281). 20060218 + add nsterm-16color entry -TD + updated mlterm terminfo entry -TD + remove 970913 feature for copying subwindows as they are moved in mvwin() (discussion with Bryan Christ). + modify test/demo_menus.c to demonstrate moving a menu (both the window and subwindow) using shifted cursor-keys. + start implementing recursive mvwin() in movewindow.c (incomplete). + add a fallback definition for GCC_PRINTFLIKE() in test.priv.h, for movewindow.c (report by William McBrine). + add help-message to test/movewindow.c 20060211 + add test/movewindow.c, to test mvderwin(). + fix ncurses soft-key test so color changes are shown immediately rather than delayed. + modify ncurses soft-key test to hide the keys when exiting the test screen. + fixes to build test programs with PDCurses 2.7, e.g., its headers rely on autoconf symbols, and it declares stubs for nonfunctional terminfo and termcap entrypoints. 20060204 + improved test/configure to build test/ncurses on HPUX 11 using the vendor curses. + documented ALTERNATE CONFIGURATIONS in the ncurses manpage, for the benefit of developers who do not read INSTALL. 20060128 + correct form library Window_To_Buffer() change (cf: 20040516), which should ignore the video attributes (report by Ricardo Cantu). 20060121 + minor fixes to xmc-glitch experimental code: + suppress line-drawing + implement max_attributes tested with xterm. + minor fixes for the database iterator. + fix some buffer limits in c++ demo (comment by Falk Hueffner in Debian #348117). 20060114 + add toe -a option, to show all databases. This uses new private interfaces in the ncurses library for iterating through the list of databases. + fix toe from 20000909 changes which made it not look at $HOME/.terminfo + make toe's -v option parameter optional as per manpage. + improve SIGWINCH handling by postponing its effect during newterm(), etc., when allocating screens. 20060111 + modify wgetnstr() to return KEY_RESIZE if a sigwinch occurs. Use this in test/filter.c + fix an error in filter() modification which caused some applications to fail. 20060107 + check if filter() was called when getting the screensize. Keep it at 1 if so (based on Redhat #174498). + add extension nofilter(). + refined the workaround for ACS mapping. + make ifdef's consistent in curses.h for the extended colors so the header file can be used for the normal curses library. The header file installed for extended colors is a variation of the wide-character configuration (report by Frederic L W Meunier). 20051231 + add a workaround to ACS mapping to allow applications such as test/blue.c to use the "PC ROM" characters by masking them with A_ALTCHARSET. This worked up til 5.5, but was lost in the revision of legacy coding (report by Michael Deutschmann). + add a null-pointer check in the wide-character version of calculate_actual_width() (report by Victor Julien). + improve test/ncurses 'd' (color-edit) test by allowing the RGB values to be set independently (patch by William McBrine). + modify test/configure script to allow building test programs with PDCurses/X11. + modified test programs to allow some to work with NetBSD curses. Several do not because NetBSD curses implements a subset of X/Open curses, and also lacks much of SVr4 additions. But it's enough for comparison. + update config.guess and config.sub 20051224 + use BSD-specific fix for return-value from cgetent() from CVS where an unknown terminal type would be reportd as "database not found". + make tgetent() return code more readable using new symbols TGETENT_YES, etc. + remove references to non-existent "tctest" program. + remove TESTPROGS from progs/Makefile.in (it was referring to code that was never built in that directory). + typos in curs_addchstr.3x, some doc files (noticed in OpenBSD CVS). 20051217 + add use_legacy_coding() function to support lynx's font-switching feature. + fix formatting in curs_termcap.3x (report by Mike Frysinger). + modify MKlib_gen.sh to change preprocessor-expanded _Bool back to bool. 20051210 + extend test/ncurses.c 's' (overlay window) test to exercise overlay(), overwrite() and copywin() with different combinations of colors and attributes (including background color) to make it easy to see the effect of the different functions. + corrections to menu/m_global.c for wide-characters (report by Victor Julien). 20051203 + add configure option --without-dlsym, allowing developers to configure GPM support without using dlsym() (discussion with Michael Setzer). + fix wins_nwstr(), which did not handle single-column non-8bit codes (Debian #341661). 20051126 + move prototypes for wide-character trace functions from curses.tail to curses.wide to avoid accidental reference to those if _XOPEN_SOURCE_EXTENDED is defined without ensuring that is included. + add/use NCURSES_INLINE definition. + change some internal functions to use int/unsigned rather than the short equivalents. 20051119 + remove a redundant check in lib_color.c (Debian #335655). + use ld's -search_paths_first option on Darwin to work around odd search rules on that platform (report by Christian Gennerat, analysis by Andrea Govoni). + remove special case for Darwin in CF_XOPEN_SOURCE configure macro. + ignore EINTR in tcgetattr/tcsetattr calls (Debian #339518). + fix several bugs in test/bs.c (patch by Stephen Lindholm). 20051112 + other minor fixes to cygwin based on tack -TD + correct smacs in cygwin (Debian #338234, report by Baurzhan Ismagulov, who noted that it was fixed in Cygwin). 20051029 + add shifted up/down arrow codes to xterm-new as kind/kri strings -TD + modify wbkgrnd() to avoid clearing the A_CHARTEXT attribute bits since those record the state of multicolumn characters (Debian #316663). + modify werase to clear multicolumn characters that extend into a derived window (Debian #316663). 20051022 + move assignment from environment variable ESCDELAY from initscr() down to newterm() so the environment variable affects timeouts for terminals opened with newterm() as well. + fix a memory leak in keyname(). + add test/demo_altkeys.c + modify test/demo_defkey.c to exit from loop via 'q' to allow leak-checking, as well as fix a buffer size in winnstr() call. 20051015 + correct order of use-clauses in rxvt-basic entry which made codes for f1-f4 vt100-style rather than vt220-style (report by Gabor Z Papp). + suppress configure check for gnatmake if Ada95/Makefile.in is not found. + correct a typo in configure --with-bool option for the case where --without-cxx is used (report by Daniel Jacobowitz). + add a note to INSTALL's discussion of --with-normal, pointing out that one may wish to use --without-gpm to ensure a completely static link (prompted by report by Felix von Leitner). 20051010 5.5 release for upload to ftp.gnu.org 20051008 + document in demo_forms.c some portability issues. 20051001 + document side-effect of werase() which sets the cursor position. + save/restore the current position in form field editing to make overlay mode work. 20050924 + correct header dependencies in progs, allowing parallel make (report by Daniel Jacobowitz). + modify CF_BUILD_CC to ensure that pre-setting $BUILD_CC overrides the configure check for --with-build-cc (report by Daniel Jacobowitz). + modify CF_CFG_DEFAULTS to not use /usr as the default prefix for NetBSD. + update config.guess and config.sub from http://subversions.gnu.org/cgi-bin/viewcvs/config/config/ 20050917 + modify sed expression which computes path for /usr/lib/terminfo symbolic link in install to ensure that it does not change unexpected levels of the path (Gentoo #42336). + modify default for --disable-lp64 configure option to reduce impact on existing 64-bit builds. Enabling the _LP64 option may change the size of chtype and mmask_t. However, for ABI 6, it is enabled by default (report by Mike Frysinger). + add configure script check for --enable-ext-mouse, bump ABI to 6 by default if it is used. + improve configure script logic for bumping ABI to omit this if the --with-abi-version option was used. + update address for Free Software Foundation in tack's source. + correct wins_wch(), which was not marking the filler-cells of multi-column characters (cf: 20041023). 20050910 + modify mouse initialization to ensure that Gpm_Open() is called only once. Otherwise GPM gets confused in its initialization of signal handlers (Debian #326709). 20050903 + modify logic for backspacing in a multiline form field to ensure that it works even when the preceding line is full (report by Frank van Vugt). + remove comment about BUGS section of ncurses manpage (Debian #325481) 20050827 + document some workarounds for shared and libtool library configurations in INSTALL (see --with-shared and --with-libtool). + modify CF_GCC_VERSION and CF_GXX_VERSION macros to accommodate cross-compilers which emit the platform name in their version message, e.g., arm-sa1100-linux-gnu-g++ (GCC) 4.0.1 (report by Frank van Vugt). 20050820 + start updating documentation for upcoming 5.5 release. + fix to make libtool and libtinfo work together again (cf: 20050122). + fixes to allow building traces into libtinfo + add debug trace to tic that shows if/how ncurses will write to the lower corner of a terminal's screen. + update llib-l* files. 20050813 + modify initializers in c++ binding to build with old versions of g++. + improve special case for 20050115 repainting fix, ensuring that if the first changed cell is not a character that the range to be repainted is adjusted to start at a character's beginning (Debian #316663). 20050806 + fixes to build on QNX 6.1 + improve configure script checks for Intel 9.0 compiler. + remove #include's for libc.h (obsolete). + adjust ifdef's in curses.priv.h so that when cross-compiling to produce comp_hash and make_keys, no dependency on wchar.h is needed. That simplifies the build-cppflags (report by Frank van Vugt). + move modules related to key-binding into libtinfo to fix linkage problem caused by 20050430 changes to MKkeyname.sh (report by Konstantin Andreev). 20050723 + updates/fixes for configure script macros from vile -TD + make prism9's sgr string agree with the rest of the terminfo -TD + make vt220's sgr0 string consistent with sgr string, do this for several related cases -TD + improve translation to termcap by filtering the 'me' (sgr0) strings as in the runtime call to tgetent() (prompted by a discussion with Thomas Klausner). + improve tic check for sgr0 versus sgr(0), to help ensure that sgr0 resets line-drawing. 20050716 + fix special cases for trimming sgr0 for hurd and vt220 (Debian #318621). + split-out _nc_trim_sgr0() from modifications made to tgetent(), to allow it to be used by tic to provide information about the runtime changes that would be made to sgr0 for termcap applications. + modify make_sed.sh to make the group-name in the NAME section of form/menu library manpage agree with the TITLE string when renaming is done for Debian (Debian #78866). 20050702 + modify parameter type in c++ binding for insch() and mvwinsch() to be consistent with underlying ncurses library (was char, is chtype). + modify treatment of Intel compiler to allow _GNU_SOURCE to be defined on Linux. + improve configure check for nanosleep(), checking that it works since some older systems such as AIX 4.3 have a nonworking version. 20050625 + update config.guess and config.sub from http://subversions.gnu.org/cgi-bin/viewcvs/config/config/ + modify misc/shlib to work in test-directory. + suppress $suffix in misc/run_tic.sh when cross-compiling. This allows cross-compiles to use the host's tic program to handle the "make install.data" step. + improve description of $LINES and $COLUMNS variables in manpages (prompted by report by Dave Ulrick). + improve description of cross-compiling in INSTALL + add NCURSES-Programming-HOWTO.html by Pradeep Padala (see http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/). + modify configure script to obtain soname for GPM library (discussion with Daniel Jacobowitz). + modify configure script so that --with-chtype option will still compute the unsigned literals suffix for constants in curses.h (report by Daniel Jacobowitz: + patches from Daniel Jacobowitz: + the man_db.renames entry for tack.1 was backwards. + tack.1 had some 1m's that should have been 1M's. + the section for curs_inwstr.3 was wrong. 20050619 + correction to --with-chtype option (report by Daniel Jacobowitz). 20050618 + move build-time edit_man.sh and edit_man.sed scripts to top directory to simplify reusing them for renaming tack's manpage (prompted by a review of Debian package). + revert minor optimization from 20041030 (Debian #313609). + libtool-specific fixes, tested with libtool 1.4.3, 1.5.0, 1.5.6, 1.5.10 and 1.5.18 (all work except as noted previously for the c++ install using libtool 1.5.0): + modify the clean-rule in c++/Makefile.in to work with IRIX64 make program. + use $(LIBTOOL_UNINSTALL) symbol, overlooked in 20030830 + add configure options --with-chtype and --with-mmask-t, to allow overriding of the non-LP64 model's use of the corresponding types. + revise test for size of chtype (and mmask_t), which always returned "long" due to an uninitialized variable (report by Daniel Jacobowitz). 20050611 + change _tracef's that used "%p" format for va_list values to ignore that, since on some platforms those are not pointers. + fixes for long-formats in printf's due to largefile support. 20050604 + fixes for termcap support: + reset pointer to _nc_curr_token.tk_name when the input stream is closed, which could point to free memory (cf: 20030215). + delink TERMTYPE data which is used by the termcap reader, so that extended names data will be freed consistently. + free pointer to TERMTYPE data in _nc_free_termtype() rather than its callers. + add some entrypoints for freeing permanently allocated data via _nc_freeall() when NO_LEAKS is defined. + amend 20041030 change to _nc_do_color to ensure that optimization is applied only when the terminal supports back_color_erase (bce). 20050528 + add sun-color terminfo entry -TD + correct a missing assignment in c++ binding's method NCursesPanel::UserPointer() from 20050409 changes. + improve configure check for large-files, adding check for dirent64 from vile -TD + minor change to configure script to improve linker options for the Ada95 tree. 20050515 + document error conditions for ncurses library functions (report by Stanislav Ievlev). + regenerated html documentation for ada binding. see ftp://invisible-island.net/ncurses/patches/gnathtml 20050507 + regenerated html documentation for manpages. + add $(BUILD_EXEEXT) suffix to invocation of make_keys in ncurses/Makefile (Gentoo #89772). + modify c++/demo.cc to build with g++ -fno-implicit-templates option (patch by Mike Frysinger). + modify tic to filter out long extended names when translating to termcap format. Only two characters are permissible for termcap capability names. 20050430 + modify terminfo entries xterm-new and rxvt to add strings for shift-, control-cursor keys. + workaround to allow c++ binding to compile with g++ 2.95.3, which has a broken implementation of static_cast<> (patch by Jeff Chua). + modify initialization of key lookup table so that if an extended capability (tic -x) string is defined, and its name begins with 'k', it will automatically be treated as a key. + modify test/keynames.c to allow for the possibility of extended key names, e.g., via define_key(), or via "tic -x". + add test/demo_termcap.c to show the contents of given entry via the termcap interface. 20050423 + minor fixes for vt100/vt52 entries -TD + add configure option --enable-largefile + corrected libraries used to build Ada95/gen/gen, found in testing gcc 4.0.0. 20050416 + update config.guess, config.sub + modify configure script check for _XOPEN_SOURCE, disable that on Darwin whose header files have problems (patch by Chris Zubrzycki). + modify form library Is_Printable_String() to use iswprint() rather than wcwidth() for determining if a character is printable. The latter caused it to reject menu items containing non-spacing characters. + modify ncurses test program's F-test to handle non-spacing characters by combining them with a reverse-video blank. + review/fix several gcc -Wconversion warnings. 20050409 + correct an off-by-one error in m_driver() for mouse-clicks used to position the mouse to a particular item. + implement test/demo_menus.c + add some checks in lib_mouse to ensure SP is set. + modify C++ binding to make 20050403 changes work with the configure --enable-const option. 20050403 + modify start_color() to return ERR if it cannot allocate memory. + address g++ compiler warnings in C++ binding by adding explicit member initialization, assignment operators and copy constructors. Most of the changes simply preserve the existing semantics of the binding, which can leak memory, etc., but by making these features visible, it provides a framework for improving the binding. + improve C++ binding using static_cast, etc. + modify configure script --enable-warnings to add options to g++ to correspond to the gcc --enable-warnings. + modify C++ binding to use some C internal functions to make it compile properly on Solaris (and other platforms). 20050327 + amend change from 20050320 to limit it to configurations with a valid locale. + fix a bug introduced in 20050320 which broke the translation of nonprinting characters to uparrow form (report by Takahashi Tamotsu). 20050326 + add ifdef's for _LP64 in curses.h to avoid using wasteful 64-bits for chtype and mmask_t, but add configure option --disable-lp64 in case anyone used that configuration. + update misc/shlib script to account for Mac OS X (report by Michail Vidiassov). + correct comparison for wrapping multibyte characters in waddch_literal() (report by Takahashi Tamotsu). 20050320 + add -c and -w options to tset to allow user to suppress ncurses' resizing of the terminal emulator window in the special case where it is not able to detect the true size (report by Win Delvaux, Debian #300419). + modify waddch_nosync() to account for locale zn_CH.GBK, which uses codes 128-159 as part of multibyte characters (report by Wang WenRui, Debian #300512). 20050319 + modify ncurses.c 'd' test to make it work with 88-color configuration, i.e., by implementing scrolling. + improve scrolling in ncurses.c 'c' and 'C' tests, e.g., for 88-color configuration. 20050312 + change tracemunch to use strict checking. + modify ncurses.c 'p' test to test line-drawing within a pad. + implement environment variable NCURSES_NO_UTF8_ACS to support miscellaneous terminal emulators which ignore alternate character set escape sequences when in UTF-8 mode. 20050305 + change NCursesWindow::err_handler() to a virtual function (request by Steve Beal). + modify fty_int.c and fty_num.c to handle wide characters (report by Wolfgang Gutjahr). + adapt fix for fty_alpha.c to fty_alnum.c, which also handled normal and wide characters inconsistently (report by Wolfgang Gutjahr). + update llib-* files to reflect internal interface additions/changes. 20050226 + improve test/configure script, adding tests for _XOPEN_SOURCE, etc., from lynx. + add aixterm-16color terminfo entry -TD + modified xterm-new terminfo entry to work with tgetent() changes -TD + extended changes in tgetent() from 20040710 to allow the substring of sgr0 which matches rmacs to be at the beginning of the sgr0 string (request by Thomas Wolff). Wolff says the visual effect in combination with pre-20040710 ncurses is improved. + fix off-by-one in winnstr() call which caused form field validation of multibyte characters to ignore the last character in a field. + correct logic in winsch() for inserting multibyte strings; the code would clear cells after the insertion rather than push them to the right (cf: 20040228). + fix an inconsistency in Check_Alpha_Field() between normal and wide character logic (report by Wolfgang Gutjahr). 20050219 + fix a bug in editing wide-characters in form library: deleting a nonwide character modified the previous wide-character. + update manpage to describe NCURSES_MOUSE_VERSION 2. + correct manpage description of mouseinterval() (Debian #280687). + add a note to default_colors.3x explaining why this extension was added (Debian #295083). + add traces to panel library. 20050212 + improve editing of wide-characters in form library: left/right cursor movement, and single-character deletions work properly. + disable GPM mouse support when $TERM happens to be prefixed with "xterm". Gpm_Open() would otherwise assert that it can deal with mouse events in this case. + modify GPM mouse support so it closes the server connection when the caller disables the mouse (report by Stanislav Ievlev). 20050205 + add traces for callback functions in form library. + add experimental configure option --enable-ext-mouse, which defines NCURSES_MOUSE_VERSION 2, and modifies the encoding of mouse events to support wheel mice, which may transmit buttons 4 and 5. This works with xterm and similar X terminal emulators (prompted by question by Andreas Henningsson, this is also related to Debian #230990). + improve configure macros CF_XOPEN_SOURCE and CF_POSIX_C_SOURCE to avoid redefinition warnings on cygwin. 20050129 + merge remaining development changes for extended colors (mostly complete, does not appear to break other configurations). + add xterm-88color.dat (part of extended colors testing). + improve _tracedump() handling of color pairs past 96. + modify return-value from start_color() to return OK if colors have already been started. + modify curs_color.3x list error conditions for init_pair(), pair_content() and color_content(). + modify pair_content() to return -1 for consistency with init_pair() if it corresponds to the default-color. + change internal representation of default-color to allow application to use color number 255. This does not affect the total number of color pairs which are allowed. + add a top-level tags rule. 20050122 + add a null-pointer check in wgetch() in case it is called without first calling initscr(). + add some null-pointer checks for SP, which is not set by libtinfo. + modify misc/shlib to ensure that absolute pathnames are used. + modify test/Makefile.in, etc., to link test programs only against the libraries needed, e.g., omit form/menu/panel library for the ones that are curses-specific. + change SP->_current_attr to a pointer, adjust ifdef's to ensure that libtinfo.so and libtinfow.so have the same ABI. The reason for this is that the corresponding data which belongs to the upper-level ncurses library has a different size in each model (report by Stanislav Ievlev). 20050115 + minor fixes to allow test-compiles with g++. + correct column value shown in tic's warnings, which did not account for leading whitespace. + add a check in _nc_trans_string() for improperly ended strings, i.e., where a following line begins in column 1. + modify _nc_save_str() to return a null pointer on buffer overflow. + improve repainting while scrolling wide-character data (Eungkyu Song). 20050108 + merge some development changes to extend color capabilities. 20050101 + merge some development changes to extend color capabilities. + fix manpage typo (FreeBSD report docs/75544). + update config.guess, config.sub > patches for configure script (Albert Chin-A-Young): + improved fix to make mbstate_t recognized on HPUX 11i (cf: 20030705), making vsscanf() prototype visible on IRIX64. Tested for on HP-UX 11i, Solaris 7, 8, 9, AIX 4.3.3, 5.2, Tru64 UNIX 4.0D, 5.1, IRIX64 6.5, Redhat Linux 7.1, 9, and RHEL 2.1, 3.0. + print the result of the --disable-home-terminfo option. + use -rpath when compiling with SGI C compiler. 20041225 + add trace calls to remaining public functions in form and menu libraries. + fix check for numeric digits in test/ncurses.c 'b' and 'B' tests. + fix typo in test/ncurses.c 'c' test from 20041218. 20041218 + revise test/ncurses.c 'c' color test to improve use for xterm-88color and xterm-256color, added 'C' test using the wide-character color_set and attr_set functions. 20041211 + modify configure script to work with Intel compiler. + fix an limit-check in wadd_wchnstr() which caused labels in the forms-demo to be one character short. + fix typo in curs_addchstr.3x (Jared Yanovich). + add trace calls to most functions in form and menu libraries. + update working-position for adding wide-characters when window is scrolled (prompted by related report by Eungkyu Song). 20041204 + replace some references on Linux to wcrtomb() which use it to obtain the length of a multibyte string with _nc_wcrtomb, since wcrtomb() is broken in glibc (see Debian #284260). + corrected length-computation in wide-character support for field_buffer(). + some fixes to frm_driver.c to allow it to accept multibyte input. + modify configure script to work with Intel 8.0 compiler. 20041127 + amend change to setupterm() in 20030405 which would reuse the value of cur_term if the same output was selected. This now reuses it only when setupterm() is called from tgetent(), which has no notion of separate SCREENs. Note that tgetent() must be called after initscr() or newterm() to use this feature (Redhat #140326). + add a check in CF_BUILD_CC macro to ensure that developer has given the --with-build-cc option when cross-compiling (report by Alexandre Campo). + improved configure script checks for _XOPEN_SOURCE and _POSIX_C_SOURCE (fix for IRIX 5.3 from Georg Schwarz, _POSIX_C_SOURCE updates from lynx). + cosmetic fix to test/gdc.c to recolor the bottom edge of the box for consistency (comment by Dan Nelson). 20041120 + update wsvt25 terminfo entry -TD + modify test/ins_wide.c to test all flavors of ins_wstr(). + ignore filler-cells in wadd_wchnstr() when adding a cchar_t array which consists of multi-column characters, since this function constructs them (cf: 20041023). + modify winnstr() to return multibyte character strings for the wide-character configuration. 20041106 + fixes to make slk_set() and slk_wset() accept and store multibyte or multicolumn characters. 20041030 + improve color optimization a little by making _nc_do_color() check if the old/new pairs are equivalent to the default pair 0. + modify assume_default_colors() to not require that use_default_colors() be called first. 20041023 + modify term_attrs() to use termattrs(), add the extended attributes such as enter_horizontal_hl_mode for WA_HORIZONTAL to term_attrs(). + add logic in waddch_literal() to clear orphaned cells when one multi-column character partly overwrites another. + improved logic for clearing cells when a multi-column character must be wrapped to a new line. + revise storage of cells for multi-column characters to correct a problem with repainting. In the old scheme, it was possible for doupdate() to decide that only part of a multi-column character should be repainted since the filler cells stored only an attribute to denote them as fillers, rather than the character value and the attribute. 20041016 + minor fixes for traces. + add SP->_screen_acs_map[], used to ensure that mapping of missing line-drawing characters is handled properly. For example, ACS_DARROW is absent from xterm-new, and it was coincidentally displayed the same as ACS_BTEE. 20041009 + amend 20021221 workaround for broken acs to reset the sgr, rmacs and smacs strings as well. Also modify the check for screen's limitations in that area to allow the multi-character shift-in and shift-out which seem to work. + change GPM initialization, using dl library to load it dynamically at runtime (Debian #110586). 20041002 + correct logic for color pair in setcchar() and getcchar() (patch by Marcin 'Qrczak' Kowalczyk). + add t/T commands to ncurses b/B tests to allow a different color to be tested for the attrset part of the test than is used in the background color. 20040925 + fix to make setcchar() to work when its wchar_t* parameter is pointing to a string which contains more data than can be converted. + modify wget_wstr() and example in ncurses.c to work if wchar_t and wint_t are different sizes (report by Marcin 'Qrczak' Kowalczyk). 20040918 + remove check in wget_wch() added to fix an infinite loop, appears to have been working around a transitory glibc bug, and interferes with normal operation (report by Marcin 'Qrczak' Kowalczyk). + correct wadd_wch() and wecho_wch(), which did not pass the rendition information (report by Marcin 'Qrczak' Kowalczyk). + fix aclocal.m4 so that the wide-character version of ncurses gets compiled as libncursesw.5.dylib, instead of libncurses.5w.dylib (adapted from patch by James J Ramsey). + change configure script for --with-caps option to indicate that it is no longer experimental. + change configure script to reflect the fact that --enable-widec has not been "experimental" since 5.3 (report by Bruno Lustosa). 20040911 + add 'B' test to ncurses.c, to exercise some wide-character functions. 20040828 + modify infocmp -i option to match 8-bit controls against its table entries, e.g., so it can analyze the xterm-8bit entry. + add morphos terminfo entry, improve amiga-8bit entry (Pavel Fedin). + correct translation of "%%" in terminfo format to termcap, e.g., using "tic -C" (Redhat #130921). + modified configure script CF_XOPEN_SOURCE macro to ensure that if it defines _POSIX_C_SOURCE, that it defines it to a specific value (comp.os.stratus newsgroup comment). 20040821 + fixes to build with Ada95 binding with gnat 3.4 (all warnings are fatal, and gnat does not follow the guidelines for pragmas). However that did find a coding error in Assume_Default_Colors(). + modify several terminfo entries to ensure xterm mouse and cursor visibility are reset in rs2 string: hurd, putty, gnome, konsole-base, mlterm, Eterm, screen (Debian #265784, Debian #55637). The xterm entries are left alone - old ones for compatibility, and the new ones do not require this change. -TD 20040814 + fake a SIGWINCH in newterm() to accommodate buggy terminal emulators and window managers (Debian #265631). > terminfo updates -TD + remove dch/dch1 from rxvt because they are implemented inconsistently with the common usage of bce/ech + remove khome from vt220 (vt220's have no home key) + add rxvt+pcfkeys 20040807 + modify test/ncurses.c 'b' test, adding v/V toggles to cycle through combinations of video attributes so that for instance bold and underline can be tested. This made the legend too crowded, added a help window as well. + modify test/ncurses.c 'b' test to cycle through default colors if the -d option is set. + update putty terminfo entry (Robert de Bath). 20040731 + modify test/cardfile.c to allow it to read more data than can be displayed. + correct logic in resizeterm.c which kept it from processing all levels of window hierarchy (reports by Folkert van Heusden, Chris Share). 20040724 + modify "tic -cv" to ignore delays when comparing strings. Also modify it to ignore a canceled sgr string, e.g., for terminals which cannot properly combine attributes in one control sequence. + corrections for gnome and konsole entries (Redhat #122815, patch by Hans de Goede) > terminfo updates -TD + make ncsa-m rmacs/smacs consistent with sgr + add sgr, rc/sc and ech to syscons entries + add function-keys to decansi + add sgr to mterm-ansi + add sgr, civis, cnorm to emu + correct/simplify cup in addrinfo 20040717 > terminfo updates -TD + add xterm-pc-fkeys + review/update gnome and gnome-rh90 entries (prompted by Redhat #122815). + review/update konsole entries + add sgr, correct sgr0 for kterm and mlterm + correct tsl string in kterm 20040711 + add configure option --without-xterm-new 20040710 + add check in wget_wch() for printable bytes that are not part of a multibyte character. + modify wadd_wchnstr() to render text using window's background attributes. + improve tic's check to compare sgr and sgr0. + fix c++ directory's .cc.i rule. + modify logic in tgetent() which adjusts the termcap "me" string to work with ISO-2022 string used in xterm-new (cf: 20010908). + modify tic's check for conflicting function keys to omit that if converting termcap to termcap format. + add -U option to tic and infocmp. + add rmam/smam to linux terminfo entry (Trevor Van Bremen) > terminfo updates -TD + minor fixes for emu + add emu-220 + change wyse acsc strings to use 'i' map rather than 'I' + fixes for avatar0 + fixes for vp3a+ 20040703 + use tic -x to install terminfo database -TD + add -x to infocmp's usage message. + correct field used for comparing O_ROWMAJOR in set_menu_format() (report/patch by Tony Li). + fix a missing nul check in set_field_buffer() from 20040508 changes. > terminfo updates -TD + make xterm-xf86-v43 derived from xterm-xf86-v40 rather than xterm-basic -TD + align with xterm patch #192's use of xterm-new -TD + update xterm-new and xterm-8bit for cvvis/cnorm strings -TD + make xterm-new the default "xterm" entry -TD 20040626 + correct BUILD_CPPFLAGS substitution in ncurses/Makefile.in, to allow cross-compiling from a separate directory tree (report/patch by Dan Engel). + modify is_term_resized() to ensure that window sizes are nonzero, as documented in the manpage (report by Ian Collier). + modify CF_XOPEN_SOURCE configure macro to make Hurd port build (Debian #249214, report/patch by Jeff Bailey). + configure-script mods from xterm, e.g., updates to CF_ADD_CFLAGS + update config.guess, config.sub > terminfo updates -TD + add mlterm + add xterm-xf86-v44 + modify xterm-new aka xterm-xfree86 to accommodate luit, which relies on G1 being used via an ISO-2022 escape sequence (report by Juliusz Chroboczek) + add 'hurd' entry 20040619 + reconsidered winsnstr(), decided after comparing other implementations that wrapping is an X/Open documentation error. + modify test/inserts.c to test all flavors of insstr(). 20040605 + add setlocale() calls to a few test programs which may require it: demo_forms.c, filter.c, ins_wide.c, inserts.c + correct a few misspelled function names in ncurses-intro.html (report by Tony Li). + correct internal name of key_defined() manpage, which conflicted with define_key(). 20040529 + correct size of internal pad used for holding wide-character field_buffer() results. + modify data_ahead() to work with wide-characters. 20040522 + improve description of terminfo if-then-else expressions (suggested by Arne Thomassen). + improve test/ncurses.c 'd' test, allow it to use external file for initial palette (added xterm-16color.dat and linux-color.dat), and reset colors to the initial palette when starting/ending the test. + change limit-check in init_color() to allow r/g/b component to reach 1000 (cf: 20020928). 20040516 + modify form library to use cchar_t's rather than char's in the wide-character configuration for storing data for field buffers. + correct logic of win_wchnstr(), which did not work for more than one cell. 20040508 + replace memset/memcpy usage in form library with for-loops to simplify changing the datatype of FIELD.buf, part of wide-character changes. + fix some inconsistent use of #if/#ifdef (report by Alain Guibert). 20040501 + modify menu library to account for actual number of columns used by multibyte character strings, in the wide-character configuration (adapted from patch by Philipp Tomsich). + add "-x" option to infocmp like tic's "-x", for use in "-F" comparisons. This modifies infocmp to only report extended capabilities if the -x option is given, making this more consistent with tic. Some scripts may break, since infocmp previous gave this information without an option. + modify termcap-parsing to retain 2-character aliases at the beginning of an entry if the "-x" option is used in tic. 20040424 + minor compiler-warning and test-program fixes. 20040417 + modify tic's missing-sgr warning to apply to terminfo only. + free some memory leaks in tic. + remove check in post_menu() that prevented menus from extending beyond the screen (request by Max J. Werner). + remove check in newwin() that prevents allocating windows that extend beyond the screen. Solaris curses does this. + add ifdef in test/color_set.c to allow it to compile with older curses. + add napms() calls to test/dots.c to make it not be a CPU hog. 20040403 + modify unctrl() to return null if its parameter does not correspond to an unsigned char. + add some limit-checks to guard isprint(), etc., from being used on values that do not fit into an unsigned char (report by Sami Farin). 20040328 + fix a typo in the _nc_get_locale() change. 20040327 + modify _nc_get_locale() to use setlocale() to query the program's current locale rather than using getenv(). This fixes a case in tin which relies on legacy treatment of 8-bit characters when the locale is not initialized (reported by Urs Jansen). + add sgr string to screen's and rxvt's terminfo entries -TD. + add a check in tic for terminfo entries having an sgr0 but no sgr string. This confuses Tru64 and HPUX curses when combined with color, e.g., making them leave line-drawing characters in odd places. + correct casts used in ABSENT_BOOLEAN, CANCELLED_BOOLEAN, matches the original definitions used in Debian package to fix PowerPC bug before 20030802 (Debian #237629). 20040320 + modify PutAttrChar() and PUTC() macro to improve use of A_ALTCHARSET attribute to prevent line-drawing characters from being lost in situations where the locale would otherwise treat the raw data as nonprintable (Debian #227879). 20040313 + fix a redefinition of CTRL() macro in test/view.c for AIX 5.2 (report by Jim Idle). + remove ".PP" after ".SH NAME" in a few manpages; this confuses some apropos script (Debian #237831). 20040306 + modify ncurses.c 'r' test so editing commands, like inserted text, set the field background, and the state of insert/overlay editing mode is shown in that test. + change syntax of dummy targets in Ada95 makefiles to work with pmake. + correct logic in test/ncurses.c 'b' for noncolor terminals which did not recognize a quit-command (cf: 20030419). 20040228 + modify _nc_insert_ch() to allow for its input to be part of a multibyte string. + split out lib_insnstr.c, to prepare to rewrite it. X/Open states that this function performs wrapping, unlike all of the other insert-functions. Currently it does not wrap. + check for nl_langinfo(CODESET), use it if available (report by Stanislav Ievlev). + split-out CF_BUILD_CC macro, actually did this for lynx first. + fixes for configure script CF_WITH_DBMALLOC and CF_WITH_DMALLOC, which happened to work with bash, but not with Bourne shell (report by Marco d'Itri via tin-dev). 20040221 + some changes to adapt the form library to wide characters, incomplete (request by Mike Aubury). + add symbol to curses.h which can be used to suppress include of stdbool.h, e.g., #define NCURSES_ENABLE_STDBOOL_H 0 #include (discussion on XFree86 mailing list). 20040214 + modify configure --with-termlib option to accept a value which sets the name of the terminfo library. This would allow a packager to build libtinfow.so renamed to coincide with libtinfo.so (discussion with Stanislav Ievlev). + improve documentation of --with-install-prefix, --prefix and $(DESTDIR) in INSTALL (prompted by discussion with Paul Lew). + add configure check if the compiler can use -c -o options to rename its output file, use that to omit the 'cd' command which was used to ensure object files are created in a separate staging directory (prompted by comments by Johnny Wezel, Martin Mokrejs). 20040208 5.4 release for upload to ftp.gnu.org + update TO-DO. 20040207 pre-release + minor fixes to _nc_tparm_analyze(), i.e., do not count %i as a param, and do not count %d if it follows a %p. + correct an inconsistency between handling of codes in the 128-255 range, e.g., as illustrated by test/ncurses.c f/F tests. In POSIX locale, the latter did not show printable results, while the former did. + modify MKlib_gen.sh to compensate for broken C preprocessor on Mac OS X, which alters "%%" to "% % " (report by Robert Simms, fix verified by Scott Corscadden). 20040131 pre-release + modify SCREEN struct to align it between normal/wide curses flavors to simplify future changes to build a single version of libtinfo (patch by Stanislav Ievlev). + document handling of carriage return by addch() in manpage. + document special features of unctrl() in manpage. + documented interface changes in INSTALL. + corrected control-char test in lib_addch.c to account for locale (Debian #230335, cf: 971206). + updated test/configure.in to use AC_EXEEXT and AC_OBJEXT. + fixes to compile Ada95 binding with Debian gnat 3.15p-4 package. + minor configure-script fixes for older ports, e.g., BeOS R4.5. 20040125 pre-release + amend change to PutAttrChar() from 20030614 which computed the number of cells for a possibly multi-cell character. The 20030614 change forced the cell to a blank if the result from wcwidth() was not greater than zero. However, wcwidth() called for parameters in the range 128-255 can give this return value. The logic now simply ensures that the number of cells is greater than zero without modifying the displayed value. 20040124 pre-release + looked good for 5.4 release for upload to ftp.gnu.org (but see above) + modify configure script check for ranlib to use AC_CHECK_TOOL, since that works better for cross-compiling. 20040117 pre-release + modify lib_get_wch.c to prefer mblen/mbtowc over mbrlen/mbrtowc to work around core dump in Solaris 8's locale support, e.g., for zh_CN.GB18030 (report by Saravanan Bellan). + add includes for and in configure script macro to make check work with Tru64 4.0d. + add terminfo entry for U/Win -TD + add terminfo entries for SFU aka Interix aka OpenNT (Federico Bianchi). + modify tput's error messages to prefix them with the program name (report by Vincent Lefevre, patch by Daniel Jacobowitz (see Debian #227586)). + correct a place in tack where exit_standout_mode was used instead of exit_attribute_mode (patch by Jochen Voss (see Debian #224443)). + modify c++/cursesf.h to use const in the Enumeration_Field method. + remove an ambiguous (actually redundant) method from c++/cursesf.h + make $HOME/.terminfo update optional (suggested by Stanislav Ievlev). + improve sed script which extracts libtool's version in the CF_WITH_LIBTOOL macro. + add ifdef'd call to AC_PROG_LIBTOOL to CF_WITH_LIBTOOL macro (to simplify local patch for Albert Chin-A-Young).. + add $(CXXFLAGS) to link command in c++/Makefile.in (adapted from patch by Albert Chin-A-Young).. + fix a missing substitution in configure.in for "$target" needed for HPUX .so/.sl case. + resync CF_XOPEN_SOURCE configure macro with lynx; fixes IRIX64 and NetBSD 1.6 conflicts with _XOPEN_SOURCE. + make check for stdbool.h more specific, to ensure that including it will actually define/declare bool for the configured compiler. + rewrite ifdef's in curses.h relating NCURSES_BOOL and bool. The intention of that is to #define NCURSES_BOOL as bool when the compiler declares bool, and to #define bool as NCURSES_BOOL when it does not (reported by Jim Gifford, Sam Varshavchik, cf: 20031213). 20040110 pre-release + change minor version to 4, i.e., ncurses 5.4 + revised/improved terminfo entries for tvi912b, tvi920b (Benjamin C W Sittler). + simplified ncurses/base/version.c by defining the result from the configure script rather than using sprintf (suggested by Stanislav Ievlev). + remove obsolete casts from c++/cursesw.h (reported by Stanislav Ievlev). + modify configure script so that when configuring for termlib, programs such as tic are not linked with the upper-level ncurses library (suggested by Stanislav Ievlev). + move version.c from ncurses/base to ncurses/tinfo to allow linking of tic, etc., using libtinfo (suggested by Stanislav Ievlev). 20040103 + adjust -D's to build ncursesw on OpenBSD. + modify CF_PROG_EXT to make OS/2 build with EXEEXT. + add pecho_wchar(). + remove include from lib_slk_wset.c which is not needed (or available) on older platforms. 20031227 + add -D's to build ncursew on FreeBSD 5.1. + modify shared library configuration for FreeBSD 4.x/5.x to add the soname information (request by Marc Glisse). + modify _nc_read_tic_entry() to not use MAX_ALIAS, but PATH_MAX only for limiting the length of a filename in the terminfo database. + modify termname() to return the terminal name used by setupterm() rather than $TERM, without truncating to 14 characters as documented by X/Open (report by Stanislav Ievlev, cf: 970719). + re-add definition for _BSD_TYPES, lost in merge (cf: 20031206). 20031220 + add configure option --with-manpage-format=catonly to address behavior of BSDI, allow install of man+cat files on NetBSD, whose behavior has diverged by requiring both to be present. + remove leading blanks from comment-lines in manlinks.sed script to work with Tru64 4.0d. + add screen.linux terminfo entry (discussion on mutt-users mailing list). 20031213 + add a check for tic to flag missing backslashes for termcap continuation lines. ncurses reads the whole entry, but termcap applications do not. + add configure option "--with-manpage-aliases" extending "--with-manpage-aliases" to provide the option of generating ".so" files rather than symbolic links for manpage aliases. + add bool definition in include/curses.h.in for configurations with no usable C++ compiler (cf: 20030607). + fix pathname of SigAction.h for building with --srcdir (reported by Mike Castle). 20031206 + folded ncurses/base/sigaction.c into includes of ncurses/SigAction.h, since that header is used only within ncurses/tty/lib_tstp.c, for non-POSIX systems (discussion with Stanislav Ievlev). + remove obsolete _nc_outstr() function (report by Stanislav Ievlev ). + add test/background.c and test/color_set.c + modify color_set() function to work with color pair 0 (report by George Andreou ). + add configure option --with-trace, since defining TRACE seems too awkward for some cases. + remove a call to _nc_free_termtype() from read_termtype(), since the corresponding buffer contents were already zeroed by a memset (cf: 20000101). + improve configure check for _XOPEN_SOURCE and related definitions, adding special cases for Solaris' __EXTENSIONS__ and FreeBSD's __BSD_TYPES (reports by Marc Glisse ). + small fixes to compile on Solaris and IRIX64 using cc. + correct typo in check for pre-POSIX sort options in MKkey_defs.sh (cf: 20031101). 20031129 + modify _nc_gettime() to avoid a problem with arithmetic on unsigned values (Philippe Blain). + improve the nanosleep() logic in napms() by checking for EINTR and restarting (Philippe Blain). + correct expression for "%D" in lib_tgoto.c (Juha Jarvi ). 20031122 + add linux-vt terminfo entry (Andrey V Lukyanov ). + allow "\|" escape in terminfo; tic should not warn about this. + save the full pathname of the trace-file the first time it is opened, to avoid creating it in different directories if the application opens and closes it while changing its working directory. + modify configure script to provide a non-empty default for $BROKEN_LINKER 20031108 + add DJGPP to special case of DOS-style drive letters potentially appearing in TERMCAP environment variable. + fix some spelling in comments (reports by Jason McIntyre, Jonathon Gray). + update config.guess, config.sub 20031101 + fix a memory leak in error-return from setupterm() (report by Stanislav Ievlev ). + use EXEEXT and OBJEXT consistently in makefiles. + amend fixes for cross-compiling to use separate executable-suffix BUILD_EXEEXT (cf: 20031018). + modify MKkey_defs.sh to check for sort utility that does not recognize key options, e.g., busybox (report by Peter S Mazinger ). + fix potential out-of-bounds indexing in _nc_infotocap() (found by David Krause using some of the new malloc debugging features under OpenBSD, patch by Ted Unangst). + modify CF_LIB_SUFFIX for Itanium releases of HP-UX, which use a ".so" suffix (patch by Jonathan Ward ). 20031025 + update terminfo for xterm-xfree86 -TD + add check for multiple "tc=" clauses in a termcap to tic. + check for missing op/oc in tic. + correct _nc_resolve_uses() and _nc_merge_entry() to allow infocmp and tic to show cancelled capabilities. These functions were ignoring the state of the target entry, which should be untouched if cancelled. + correct comment in tack/output.c (Debian #215806). + add some null-pointer checks to lib_options.c (report by Michael Bienia). + regenerated html documentation. + correction to tar-copy.sh, remove a trap command that resulted in leaving temporary files (cf: 20030510). + remove contact/maintainer addresses for Juergen Pfeifer (his request). 20031018 + updated test/configure to reflect changes for libtool (cf: 20030830). + fix several places in tack/pad.c which tested and used the parameter- and parameterless strings inconsistently, i.e., in pad_rin(), pad_il(), pad_indn() and pad_dl() (Debian #215805). + minor fixes for configure script and makefiles to cleanup executables generated when cross-compiling for DJGPP. + modify infocmp to omit check for $TERM for operations that do not require it, e.g., "infocmp -e" used to build fallback list (report by Egmont Koblinger). 20031004 + add terminfo entries for DJGPP. + updated note about maintainer in ncurses-intro.html 20030927 + update terminfo entries for gnome terminal. + modify tack to reset colors after each color test, correct a place where exit_standout_mode was used instead of exit_attribute_mode. + improve tack's bce test by making it set colors other than black on white. + plug a potential recursion between napms() and _nc_timed_wait() (report by Philippe Blain). 20030920 + add --with-rel-version option to allow workaround to allow making libtool on Darwin generate the "same" library names as with the --with-shared option. The Darwin ld program does not work well with a zero as the minor-version value (request by Chris Zubrzycki). + modify CF_MIXEDCASE_FILENAMES macro to work with cross-compiling. + modify tack to allow it to run from fallback terminfo data. > patch by Philippe Blain: + improve PutRange() by adjusting call to EmitRange() and corresponding return-value to not emit unchanged characters on the end of the range. + improve a check for changed-attribute by exiting a loop when the change is found. + improve logic in TransformLine(), eliminating a duplicated comparison in the clr_bol logic. 20030913 > patch by Philippe Blain: + in ncurses/tty/lib_mvcur.c, move the label 'nonlocal' just before the second gettimeofday() to be able to compute the diff time when 'goto nonlocal' used. Rename 'msec' to 'microsec' in the debug-message. + in ncurses/tty/lib_mvcur.c, Use _nc_outch() in carriage return/newline movement instead of putchar() which goes to stdout. Move test for xold>0 out of loop. + in ncurses/tinfo/setbuf.c, Set the flag SP->_buffered at the end of operations when all has been successful (typeMalloc can fail). + simplify NC_BUFFERED macro by moving check inside _nc_setbuf(). 20030906 + modify configure script to avoid using "head -1", which does not work if POSIXLY_CORRECT (sic) is set. + modify run_tic.in to avoid using wrong shared libraries when cross-compiling (Dan Kegel). 20030830 + alter configure script help message to make it clearer that --with-build-cc does not specify a cross-compiler (suggested by Dan Kegel ). + modify configure script to accommodate libtool 1.5, as well as add an parameter to the "--with-libtool" option which can specify the pathname of libtool (report by Chris Zubrzycki). We note that libtool 1.5 has more than one bug in its C++ support, so it is not able to install libncurses++, for instance, if $DESTDIR or the option --with-install-prefix is used. 20030823 > patch by Philippe Blain: + move assignments to SP->_cursrow, SP->_curscol into online_mvcur(). + make baudrate computation in delay_output() consistent with the assumption in _nc_mvcur_init(), i.e., a byte is 9 bits. 20030816 + modify logic in waddch_literal() to take into account zh_TW.Big5 whose multibyte sequences may contain "printable" characters, e.g., a "g" in the sequence "\247g" (Debian #204889, cf: 20030621). + improve storage used by _nc_safe_strcpy() by ensuring that the size is reset based on the initialization call, in case it were called after other strcpy/strcat calls (report by Philippe Blain). > patch by Philippe Blain: + remove an unused ifdef for REAL_ATTR & WANT_CHAR + correct a place where _cup_cost was used rather than _cuu_cost 20030809 + fix a small memory leak in _nc_free_termtype(). + close trace-file if trace() is called with a zero parameter. + free memory allocated for soft-key strings, in delscreen(). + fix an allocation size in safe_sprintf.c for the "*" format code. + correct safe_sprintf.c to not return a null pointer if the format happens to be an empty string. This applies to the "configure --enable-safe-sprintf" option (Redhat #101486). 20030802 + modify casts used for ABSENT_BOOLEAN and CANCELLED_BOOLEAN (report by Daniel Jacobowitz). > patch by Philippe Blain: + change padding for change_scroll_region to not be proportional to the size of the scroll-region. + correct error-return in _nc_safe_strcat(). 20030726 + correct limit-checks in _nc_scroll_window() (report and test-case by Thomas Graf cf: 20011020). + re-order configure checks for _XOPEN_SOURCE to avoid conflict with _GNU_SOURCE check. 20030719 + use clr_eol in preference to blanks for bce terminals, so select and paste will have fewer trailing blanks, e.g., when using xterm (request by Vincent Lefevre). + correct prototype for wunctrl() in manpage. + add configure --with-abi-version option (discussion with Charles Wilson). > cygwin changes from Charles Wilson: + aclocal.m4: on cygwin, use autodetected prefix for import and static lib, but use "cyg" for DLL. + include/ncurses_dll.h: correct the comments to reflect current status of cygwin/mingw port. Fix compiler warning. + misc/run_tic.in: ensure that tic.exe can find the uninstalled DLL, by adding the lib-directory to the PATH variable. + misc/terminfo.src (nxterm|xterm-color): make xterm-color primary instead of nxterm, to match XFree86's xterm.terminfo usage and to prevent circular links. (rxvt): add additional codes from rxvt.org. (rxvt-color): new alias (rxvt-xpm): new alias (rxvt-cygwin): like rxvt, but with special acsc codes. (rxvt-cygwin-native): ditto. rxvt may be run under XWindows, or with a "native" MSWin GUI. Each takes different acsc codes, which are both different from the "normal" rxvt's acsc. (cygwin): cygwin-in-cmd.exe window. Lots of fixes. (cygwinDBG): ditto. + mk-1st.awk: use "cyg" for the DLL prefix, but "lib" for import and static libs. 20030712 + update config.guess, config.sub + add triples for configuring shared libraries with the Debian GNU/FreeBSD packages (patch by Robert Millan ). 20030705 + modify CF_GCC_WARNINGS so it only applies to gcc, not g++. Some platforms have installed g++ along with the native C compiler, which would not accept gcc warning options. + add -D_XOPEN_SOURCE=500 when configuring with --enable-widec, to get mbstate_t declaration on HPUX 11.11 (report by David Ellement). + add _nc_pathlast() to get rid of casts in _nc_basename() calls. + correct a sign-extension in wadd_wch() and wecho_wchar() from 20030628 (report by Tomohiro Kubota). + work around omission of btowc() and wctob() from wide-character support (sic) in NetBSD 1.6 using mbtowc() and wctomb() (report by Gabor Z Papp). + add portability note to curs_get_wstr.3x (Debian #199957). 20030628 + rewrite wadd_wch() and wecho_wchar() to call waddch() and wechochar() respectively, to avoid calling waddch_noecho() with wide-character data, since that function assumes its input is 8-bit data. Similarly, modify waddnwstr() to call wadd_wch(). + remove logic from waddnstr() which transformed multibyte character strings into wide-characters. Rewrite of waddch_literal() from 20030621 assumes its input is raw multibyte data rather than wide characters (report by Tomohiro Kubota). 20030621 + write getyx() and related 2-return macros in terms of getcury(), getcurx(), etc. + modify waddch_literal() in case an application passes bytes of a multibyte character directly to waddch(). In this case, waddch() must reassemble the bytes into a wide-character (report by Tomohiro Kubota ). 20030614 + modify waddch_literal() in case a multibyte value occupies more than two cells. + modify PutAttrChar() to compute the number of character cells that are used in multibyte values. This fixes a problem displaying double-width characters (report/test by Mitsuru Chinen ). + add a null-pointer check for result of keyname() in _tracechar() + modify _tracechar() to work around glibc sprintf bug. 20030607 + add a call to setlocale() in cursesmain.cc, making demo display properly in a UTF-8 locale. + add a fallback definition in curses.priv.h for MB_LEN_MAX (prompted by discussion with Gabor Z Papp). + use macros NCURSES_ACS() and NCURSES_WACS() to hide cast needed to appease -Wchar-subscript with g++ 3.3 (Debian #195732). + fix a redefinition of $RANLIB in the configure script when libtool is used, which broke configure on Mac OS X (report by Chris Zubrzycki ). + simplify ifdef for bool declaration in curses.h.in (suggested by Albert Chin-A-Young). + remove configure script check to allow -Wconversion for older versions of gcc (suggested by Albert Chin-A-Young). 20030531 + regenerated html manpages. + modify ifdef's in curses.h.in that disabled use of __attribute__() for g++, since recent versions implement the cases which ncurses uses (Debian #195230). + modify _nc_get_token() to handle a case where an entry has no description, and capabilities begin on the same line as the entry name. + fix a typo in ncurses_dll.h reported by gcc 3.3. + add an entry for key_defined.3x to man_db.renames. 20030524 + modify setcchar() to allow converting control characters to complex characters (report/test by Mitsuru Chinen ). + add tkterm entry -TD + modify parse_entry.c to allow a terminfo entry with a leading 2-character name (report by Don Libes). + corrected acsc in screen.teraterm, which requires a PC-style mapping. + fix trace statements in read_entry.c to use lseek() rather than tell(). + fix signed/unsigned warnings from Sun's compiler (gcc should give these warnings, but it is unpredictable). + modify configure script to omit -Winline for gcc 3.3, since that feature is broken. + modify manlinks.sed to add a few functions that were overlooked since they return function pointers: field_init, field_term, form_init, form_term, item_init, item_term, menu_init and menu_term. 20030517 + prevent recursion in wgetch() via wgetnstr() if the connection cannot be switched between cooked/raw modes because it is not a TTY (report by Wolfgang Gutjahr ). + change parameter of define_key() and key_defined() to const (prompted by Debian #192860). + add a check in test/configure for ncurses extensions, since there are some older versions, etc., which would not compile with the current test programs. + corrected demo in test/ncurses.c of wgetn_wstr(), which did not convert wchar_t string to multibyte form before printing it. + corrections to lib_get_wstr.c: + null-terminate buffer passed to setcchar(), which occasionally failed. + map special characters such as erase- and kill-characters into key-codes so those will work as expected even if they are not mentioned in the terminfo. + modify PUTC() and Charable() macros to make wide-character line drawing work for POSIX locale on Linux console (cf: 20021221). 20030510 + make typography for program options in manpages consistent (report by Miloslav Trmac ). + correct dependencies in Ada95/src/Makefile.in, so the builds with "--srcdir" work (report by Warren L Dodge). + correct missing definition of $(CC) in Ada95/gen/Makefile.in (reported by Warren L Dodge ). + fix typos and whitespace in manpages (patch by Jason McIntyre ). 20030503 + fix form_driver() cases for REQ_CLR_EOF, REQ_CLR_EOL, REQ_DEL_CHAR, REQ_DEL_PREV and REQ_NEW_LINE, which did not ensure the cursor was at the editing position before making modifications. + add test/demo_forms and associated test/edit_field.c demos. + modify test/configure.in to use test/modules for the list of objects to compile rather than using the list of programs. 20030419 + modify logic of acsc to use the original character if no mapping is defined, noting that Solaris does this. + modify ncurses 'b' test to avoid using the acs_map[] array since 20021231 changes it to no longer contain information from the acsc string. + modify makefile rules in c++, progs, tack and test to ensure that the compiler flags (e.g., $CFLAGS or $CCFLAGS) are used in the link command (report by Jose Luis Rico Botella ). + modify soft-key initialization to use A_REVERSE if A_STANDOUT would not be shown when colors are used, i.e., if ncv#1 is set in the terminfo as is done in "screen". 20030412 + add a test for slk_color(), in ncurses.c + fix some issues reported by valgrind in the slk_set() and slk_wset() code, from recent rewrite. + modify ncurses 'E' test to use show previous label via slk_label(), as in 'e' test. + modify wide-character versions of NewChar(), NewChar2() macros to ensure that the whole struct is initialized. 20030405 + modify setupterm() to check if the terminfo and terminal-modes have already been read. This ensures that it does not reinvoke def_prog_mode() when an application calls more than one function, such as tgetent() and initscr() (report by Olaf Buddenhagen). 20030329 + add 'E' test to ncurses.c, to exercise slk_wset(). + correct handling of carriage-return in wgetn_wstr(), used in demo of slk_wset(). + first draft of slk_wset() function. 20030322 + improved warnings in tic when suppressing items to fit in termcap's 1023-byte limit. + built a list in test/README showing which externals are being used by either programs in the test-directory or via internal library calls. + adjust include-options in CF_ETIP_DEFINES to avoid missing ncurses_dll.h, fixing special definitions that may be needed for etip.h (reported by Greg Schafer ). 20030315 + minor fixes for cardfile.c, to make it write the updated fields to a file when ^W is given. + add/use _nc_trace_bufcat() to eliminate some fixed buffer limits in trace code. 20030308 + correct a case in _nc_remove_string(), used by define_key(), to avoid infinite loop if the given string happens to be a substring of other strings which are assigned to keys (report by John McCutchan). + add key_defined() function, to tell which keycode a string is bound to (discussion with John McCutchan ). + correct keybound(), which reported definitions in the wrong table, i.e., the list of definitions which are disabled by keyok(). + modify demo_keydef.c to show the details it changes, and to check for errors. 20030301 + restructured test/configure script, make it work for libncursesw. + add description of link_fieldtype() to manpage (report by L Dee Holtsclaw ). 20030222 + corrected ifdef's relating to configure check for wchar_t, etc. + if the output is a socket or other non-tty device, use 1 millisecond for the cost in mvcur; previously it was 9 milliseconds because the baudrate was not known. + in _nc_get_tty_mode(), initialize the TTY buffer on error, since glibc copies uninitialized data in that case, as noted by valgrind. + modify tput to use the same parameter analysis as tparm() does, to provide for user-defined strings, e.g., for xterm title, a corresponding capability might be title=\E]2;%p1%s^G, + modify MKlib_gen.sh to avoid passing "#" tokens through the C preprocessor. This works around Mac OS X's preprocessor, which insists on adding a blank on each side of the token (report/analysis by Kevin Murphy ). 20030215 + add configure check for wchar_t and wint_t types, rather than rely on preprocessor definitions. Also work around for gcc fixinclude bug which creates a shadow copy of curses.h if it sees these symbols apparently typedef'd. + if database is disabled, do not generate run_tic.sh + minor fixes for memory-leak checking when termcap is read. 20030208 + add checking in tic for incomplete line-drawing character mapping. + updated configure script to reflect fix for AC_PROG_GCC_TRADITIONAL, which is broken in autoconf 2.5x for Mac OS X 10.2.3 (report by Gerben Wierda ). + make return value from _nc_printf_string() consistent. Before, depending on whether --enable-safe-sprintf was used, it might not be cached for reallocating. 20030201 + minor fixes for memory-leak checking in lib_tparm.c, hardscroll.c + correct a potentially-uninitialized value if _read_termtype() does not read as much data as expected (report by Wolfgang Rohdewald ). + correct several places where the aclocal.m4 macros relied on cache variable names which were incompatible (as usual) between autoconf 2.13 and 2.5x, causing the test for broken-linker to give incorrect results (reports by Gerben Wierda and Thomas Esser ). + do not try to open gpm mouse driver if standard output is not a tty; the gpm library does not make this check (bug report for dialog by David Oliveira ). 20030125 + modified emx.src to correspond more closely to terminfo.src, added emx-base to the latter -TD + add configure option for FreeBSD sysmouse, --with-sysmouse, and implement support for that in lib_mouse.c, lib_getch.c 20030118 + revert 20030105 change to can_clear_with(), does not work for the case where the update is made on cells which are blanks with attributes, e.g., reverse. + improve ifdef's to guard against redefinition of wchar_t and wint_t in curses.h (report by Urs Jansen). 20030111 + improve mvcur() by checking if it is safe to move when video attributes are set (msgr), and if not, reset/restore attributes within that function rather than doing it separately in the GoTo() function in tty_update.c (suggested by Philippe Blain). + add a message in run_tic.in to explain more clearly what does not work when attempting to create a symbolic link for /usr/lib/terminfo on OS/2 and other platforms with no symbolic links (report by John Polterak). + change several sed scripts to avoid using "\+" since it is not a BRE (basic regular expression). One instance caused terminfo.5 to be misformatted on FreeBSD (report by Kazuo Horikawa (see FreeBSD docs/46709)). + correct misspelled 'wint_t' in curs_get_wch.3x (Michael Elkins). 20030105 + improve description of terminfo operators, especially static/dynamic variables (comments by Mark I Manning IV ). + demonstrate use of FIELDTYPE by modifying test/ncurses 'r' test to use the predefined TYPE_ALPHA field-type, and by defining a specialized type for the middle initial/name. + fix MKterminfo.sh, another workaround for POSIXLY_CORRECT misfeature of sed 4.0 > patch by Philippe Blain: + optimize can_clear_with() a little by testing first if the parameter is indeed a "blank". + simplify ClrBottom() a little by allowing it to use clr_eos to clear sections as small as one line. + improve ClrToEOL() by checking if clr_eos is available before trying to use it. + use tputs() rather than putp() in a few cases in tty_update.c since the corresponding delays are proportional to the number of lines affected: repeat_char, clr_eos, change_scroll_region. 20021231 + rewrite of lib_acs.c conflicts with copying of SCREEN acs_map to/from global acs_map[] array; removed the lines that did the copying. 20021228 + change some overlooked tputs() calls in scrolling code to use putp() (report by Philippe Blain). + modify lib_getch.c to avoid recursion via wgetnstr() when the input is not a tty and consequently mode-changes do not work (report by ). + rewrote lib_acs.c to allow PutAttrChar() to decide how to render alternate-characters, i.e., to work with Linux console and UTF-8 locale. + correct line/column reference in adjust_window(), needed to make special windows such as curscr track properly when resizing (report by Lucas Gonze ). > patch by Philippe Blain: + correct the value used for blank in ClrBottom() (broken in 20000708). + correct an off-by-one in GoTo() parameter in _nc_scrolln(). 20021221 + change several tputs() calls in scrolling code to use putp(), to enable padding which may be needed for some terminals (patch by Philippe Blain). + use '%' as sed substitute delimiter in run_tic script to avoid problems with pathname delimiters such as ':' and '@' (report by John Polterak). + implement a workaround so that line-drawing works with screen's crippled UTF-8 support (tested with 3.9.13). This only works with the wide-character support (--enable-widec); the normal library will simply suppress line-drawing when running in a UTF-8 locale in screen. 20021214 + allow BUILD_CC and related configure script variables to be overridden from the environment. + make build-tools variables in ncurses/Makefile.in consistent with the configure script variables (report by Maciej W Rozycki). + modify ncurses/modules to allow configure --disable-leaks --disable-ext-funcs to build (report by Gary Samuelson). + fix a few places in configure.in which lacked quotes (report by Gary Samuelson ). + correct handling of multibyte characters in waddch_literal() which force wrapping because they are started too late on the line (report by Sam Varshavchik). + small fix for CF_GNAT_VERSION to ignore the help-message which gnatmake adds to its version-message. > Maciej W Rozycki : + use AC_CHECK_TOOL to get proper values for AR and LD for cross compiling. + use $cross_compiling variable in configure script rather than comparing $host_alias and $target alias, since "host" is traditionally misused in autoconf to refer to the target platform. + change configure --help message to use "build" rather than "host" when referring to the --with-build-XXX options. 20021206 + modify CF_GNAT_VERSION to print gnatmake's version, and to allow for possible gnat versions such as 3.2 (report by Chris Lingard ). + modify #define's for CKILL and other default control characters in tset to use the system's default values if they are defined. + correct interchanged defaults for kill and interrupt characters in tset, which caused it to report unnecessarily (Debian #171583). + repair check for missing C++ compiler, which is broken in autoconf 2.5x by hardcoding it to g++ (report by Martin Mokrejs). + update config.guess, config.sub (2002-11-30) + modify configure script to skip --with-shared, etc., when the --with-libtool option is given, since they would be ignored anyway. + fix to allow "configure --with-libtool --with-termlib" to build. + modify configure script to show version number of libtool, to help with bug reports. libtool still gets confused if the installed ncurses libraries are old, since it ignores the -L options at some point (tested with libtool 1.3.3 and 1.4.3). + reorder configure script's updating of $CPPFLAGS and $CFLAGS to prevent -I options in the user's environment from introducing conflicts with the build -I options (may be related to reports by Patrick Ash and George Goffe). + rename test/define_key.c to test/demo_defkey.c, test/keyok.c to test/demo_keyok.c to allow building these with libtool. 20021123 + add example program test/define_key.c for define_key(). + add example program test/keyok.c for keyok(). + add example program test/ins_wide.c for wins_wch() and wins_wstr(). + modify wins_wch() and wins_wstr() to interpret tabs by using the winsch() internal function. + modify setcchar() to allow for wchar_t input strings that have more than one spacing character. 20021116 + fix a boundary check in lib_insch.c (patch by Philippe Blain). + change type for *printw functions from NCURSES_CONST to const (prompted by comment by Pedro Palhoto Matos , but really from a note on X/Open's website stating that either is acceptable, and the latter will be used in a future revision). + add xterm-1002, xterm-1003 terminfo entries to demonstrate changes in lib_mouse.c (20021026) -TD + add screen-bce, screen-s entries from screen 3.9.13 (report by Adam Lazur ) -TD + add mterm terminfo entries -TD 20021109 + split-out useful fragments in terminfo for vt100 and vt220 numeric keypad, i.e., vt100+keypad, vt100+pfkeys, vt100+fnkeys and vt220+keypad. The last as embedded in various entries had ka3 and kb2 interchanged (report/discussion with Leonard den Ottolander ). + add check in tic for keypads consistent with vt100 layout. + improve checks in tic for color capabilities 20021102 + check for missing/empty/illegal terminfo name in _nc_read_entry() (report by Martin Mokrejs, where $TERM was set to an empty string). + rewrote lib_insch.c, combining it with lib_insstr.c so both handle tab and other control characters consistently (report by Philippe Blain). + remove an #undef for KEY_EVENT from curses.tail used in the experimental NCURSES_WGETCH_EVENTS feature. The #undef confuses dpkg's build script (Debian #165897). + fix MKlib_gen.sh, working around the ironically named POSIXLY_CORRECT feature of GNU sed 4.0 (reported by Ervin Nemeth ). 20021026 + implement logic in lib_mouse.c to handle position reports which are generated when XFree86 xterm is initialized with private modes 1002 or 1003. These are returned to the application as the REPORT_MOUSE_POSITION mask, which was not implemented. Tested both with ncurses 'a' menu (prompted by discussion with Larry Riedel ). + modify lib_mouse.c to look for "XM" terminfo string, which allows one to override the escape sequence used to enable/disable mouse mode. In particular this works for XFree86 xterm private modes 1002 and 1003. If "XM" is missing (note that this is an extended name), lib_mouse uses the conventional private mode 1000. + correct NOT_LOCAL() macro in lib_mvcur.c to refer to screen_columns where it used screen_lines (report by Philippe Blain). + correct makefile rules for the case when both --with-libtool and --with-gpm are given (report by Mr E_T ). + add note to terminfo manpage regarding the differences between setaf/setab and setf/setb capabilities (report by Pavel Roskin). 20021019 + remove redundant initialization of TABSIZE in newterm(), since it is already done in setupterm() (report by Philippe Blain). + add test/inserts.c, to test winnstr() and winsch(). + replace 'sort' in dist.mk with script that sets locale to POSIX. + update URLs in announce.html.in (patch by Frederic L W Meunier). + remove glibc add-on files, which are no longer needed (report by Frederic L W Meunier). 20021012 5.3 release for upload to ftp.gnu.org + modify ifdef's in etip.h.in to allow the etip.h header to compile with gcc 3.2 (patch by Dimitar Zhekov ). + add logic to setupterm() to make it like initscr() and newterm(), by checking for $NCURSES_TRACE environment variable and enabling the debug trace in that case. + modify setupterm() to ensure that it initializes the baudrate, for applications such as tput (report by Frank Henigman). + modify definition of bits used for command-line and library debug traces to avoid overlap, using new definition TRACE_SHIFT to relate the two. + document tput's interpretation of parameterized strings according to whether parameters are given, etc. (discussion with Robert De Bath). 20021005 pre-release + correct winnwstr() to account for non-character cells generated when a double-width character is added (report by Michael Bienia ). + modify _nc_viswbuf2n() to provide better results using wctomb(). + correct logic in _nc_varargs() which broke tracing of parameters for formats such as "%.*s". + correct scale factor in linux-c and linux-c-nc terminfo entries (report Floyd Davidson). + change tic -A option to -t, add the same option to infocmp for consistency. + correct "%c" implementation in lib_tparm.c, which did not map a null character to a 128 (cf: 980620) (patch by Frank Henigman ). 20020928 pre-release + modify MKkey_defs.sh to check for POSIX sort -k option, use that if it is found, to accommodate newer utility which dropped the compatibility support for +number options (reported by Andrey A Chernov). + modify linux terminfo entry to use color palette feature from linux-c-nc entry (comments by Tomasz Wasiak and Floyd Davidson). + restore original color definitions in endwin() if init_color() was used, and resume those colors on the next doupdate() or refresh() (report by Tomasz Wasiak ). + improve debug-traces by modifying MKlib_gen.sh to generate calls to returnBool() and returnAttr(). + add/use _nc_visbufn() and _nc_viswbufn() to limit the debug trace of waddnstr() and similar functions to match the parameters as used. + add/use _nc_retrace_bool() and _nc_retrace_unsigned(). + correct type used by _nc_retrace_chtype(). + add debug traces to some functions in lib_mouse.c + modify lib_addch.c to handle non-spacing characters. + correct parameter of RemAttr() in lib_bkgd.c, which caused the c++ demo's boxes to lose the A_ALTCHARSET flag (broken in 20020629). + correct width computed in _tracedump(), which did not account for the attributes (broken in 20010602). + modify test/tracemunch to replace addresses for windows other than curscr, newscr and stdscr with window0, window1, etc. 20020921 pre-release + redid fix for edit_man.sed path. + workaround for Cygwin bug which makes subprocess writes to stdout result in core dump. + documented getbegx(), etc. + minor fixes to configure script to use '%' consistently as a sed delimiter rather than '@'. > patch by Philippe Blain: + add check in lib_overlay.c to ensure that the windows to be merged actually overlap, and in copywin(), limit the area to be touched to the lines given for the destination window. 20020914 pre-release + modified curses.h so that if the wide-character version is installed overwriting /usr/include/curses.h, and if it relied on libutf8.h, then applications that use that header for wide-character support must define HAVE_LIBUTF8_H. + modify putwin(), getwin() and dupwin() to allow them to operate on pads (request by Philippe Blain). + correct attribute-merging in wborder(), broken in 20020216 (report by Tomasz Wasiak ). > patch by Philippe Blain: + corrected pop-counts in tparam_internal() to '!' and '~' cases. + use sizeof(NCURSES_CH_T) in one place that used sizeof(chtype). + remove some unused variables from mvcur test-driver. 20020907 pre-release + change configure script to allow install of widec-character (ncursesw) headers to overwrite normal (ncurses) headers, since the latter is a compatible subset of the former. + fix path of edit_man.sed in configure script, needed to regenerate html manpages on Debian. + fix mismatched enums in vsscanf.c, which caused warning on Solaris. + update README.emx to reflect current patch used for autoconf. + change web- and ftp-site to invisible-island.net > patch by Philippe Blain: + change case for 'P' in tparam_internal() to indicate that it pops a variable from the stack. + correct sense of precision and width in parse_format(), to avoid confusion. + modify lib_tparm.c, absorb really_get_space() into get_space(). + modify getwin() and dupwin() to copy the _notimeout, _idlok and _idcok window fields. + better fix for _nc_set_type(), using typeMalloc(). 20020901 pre-release + change minor version to 3, i.e., ncurses 5.3 + update config.guess, config.sub + retest build with each configure option; minor ifdef fixes. + make keyname() return a null pointer rather than "UNKNOWN STRING" to match XSI. + modify handling of wide line-drawing character functions to use the normal line-drawing characters when not in UTF-8 locale. + add check/fix to comp_parse.c to suppress warning about missing acsc string. This happens in configurations where raw termcap information is processed; tic already does this and other checks. + modify tic's check for ich/ich1 versus rmir/smir to only warn about ich1, to match xterm patch #70 notes. + moved information for ripped-off lines into SCREEN struct to allow use in resizeterm(). + add experimental wgetch_events(), ifdef'd with NCURSES_WGETCH_EVENTS (adapted from patch by Ilya Zakharevich - see ncurses/README.IZ). + amend check in kgetch() from 20020824 to look only for function-keys, otherwise escape sequences are not resolved properly. > patch by Philippe Blain: + removed redundant assignment to SP->_checkfd from newterm(). + check return-value of setupterm() in restartterm(). + use sizeof(NCURSES_CH_T) in a few places that used sizeof(chtype). + prevent dupwin() from duplicating a pad. + prevent putwin() from writing a pad. + use typeRealloc() or typeMalloc() in preference to direct calls on _nc_doalloc(). 20020824 + add a check in kgetch() for cooked characters in the fifo to avoid calling fifo_push() when a KEY_RESIZE is available (report/analysis by Sam Varshavchik ). + fix an overlooked case for Redhat #68199 (Philippe Blain). + ensure clearerr() is called before using ferror() e.g., in lib_screen.c (report by Philippe Blain). 20020817 + modify lib_screen.c and lib_newwin.c to maintain the SCREEN-specific pointers for curscr/stdscr/newscr when scr_save() and scr_restore() modify the global curscr/stdscr/newscr variables. Fixes Redhat #68199. + add checks for null pointer in calls to tparm() and tgoto() based on FreeBSD bug report. If ncurses were built with termcap support, and the first call to tgoto() were a zero-length string, the result would be a null pointer, which was not handled properly. + correct a typo in terminfo.head, which gave the octal code for colon rather than comma. + remove the "tic -u" option from 20020810, since it did not account for nested "tc=" clauses, and when that was addressed, was still unsatisfactory. 20020810 + add tic -A option to suppress capabilities which are commented out when translating to termcap. + add tic -u option to provide older behavior of "tc=" clauses. + modified tic to expand all but the final "tc=" clause in a termcap entry, to accommodate termcap libraries which do not handle multiple tc clauses. + correct typo in curs_inopts.3x regarding CS8/CS7 usage (report by Philippe Blain). + remove a couple of redundant uses of A_ATTRIBUTES in expressions using AttrOf(), which already incorporates that mask (report by Philippe Blain). + document TABSIZE variable. + add NCURSES_ASSUMED_COLORS environment variable, to allow users to override compiled-in default black-on-white assumption used in assume_default_colors(). + correct an off-by-one comparison against max_colors in COLORFGBG logic. + correct a use of uninitialized memory found by valgrind (reported by Olaf Buddenhagen ). + modified wresize() to ensure that a failed realloc will not corrupt the window structure, and to make subwindows fit within the resized window (completes Debian #87678, Debian #101699) 20020803 + fix an off-by-one in lib_pad.c check for limits of pad (patch by Philippe Blain). + revise logic for BeOS in lib_twait.c altered in 20011013 to restore logic used by lib_getch.c's support for GPM or EMX mouse (report by Philippe Blain) + remove NCURSES_CONST from several prototypes in curses.wide, to make the --enable-const --enable-widec configure options to work together (report by George Goffe ). 20020727 + finish no-leak checking in cardfile.c, using this for testing changes to resizeterm(). + simplify _nc_freeall() using delscreen(). 20020720 + check error-return from _nc_set_tty_mode() in _nc_initscr() and reset_prog_mode() (report/patch by Philippe Blain). + regenerate configure using patch for autoconf 2.52, to address problem with identifying C++ bool type. + correct/improve logic to produce an exit status for errors in tput, which did not exit with an error when told to put a string not in the current terminfo entry (report by David Gomez ). + modify configure script AC_OUTPUT() call to work around defect in autoconf 2.52 which adds an ifdef'd include to the generated configure definitions. + remove fstat() check from scr_init(), which also fixes a missing include for from 20020713 (reported by David Ellement, fix suggested by Philippe Blain). + update curs_scanw.3x manpage to note that XSI curses differs from SVr4 curses: return-values are incompatible. + correct several prototypes in manpages which used const inconsistently with the curses.h file, and removed spurious const's in a few places from curses.h, e.g., for wbkgd() (report by Glenn Maynard ). + change internal type used by tparm() to long, to work with LP64 model. + modify nc_alloc.h to allow building with g++, for testing. 20020713 + add resize-handling to cardfile.c test program. + altered resizeterm() to avoid having it fail when a child window cannot be resized because it would be larger than its parent. (More work must be done on this, but it works well enough to integrate). + improve a limit-check in lib_refresh.c + remove check in lib_screen.c relating dumptime to file's modification times, since that would not necessarily work for remotely mounted filesystems. + modify lrtest to simplify debugging changes to resizeterm, e.g., t/T commands to enable/disable tracing. + updated status of multibyte support in TO-DO. + update contact info in source-files (patch by Juergen Pfeifer). 20020706 + add Caps.hpux11, as an example. + modify version_filter(), used to implement -R option for tic and infocmp, to use computed array offsets based on the Caps.* file which is actually configured, rather than constants which correspond to the Caps file. + reorganized lib_raw.c to avoid updating SP and cur_term state if the functions fail (reported by Philippe Blain). + add -Wundef to gcc warnings, adjust a few ifdef's to accommodate gcc. 20020629 + correct parameters to setcchar() in ncurses.c (cf: 20020406). + set locale in most test programs (view.c and ncurses.c were the only ones). + add configure option --with-build-cppflags (report by Maksim A Nikulin ). + correct a typo in wide-character logic for lib_bkgnd.c (Philippe Blain). + modify lib_wacs.c to not cancel the acsc, smacs, rmacs strings when in UTF-8 locale. Wide-character functions use Unicode values, while narrow-character functions use the terminfo data. + fix a couple of places in Ada95/samples which did not compile with gnat 3.14 + modify mkinstalldirs so the DOS-pathname case is locale-independent. + fix locale problem in MKlib_gen.sh by forcing related variables to POSIX (C), using same approach as autoconf (set variables only if they were set before). Update MKterminfo.sh and MKtermsort.sh to match. 20020622 + add charset to generated html. + add mvterm entry, adapted from a FreeBSD bug-report by Daniel Rudy -TD + add rxvt-16color, ibm+16color entries -TD + modify check in --disable-overwrite option so that it is used by default unless the --prefix/$prefix value is not /usr, in attempt to work around packagers, e.g., for Sun's freeware, who do not read the INSTALL notes. 20020615 + modify wgetch() to allow returning ungetch'd KEY_RESIZE as a function key code in get_wch(). + extended resize-handling in test/ncurses 'a' menu to the entire stack of windows created with 'w' commands. + improve $COLORFGBG feature by interpreting an out-of-range color value as an SGR 39 or 49, for foreground/background respectively. + correct a typo in configure --enable-colorfgbg option, and move it to the experimental section (cf: 20011208). 20020601 + add logic to dump_entry.c to remove function-key definitions that do not fit into the 1023-byte limit for generated termcaps. This makes hds200 fit. + more improvements to tic's warnings, including logic to ignore differences between delay values in sgr strings. + move definition of KEY_RESIZE into MKkeydefs.sh script, to accommodate Caps.osf1r5 which introduced a conflicting definition. 20020525 + add simple resize-handling in test/ncurses.c 'a' menu. + fixes in keyname() and _tracechar() to handle negative values. + make tic's warnings about mismatches in sgr strings easier to follow. + correct tic checks for number of parameters in smgbp and smglp. + improve scoansi terminfo entry, and add scoansi-new entry -TD + add pcvt25-color terminfo entry -TD + add kf13-kf48 strings to cons25w terminfo entry (reported by Stephen Hurd in newsgroup lucky.freebsd.bugs) -TD + add entrypoint _nc_trace_ttymode(), use this to distinguish the Ottyb and Nttyb members of terminal (aka cur_term), for tracing. 20020523 + correct and simplify logic for lib_pad.c change in 20020518 (reported by Mike Castle). 20020518 + fix lib_pad.c for case of drawing a double-width character which falls off the left margin of the pad (patch by Kriang Lerdsuwanakij ) + modify configure script to work around broken gcc 3.1 "--version" option, which adds unnecessary trash to the requested information. + adjust ifdef's in case SIGWINCH is not defined, e.g., with DJGPP (reported by Ben Decker ). 20020511 + implement vid_puts(), vid_attr(), term_attrs() based on the narrow- character versions as well. + implement erasewchar(), killwchar() based on erasechar() and killchar(). + modify erasechar() and killchar() to return ERR if the value was VDISABLE. + correct a bug in wresize() in handling subwindows (based on patch by Roger Gammans , report by Scott Beck ). + improve test/tclock.c by making the second-hand update more often if gettimeofday() is available. 20020429 + workaround for Solaris sed with MKlib_gen.sh (reported by Andy Tsouladze ). 20020427 + correct return-value from getcchar(), making it consistent with Solaris and Tru64. + reorder loops that generate makefile rules for different models vs subsets so configure --with-termlib works again. This was broken by logic added to avoid duplicate rules in changes to accommodate cygwin dll's (reported by George.R.Goffe@seagate.com). + update config.guess, config.sub 20020421 + modify ifdef's in write_entry.c to allow use of symbolic links on platforms with no hard links, e.g., BeOS. + modify a few includes to allow compile with BeOS, which has stdbool.h with a conflicting definition for 'bool' versus its OS.h definition. + amend MKlib_gen.sh to work with gawk, which defines 'func' as an alias for 'function'. 20020420 + correct form of prototype for ripoffline(). + modify MKlib_gen.sh to test that all functions marked as implemented can be linked. 20020413 + add manpages: curs_get_wstr.3x, curs_in_wchstr.3x + implement wgetn_wstr(). + implement win_wchnstr(). + remove redefinition of unget_wch() in lib_gen.c (reported by Jungshik Shin ). 20020406 + modified several of the test programs to allow them to compile with vendor curses implementations, e.g., Solaris, AIX -TD 20020323 + modified test/configure to allow configuring against ncursesw. + change WACS_xxx definition to use address, to work like Tru64 curses. 20020317 + add 'e' and 'm' toggles to 'a', 'A' tests in ncurses.c to demonstrate effect of echo/noecho and meta modes. + add 'A' test to ncurses.c to demonstrate wget_wch() and related functions. + add manpage: curs_get_wch.3x + implement unget_wch(). + implement wget_wch(). 20020310 + regenerated html manpages. + add manpages: curs_in_wch.3x, curs_ins_wch.3x, curs_ins_wstr.3x + implement wins_wch(). + implement win_wch(). + implement wins_nwstr(), wins_wstr(). 20020309 + add manpages: curs_addwstr.3x, curs_winwstr.3x + implement winnwstr(), winwstr(). 20020223 + add manpages: curs_add_wchstr.3x, curs_bkgrnd.3x + document wunctrl, key_name. + implement key_name(). + remove const's in lib_box.c incorrectly leftover after splitting off lib_box_set.c + update llib-lncurses, llib-ncursesw, fix configure script related to these. 20020218 + remove quotes on "SYNOPSIS" in man/curs_box_set.3x, which resulted in spurious symlinks on install. 20020216 + implement whline_set(), wvline_set(), add manpage curs_border_set. + add subtest 'b' to 'F' and 'f' in ncurses.c to demonstrate use of box() and box_set() functions. + add subtest 'u' to 'F' in ncurses.c, to demonstrate use of addstr() given UTF-8 string equivalents of WACS_xxx symbols. + minor fixes to several manpages based on groff -ww output. + add descriptions of external variables of termcap interface to the manpage (report by Bruce Evans ). > patches by Bernhard Rosenkraenzer: + correct configure option --with-bool, which was executed as --with-ospeed. + add quotes for parameters of --with-bool and --with-ospeed configure options. > patch by Sven Verdoolaege (report by Gerhard Haering ): + correct typos in definitions of several wide-character macros: waddwstr, wgetbkgrnd, mvaddwstr, mvwadd_wchnstr, mvwadd_wchnstr, mvwaddwstr. + pass $(CPPFLAGS) to MKlib_gen.sh, thereby fixing a missing definition of _XOPEN_SOURCE_EXTENDED, e.g., on Solaris 20020209 + implement wide-acs characters for UTF-8 locales. When in UTF-8 locale, ignore narrow version of acs. Add 'F' test to test/ncurses.c to demonstrate. + correct prototype in keybound manpage (noted from a Debian mailing list item). 20020202 + add several cases to the wscanw() example in testcurs.c, showing the format. + implement a simple vsscanf() fallback function which uses the %n conversion to help parse the input data (prompted by discussion with Albert Chin-A-Young). + modify mk-1st.awk and test/Makefile.in to add $(LDFLAGS) when making shared libraries, and to use $(CFLAGS) when linking test programs (patch by Albert Chin-A-Young). + add a call to _nc_keypad() in keypad() to accommodate applications such as nvi, which use curses for output but not for input (fixes Debian #131263, cf: 20011215). + add entrypoints to resizeterm.c which provide better control over the process: is_term_resized() and resize_term(). The latter restores the original design of resizeterm() before KEY_RESIZE was added in 970906. Do this to accommodate 20010922 changes to view.c, but allow for programs with their own sigwinch handler, such as lynx (reported by Russell Ruby ). 20020127 + fix a typo in change to mk-1st.awk, which broke the shared-library makefile rules (reported by Martin Mokrejs). 20020126 + update config.guess, config.sub + finish changes needed to build dll's on cygwin. + fix a typo in mvwchat() macro (reported by Cy ). + add configure check for mbstate_t, needed for wide-character configuration. On some platforms we must include to define this (reported by Daniel Jacobowitz). + incorporate some of the changes needed to build dll's on cygwin. 20020112a + workaround for awk did not work with mawk, adjusted shell script. 20020112 + add Caps.osf1r5, as an example. + modify behavior of can_clear_with() so that if an application is running in a non-bce terminals with default colors enabled, it returns true, allowing the user to select/paste text without picking up extraneous trailing blanks (adapted from patch by Daniel Jacobowitz ). + modify generated curses.h to ifdef-out prototypes for extensions if they are disabled, and to define curses_version() as a string in that case. This is needed to make the programs such as tic build in that configuration. + modified generated headers.sh to remove a gzip'd version of the target file if it exists, in case non-gzip'd manpages are installed into a directory where gzip'd ones exist. In that case, the latter would be found. + corrected a redundant initialization of signal handlers from 20010922 changes. + clarified bug-reporting address in terminfo.src (report by John H DuBois III ). > several fixes from Robert Joop: + do not use "-v" option of awk in MKkey_defs.sh because it does not work with SunOS nawk. + modify definitions for libutf8 in curses.h to avoid redefinition warnings for mblen + quoted references to compiler in shell command in misc/Makefile, in case it uses multiple tokens. 20011229 + restore special case from 20010922 changes to omit SA_RESTART when setting up SIGWINCH handler, which is needed to allow wgetch() to be interrupted by that signal. + updated configure macro CF_WITH_PATHLIST, to omit some double quotes not needed with autoconf 2.52 + revert configure script to autoconf 2.13 patched with autoconf-2.13-19990117.patch.gz (or later) from ftp://invisible-island.net/autoconf/ because autoconf 2.52 macro AC_PROG_AWK does not work on HPUX 11.0 (report by David Ellement ). This also fixes a different problem configuring with Mac OS X (reported by Marc Smith ). 20011222 + modify include/edit_cfg.h to eliminate BROKEN_LINKER symbol from term.h + move prototype for _nc_vsscanf() into curses.h.in to omit HAVE_VSSCANF symbol from curses.h, which was dependent upon the ncurses_cfg.h file which is not installed. + use ACS_LEN rather than SIZEOF(acs_map) in trace code of lib_acs.c, to work with broken linker configuration, e.g., cygwin (report by Robert Joop ). + make napms() call _nc_timed_wait() rather than poll() or select(), to work around broken implementations of these on cygwin. 20011218 + drop configure macro CF_WIDEC_SHIFT, since that was rendered obsolete by Sven Verdoolaege's rewrite of wide-character support. This makes libncursesw incompatible again, but makes the header files almost the same as in the narrow-character configuration. + simplify definitions that combine wide/narrow versions of bkgd, etc., to eliminate differences between the wide/narrow versions of curses.h + correct typo in configure macro CF_FUNC_VSSCANF + correct location of call to _nc_keypad() from 20011215 changes which prevented keypad() from being disabled (reported by Lars Hecking). 20011215 + rewrote ncurses 'a' test to exercise wgetch() and keypad() functions better, e.g., by adding a 'w' command to create new windows which may have different keypad() settings. + corrected logic of keypad() by adding internal screen state to track whether the terminal's keypad-mode has been set. Use this in wgetch() to update the keypad-mode according to whether the associated window's keypad-mode has been set with keypad(). This corrects a related problem restoring terminal state after handling SIGTSTP (reported by Mike Castle). + regenerate configure using patch for autoconf 2.52 autoconf-2.52-patch.gz at ftp://invisible-island.net/autoconf/ + update config.guess, config.sub from http://subversions.gnu.org/cgi-bin/viewcvs/config/config/ + minor changes to quoting in configure script to allow it to work with autoconf 2.52 20011208 + modify final checks in lib_setup.c for line and col values, making them independent. + modify acs_map[] if configure --broken-linker is specified, to make it use a function rather than an array (prompted by an incorrect implementation in cygwin package). + correct spelling of configure option --enable-colorfgbg, which happened to work if --with-develop was set (noted in cygwin package for ncurses). + modify ifdef for genericerror() to compile with SUNWspro Sun WorkShop 6 update 1 C++ 5.2 (patch by Sullivan N Beck ). + add configure checks to see if ncurses' fallback vsscanf() will compile either of the special cases for FILE structs, and if not, force it to the case which simply returns an error (report by Sullivan N Beck indicates that Solaris 8 with 64-bits does not allow access to FILE's fields). + modify ifdef's for c++/cursesw.cc to use the fallback vsscanf() in the ncurses library if no better substitute for this can be found in the C++ runtime. + modify the build to name dynamic libraries according to the convention used on OS X and Darwin. Rather than something like libncurses.dylib.5.2, Darwin would name it libncurses. 5.dylib. There are a few additional minor fixes, such as setting the library version and compatibility version numbers (patch by Jason Evans ). + use 'sh' to run mkinstalldirs, to work around problems with buggy versions of 'make' on OS/2 (report by John Polterak ). + correct typo in manpage description of curs_set() (Debian #121548). + replace the configure script existence-check for mkstemp() by one that checks if the function works, needed for older glibc and AmigaOS. 20011201 + modify script that generates fallbacks.c to compile a temporary copy of the terminfo source in case the host does not contain all of the entries requested for fallbacks (request by Greg Roelofs). + modify configure script to accommodate systems such as Mac OS X whose header defines a 'bool' type inconsistent with ncurses, which normally makes 'bool' consistent with C++. Include from curses.h to force consistent usage, define a new type NCURSES_BOOL and related that to the exported 'bool' as either a typedef or definition, according to whether is present (based on a bug report for tin 1.5.9 by Aaron Adams ). 20011124 + added/updated terminfo entries for M$ telnet and KDE konsole -TD 20011117 + updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries (Benjamin C W Sittler). + add putty terminfo entry -TD + if configuring for wide-curses, define _XOPEN_SOURCE_EXTENDED, since this may not otherwise be defined to make test/view.c compile. 20011110 + review/correct several missing/generated items in curses.wide, sorted the lists to make subsequent diff's easier to track. 20011103 + add manual pages for add_wch(), echo_wchar(), getcchar(), mvadd_wch(), mvwadd_wch(), setcchar(), wadd_wch() and wecho_wchar(). + implement wecho_wchar() + modify _tracedump() to handle wide-characters by mapping them to '?' and control-characters to '.', to make the trace file readable. Also dynamically allocate the buffer used by _tracedump() for formatting the results. + modify T_CALLED/T_RETURN macros to ease balancing call/return lines in a trace by using curly braces. + implement _nc_viscbuf(), for tracing cchar_t arrays. + correct trace-calls in setcchar() and getcchar() functions, which traced the return values but not the entry to each function. + correct usage message in test/view.c, which still mentioned -u flag. 20011027 + modify configure script to allow building with termcap only, or with fallbacks only. In this case, we do not build tic and toe. + add configure --with-termpath option, to override default TERMPATH value of /etc/termcap:/usr/share/misc/termcap. + cosmetic change to tack: make menu descriptions agree with menu titles. 20011020 + rewrote limit-checks in wscrl() and associated _nc_scroll_window(), to ensure that if the parameter of wscrl() is larger than the size of the scrolling region, then the scrolling region will be cleared (report by Ben Kohlen ). + add trace/varargs.c, using this to trace parameters in lib_printw.c + implement _tracecchar_t2() and _tracecchar_t(). + split-out trace/visbuf.c + correct typo in lib_printw.c changes from 20010922 (report by Mike Castle). 20011013 + modify run_tic.sh to check if the build is a cross-compile. In that case, do not use the build's tic to install the terminfo database (report by Rafael Rodriguez Velilla ). + modify mouse click resolution so that mouseinterval(-1) will disable it, e.g., to handle touchscreens via a slow connection (request by Byron Stanoszek ). + correct mouseinterval() default value shown in curs_mouse.3x + remove conflicting definition of mouse_trafo() (reported by Lars Hecking, using gcc 2.95.3). 20011001 + simpler fix for signal_name(), to replace the one overlooked in 20010929 (reported by Larry Virden). 20010929 + add -i option to view.c, to test ncurses' check for non-default signal handler for SIGINT, etc. + add cases for shared-libraries on Darwin/OS X (patch by Rob Braun ). + modify tset to restore original I/O modes if an error is encountered. Also modify to use buffered stderr consistently rather than mixing with write(). + change signal_name() function to use if-then-else rather than case statement, since signal-values aren't really integers (reported by Larry Virden). + add limit checks in wredrawln(), fixing a problem where lynx was repainting a pad which was much larger than the screen. 20010922 + fix: PutRange() was counting the second part of a wide character as part of a run, resulting in a cursor position that was one too far (patch by Sven Verdoolaege). + modify resizeterm() to not queue a KEY_RESIZE if there was no SIGWINCH, thereby separating the two styles of SIGWINCH handling in test/view.c + simplified lib_tstp.c, modify it to use SA_RESTART flag for SIGWINCH. + eliminate several static buffers in the terminfo compiler, using allocated buffers. + modify MKkeyname.awk so that keyname() does not store its result into a static buffer that is overwritten by the next call. + reorganize the output of infocmp -E and -e options to compile cleanly with gcc -Wwrite-strings warnings. + remove redefinition of chgat/wchgat/mvwchgat from curses.wide 20010915 + add label to test/view.c, showing the name of the last key or signal that made the screen repaint, to make it clearer when a sigwinch does this. + use ExitProgram() consistently in the test-programs to make it simpler to test leaks with dmalloc, etc. + move hashtab static data out of hashmap.c into SCREEN struct. + make NO_LEAK code compile with revised WINDOWLIST structs. 20010908 + modify tgetent() to check if exit_attribute_mode resets the alternate character set, and if so, attempt to adjust the copy of the termcap "me" string which it will return to eliminate that part. In particular, 'screen' would lose track of line-drawing characters (report by Frederic L W Meunier <0@pervalidus.net>, analysis by Michael Schroeder). 20010901 + specify DOCTYPE in html manpages. + add missing macros for several "generated" functions: attr_get(), attr_off(), attr_on(), attr_set(), chgat(), mvchgat(), mvwchgat() and mouse_trafo(). + modify view.c to agree with non-experimental status of ncurses' sigwinch handler: + change the sense of the -r option, making it default to ncurses' sigwinch handler. + add a note explaining what functions are unsafe in a signal handler. + add a -c option, to set color display, for testing. + unset $data variable in MKterminfo.sh script, to address potential infinite loop if shell malfunction (report by Samuel Mikes , for bash 2.05.0 on a Linux 2.0.36 system). + change kbs in mach terminfo entries to ^? (Marcus Brinkmann ). + correct logic for COLORFGBG environment variable: if rxvt is compiled with xpm support, the variable has three fields, making it slightly incompatible with itself. In either case, the background color is the last field. 20010825 + move calls to def_shell_mode() and def_prog_mode() before loop with callbacks in lib_set_term.c, since the c++ demo otherwise initialized the tty modes before saving them (patch by John David Anglin ). + duplicate logic used to initialize trace in newterm(), in initscr() to avoid confusing trace of initscr(). + simplify allocation of WINDOW and WINDOWLIST structs by making the first a part of the second rather than storing a pointer. This saves a call to malloc for each window (discussion with Philippe Blain). + remove unused variable 'used_ncv' from lib_vidattr.c (Philippe Blain). + modify c++/Makefile.in to accommodate archive programs that are different for C++ than for C, and add cases for vendor's C++ compilers on Solaris and IRIX (report by Albert Chin-A-Young). + correct manpage description of criteria for deciding if the terminal supports xterm mouse controls. + add several configure script options to aid with cross-compiling: --with-build-cc, --with-build-cflags, --with-build-ldflags, and --with-build-libs (request by Greg Roelofs). + change criteria for deciding if configure is cross-compiling from host/build mismatch to host/target mismatch (request by Greg Roelofs ). + correct logic for infocmp -e and -E options which writes the data for the ext_Names[] array. This is needed if one constructs a fallback table for a terminfo entry which uses extended termcap names, e.g., AX in a color xterm. + fix undefined NCURSES_PATHSEP when configure --disable-database option is given. 20010811 + fix for VALID_BOOLEAN() macro when char is not signed. + modify 'clean' rule for C++ binding to work with Sun compiler, which caches additional information in a subdirectory of the objects. + added llib-ncursesw. 20010804 + add Caps.keys example for experimental extended function keys (adapted from a patch by Ilya Zakharevich). + correct parameter types of vidputs() and vidattr() to agree with header files (report by William P Setzer). + fix typos in several man-pages (patch by William P Setzer). + remove unneeded ifdef for __GNUG__ in CF_CPP_VSCAN_FUNC configure macro, which made ncurses C++ binding fail to build with other C++ compilers such as HPUX 11.x (report by Albert Chin-A-Young). + workaround for bug in HPUX 11.x C compiler: add a blank after NCURSES_EXPORT macro in form.h (report by Albert Chin-A-Young) + ignore blank lines in Caps* files in MKkey_defs.sh script (report by Albert Chin-A-Young). + correct definition of key_end in Caps.aix4, which left KEY_END undefined (report by Albert Chin-A-Young). + remove a QNX-specific fallback prototype for vsscanf(), which is obsolete with QNX RTP. + review/fix some of the T() and TR() macro calls, having noticed that there was no data for delwin() in a trace of dialog because there was no returnVoid call for wtimeout(). Also, traces in lib_twait.c are now selected under TRACE_IEVENT rather than TRACE_CALLS. 20010728 + add a _nc_access() check before opening files listed via $TERMPATH. + using modified man2html, regenerate some of the html manpages to fix broken HREF's where the link was hyphenated. 20010721 + add some limit/pointer checks to -S option of tputs. + updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries (Benjamin C W Sittler). + add a note in curs_termcap.3x regarding a defect in the XSI description of tgetent (based on a discussion with Urs Jansen regarding the HPUX 11.x implementation, whose termcap interface is not compatible with existing termcap programs). + modify manhtml rule in dist.mk to preserve copyright notice on the generated files, as well as to address HTML style issues reported by tidy and weblint. Regenerated/updated corresponding html files. + comment out use of Protected_Character and related rarely used attributes in ncurses Ada95 test/demo to compile with wide-character configuration. 20010714 + implement a simple example in C++ demo to test scanw(). + corrected stdio function used to implement scanw() in cursesw.cc + correct definition of RemAttr() macro from 20010602 changes, which caused C++ SillyDemo to not show line-drawing characters. + modify C++ binding, adding getKey() which can be overridden by user to substitute functions other than getch() for keyboard processing of forms and menus (patch by Juergen Pfeifer). 20010707 + fix some of the trace calls which needed modification to work with new wide-character structures. + modify magic-cookie code in tty_update.c to compile with new wide-character structures (report by ). + ensure that _XOPEN_SOURCE_EXTENDED is defined in curses.priv.h if compiling for wide-character configuration. + make addwnstr() handle non-spacing characters (patch by Sven Verdoolaege). 20010630 + add configure check to define _GNU_SOURCE, needed to prop up glibc header files. + split-out include/curses.wide to solve spurious redefinitions caused by defining _GNU_SOURCE, and move includes for before to work around misdefinition of ERR in glibc 2.1.3 header file. + extended ospeed change to NetBSD and OpenBSD -TD + modify logic in lib_baudrate.c for ospeed, for FreeBSD to make it work properly for termcap applications (patch by Andrey A Chernov). 20010623 + correct an overlooked CharOf/UChar instance (reports by Eugene Lee , Sven Verdoolaege). + correct unneeded ifdef for wunctrl() (reported by Sven Verdoolaege) 20010618 + change overlooked several CharOf/UChar instances. > several patches from Sven Verdoolaege: + correct a typo in wunctrl(), which made it appear that botwc() was needed (no such function: use btowc()). + reimplement wide-character demo in test/view.c, using new functions. + implement getcchar(), setcchar(), wadd_wchnstr() and related macros. + fix a syntax problem with do/if/while in PUTC macro (curses.priv.h). 20010616 + add parentheses in macros for malloc in test.priv.h, fixes an expression in view.c (report by Wolfgang Gutjahr ). + add Caps.uwin, as an example. + change the way curses.h is generated, making the list of function key definitions extracted from the Caps file. + add #undef's before possible redefinition of ERR and OK in curses.h + modify logic in tic, toe, tput and tset which checks for basename of argv[0] to work properly on systems such as OS/2 which have case-independent filenames and/or program suffixes, e.g., ".ext". 20010609 + add a configure check, if --enable-widec is specified, for putwc(), which may be in libutf8. + remove some unnecessary text from curs_extend.3x and default_colors.3x which caused man-db to make incorrect symbolic links (Debian #99550). + add configure check if cast for _IO_va_list is needed to compile C++ vscan code (Debian #97945). > several patches from Sven Verdoolaege: + correct code that used non-standard auto-initialization of a struct, which gcc allows (report by Larry Virden). + use putwc() in PUTC() macro. + make addstr() work for the special case where the codeset is non-stateful (eg. UTF-8), as well as stateful codesets. 20010603 + correct loop expression in NEXT_CHAR macro for lib_addstr.c changes from 20010602 (report by Mike Castle). 20010602 + modify mvcur() to avoid emitting newline characters when nonl() mode is set. Normally this is not a problem since the actual terminal mode is set to suppress nl/crlf translations, however it is useful to allow the caller to manipulate the terminal mode to avoid staircasing effects after spawning a process which writes messages (for lynx 2.8.4) -TD > several patches from Sven Verdoolaege : + remove redundant type-conversion in fifo_push() + correct definition of addwstr() macro in curses.h.in + remove _nc_utf8_outch() + rename most existing uses of CharOf() to UChar(), e.g., where it is used to prevent sign-extension in ctype macros. + change some chtype's to attr_t's where the corresponding variables are used to manipulate attributes. + UpdateAttr() was applied to both attributes (attr_t) and characters (chtype). Modify macro and calls to it to make these distinct. + add CharEq() macro, use in places where wide-character configuration implementation uses a struct for cchar_t. + moved struct ldat into curses.priv.h, to hide implementation details. + change CharOf() macro to use it for masking A_CHARTEXT data from chtype's. + add L() macro to curses.priv.h, for long-character literals. + replace several assignments from struct ldat entries to chtype or char values with combinations of CharOf() and AttrOf() macros. + add/use intermediate ChAttrOf() and ChCharOf() macros where we know we are using chtype data. + add/use lowlevel attribute manipulation macros AddAttr(), RemAttr() and SetAttr(). + add/use SetChar() macro, to change a cchar_t based on a character and attributes. + convert most internal use of chtype to NCURSES_CH_T, to simplify use of cchar_t for wide-character configuration. Similarly, use ARG_CH_T where a pointer would be more useful. + add stubs for tracing cchar_t values. + add/use macro ISBLANK() + add/use constructors for cchar_t's: NewChar(), NewChar2(). + add/use macros CHREF(), CHDEREF(), AttrOfD(), CharOfD() to facilitate passing cchar_t's by address. + add/use PUTC_DATA, PUTC() macros. + for wide-character configuration, move the window background data to the end of the WINDOW struct so that whether _XOPEN_SOURCE_EXTENDED is defined or not, the offsets in the struct will not change. + modify addch() to work with wide-characters. + mark several wide-character functions as generated in curses.h.in + implement wunctrl(), wadd_wch(), wbkgrndset(), wbkgrnd(), wborder_set() and waddnwstr(). 20010526 + add experimental --with-caps=XXX option to customize to similar terminfo database formats such as AIX 4.x + add Caps.aix4 as an example. + modify Caps to add columns for the the KEY_xxx symbols. + modify configure --with-widec to suppress overwrite of libcurses.so and curses.h + add checks to toe.c to avoid being confused by files and directories where we would expect the reverse, e.g., source-files in the top-level terminfo levels as is the case for AIX. 20010519 + add top-level 'depend' rule for the C sources, assuming that the makedepend program is available. As a side-effect, this makes the generated sources, as in "make sources" (prompted by a report by Mike Castle that "make -j" fails because the resulting parallel processes race to generate ncurses/names.c). + modify configure script so that --disable-overwrite option's action to add a symbolic link for libcurses applies to the static library as well as the shared library when both are configured (report by Felix Natter ). + add ELKS terminfo entries (Federico Bianchi ) + add u6 (CSR) to Eterm (Michael Jennings). 20010512 + modify test/ncurses.c to work with xterm-256color, which has fewer color pairs than colors*colors (report by David Ellement ). 20010505 + corrected screen.xterm-xfree86 entry. + update comment in Caps regarding IBM (AIX) function-key definitions. 20010421 + modify c++/Makefile.in to link with libncurses++w.a when configured for wide-characters (patch by Sven Verdoolaege). + add check in _nc_trace_buf() to refrain from freeing a null pointer. + improve CF_PROG_INSTALL macro using CF_DIRNAME. + update config.guess, config.sub from autoconf 2.49e (alpha). 20010414 + add secondary check in tic.c, similar_sgr() to see if the reason for mismatch was that the individual capabilities used a time-delay while sgr did not. Used this to cleanup mismatches, e.g., in vt100, and remove time-delay from Apple_Terminal entries. + add Apple_Terminal terminfo entries (Benjamin C W Sittler ). + correct definitions of shifted editing keys for xterm-xfree86 -TD + fix a bug in test/bs.c from 20010407 (patch by Erik Sigra). + prevent relative_move() from doing an overwrite if it detects 8-bit characters when configured for UTF-8 (reported by Sven Verdoolaege ). 20010407 + add configure checks for strstream.h vscan function, and similar stdio-based function which may be used in C++ binding for gcc 3.0 (reports by George Goffe, Lars Hecking, Mike Castle). + rewrite parts of configure.in which used changequote(). That feature is broken in the latest autoconf alphas (e.g., 2.49d). + add a missing pathname for ncurses_dll.h, needed when building in a directory outside the source tree (patch by Sven Verdoolaege ). > fix 2 bugs in test/bs.c Erik Sigra : + no ships were ever placed in the last row or in the last column. This made the game very easy to win, because you never had to waste any shots there, but the computer did. + the squares around a sunken ship that belonged to the player were not displayed as already hit by the computer, like it does for the player. 20010331 + add some examples of customizing screen's terminfo: screen.xterm-xfree86, screen.xterm-r6, screen.teraterm -TD + modify screen's terminfo entry to match the khome/kend in screen 3.09.08 (Debian #92215). + correct a memory leak in forms library (report by Stefan Vogtner ) (patch by Juergen Pfeifer). 20010324 + change symbols used to guard against repeated includes to begin consistently with "NCURSES_" rather than a leading underscore. There are other symbols defined in the header files which begin with a leading underscore, but they are part of the legacy interface. + reorder includes in c++ binding so that rcs identifiers can be compiled-in. + add .cc.ii rule to c++ makefile, to get preprocessor output for debugging. + correct configure script handling of @keyword@ substitutions when the --with-manpage-renames option is given (cf: 20000715, fixes Debian #89939). + report stack underflow/overflow in tparm() when tic -cv option is given. + remove spurious "%|" operator from xterm-xfree86 terminfo entry, (reported by Adam Costello , Debian #89222). 20010310 + cleanup of newdemo.c, fixing some ambiguous expressions noted by gcc 2.95.2, and correcting some conflicting color pair initializations. + add missing copyright notice for cursesw.h + review, make minor fixes for use of '::' for referring to C-language interface from C++ binding. + modify configure check for g++ library slightly to accommodate nonstandard version number, e.g., -2.7 (report by Ronald Ho ). + add configure check for c++ header, replace hardcoded ifdef. + workaround for pre-release of gcc 3.0 libstdc++, which has dropped vscan from strstreambuf to follow standard, use wrapper for C vscanf instead (report by George Goffe and Matt Taggart , fixes Debian . 20010303 + modify interface of _nc_get_token() to pass 'silent' parameter to it, to make quieter loading of /etc/termcap (patch by Todd C Miller). + correct a few typos in curs_slk.3x and curs_outopts.3x manpages (patch by Todd C Miller). 20010224 + compiler-warning fixes (reported by Nelson Beebe). 20010210 + modify screen terminfo entry to use new 3.9.8 feature allowing xterm mouse controls -TD 20010203 + broaden patterns used to match OS/2 EMX in configure script to cover variant used in newer config.guess/config.sub + remove changequote() calls from configure script, since this feature is broken in the autoconf 2.49c alpha, maintainers decline to fix. + remove macro callPutChar() from tty_update.c, since this is no longer needed (reported by Philippe Blain). + add a null-pointer check in tic.c to handle the case when the input file is really empty. Modify the next_char() function in comp_scan.c to allow arbitrarily long lines, and incidentally supply a newline to files that do not end in a newline. These changes improve tic's recovery from attempts to read binary files, e.g., its output from the terminfo database (reported by Bernhard Rosenkraenzer). 20010127 + revert change to c++/demo.cc from 20001209, which changed definition of main() apparently to accommodate cygwin linker, but broke the demo program. + workaround for broken egcs 2.91.66 which calls member functions (i.e., lines() and colors() of NCursesWindow before calling its constructor. Add calls to initialize() in a few constructors which did not do this already. + use the GNAT preprocessor to make the necessary switch between TRACE and NO_TRACE configurations (patch by Juergen Pfeifer). > patches by Bernhard Rosenkraenzer: + modify kterm terminfo entry to use SCS sequence to support alternate character set (it does not work with SI/SO). + --with-ospeed=something didn't work. configure.in checked for a $enableval where it should check for $withval. Also, ncurses/llib-lncurses still had a hardcoded short. 20010114 + correction to my merge of Tom Riddle's patch that broke tic in some conditions (reported by Enoch Wexler ) -TD 20010113 + modify view.c to test halfdelay(). Like other tests, this recognizes the 's' and space commands for stopping/starting polled input, shows a freerunning clock in the header. If given a parameter to 's', that makes view.c use halfdelay() with that parameter rather than nodelay(). + fix to allow compile with the experimental configure option --disable-hashmap. + modify postprocess_termcap() to avoid overwriting key_backspace, key_left, key_down when processing a non-base entry (report/patch by Tom Riddle). + modify _nc_wrap_entry(), adding option to reallocate the string table, needed in _nc_merge_entry() when merging termcap entries. (adapted from report/patch by Tom Riddle ). + modify a few configure script macros to keep $CFLAGS used only for compiler options, preprocessor options in $CPPFLAGS. 20001230 + correct marker positions in lrtest.c after receiving a sigwinch. + fix ifdef's in ncurses.c to build against pre-5.2 for testing. + fixes to tclock for resizing behavior, redundant computation (report and patch by A M Kuchling ). 20001216 + improved scoansi terminfo entry -TD + modify configure script and makefile in Ada95/src to compile a stub for the trace functions when ncurses does not provide those. 20001209 + add ncurses_dll.h and related definitions to support generating DLL's with cygwin (adapted from a patch by Charles Wilson , changed NCURSES_EXPORT macro to make it work with 'indent') -TD 20001202 + correct prototypes for some functions in curs_termcap.3x, matching termcap.h, which matches X/Open. > patch by Juergen Pfeifer: + a revised version of the Ada enhancements sent in by "H. Nanosecond", aka Eugene V Melaragno . This patch includes - small fixes to the existing ncurses binding - addition of some more low-level functions to the binding, including termcap and terminfo functions - An Ada implementation of the "ncurses" test application originally written in C. 20001125 + modify logic in lib_setup.c to allow either lines or columns value from terminfo to be used if the screen size cannot be determined dynamically rather than requiring both (patch by Ehud Karni ). + add check in lib_tgoto.c's is_termcap() function to reject null or empty strings (reported by Valentin Nechayev to freebsd-bugs). + add definition from configure script that denotes the path-separator, which is normally a colon. The path-separator is a semicolon on OS/2 EMX and similar systems which may use a colon within pathnames. + alter logic to set default for --disable-overwrite option to set it to 'yes' if the --prefix/$prefix value is not /usr/local, thereby accommodating the most common cause of problems: gcc's nonstandard search rules. Other locations such as /usr/local/ncurses will default to overwriting (report by Lars Hecking ). 20001118 + modify default for --disable-overwrite configure option to disable if the --prefix or $prefix value is not /usr. + add cygwin to systems for which ncurses is installed by default into /usr rather than /usr/local. 20001111 + minor optimization in comp_error.c and lib_termname.c, using strncat() to replace strncpy() (patch by Solar Designer). + add a use_terminfo_vars() check for $HOME/.termcap, and check for geteuid() to use_terminfo_vars() (patch by Solar Designer ). + improved cygwin terminfo entry, based on patch by . + modify _nc_write_entry() to allow for the possibility that linking aliases on a filesystem that ignores case would not succeed because the source and destination differ only by case, e.g., NCR260VT300WPP0 on cygwin (report by Neil Zanella). + fix a typo in the curs_deleteln.3x man page (patch by Bernhard Rosenkraenzer ). 20001104 + add configure option --with-ospeed to assist packagers in transition to 5.3 change to ospeed type. + add/use CharOf() macro to suppress sign-extension of char type on platforms where this is a problem in ctype macros, e.g., Solaris. + change trace output to binary format. + correct a missing quote adjustment in CF_PATH_SYNTAX autoconf macro, for OS/2 EMX configuration. + rearrange a few configure macros, moving preprocessor options to $CPPFLAGS (a now-obsolete version of autoconf did not consistently use $CPPFLAGS in both the compile and preprocessor checks). + add a check in relative_move() to guard against buffer overflow in the overwrite logic. 20001028 + add message to configure script showing g++ version. + resync config.guess, config.sub + modify lib_delwin.c, making it return ERR if the window did not exist (suggested by Neil Zanella). + add cases for FreeBSD 3.1 to tdlint and makellib scripts, used this to test/review ncurses library. (Would use lclint, but it doesn't work). + reorganized knight.c to avoid forward references. Correct screen updates when backtracking, especially to the first cell. Add F/B/a commands. 20001021 5.2 release for upload to ftp.gnu.org + update generated html files from manpages. + modify dist.mk to use edit_man.sh to substitute autoconf'd variables in html manpages. + fix an uninitialized pointer in read_termcap.c (report by Todd C Miller, from report/patch by Philip Guenther ). + correct help-message and array limit in knight.c (patch by Brian Raiter ). > patch by Juergen Pfeifer: + fix to avoid warning by GNAT-3.13p about use of inconsistent casing for some identifiers defined in the standard package. + cosmetic change to forms/fty_enum.c 20001014 + correct an off-by-one position in test/railroad.c which could cause wrapping at the right margin. + test/repair some issues with libtool configuration. Make --disable-echo force libtool --silent. (Libtool does not work for OS/2 EMX, works partly for SCO - libtool is still very specific to gcc). + change default of --with-manpage-tbl to "no", since for most of the platforms which do have tbl installed, the system "man" program understands how to run tbl automatically. + minor improvement to force_bar() in comp_parse.c (Bernhard Rosenkraenzer ). + modify lib_tparm.c to use get_space() before writing terminating null character, both for consistency as well as to ensure that if save_char() was called immediately before, that the allocated memory is enough (patch by Sergei Ivanov). + add note about termcap ML capability which is duplicated between two different capabilities: smgl and smglr (reported by Sergei Ivanov ). + correct parameter counts in include/Caps for dclk as well as some printer-specific capabilities: csnm, defc, scs, scsd, smgtp, smglp. > patch by Johnny C Lam : + add support for building with libtool (apparently version 1.3.5, since old versions do not handle -L../lib), using new configure option --with-libtool. + add configure option --with-manpage-tbl, which causes the manpages to be preprocessed by tbl(1) prior to installation, + add configure option --without-curses-h, which causes the installation process to install curses.h as ncurses.h and make appropriate changes to headers and manpages. 20001009 + correct order of options/parameters in run_tic.in invocation of tic, which did not work with standard getopt() (reported by Ethan Butterfield ). + correct logic for 'reverse' variable in lib_vidattr.c, which was setting it true without checking if newmode had A_REVERSE set, e.g., using $TERM=ansi on OS/2 EMX (see 20000917). > patch by Todd C Miller: + add a few missing use_terminfo_vars() and fixes up _nc_tgetent(). Previously, _nc_cgetset() would still get called on cp so the simplest thing is to set cp to NULL if !use_terminfo_vars(). + added checks for an empty $HOME environment variable. > patches for OS/2 EMX (Ilya Zakharevich): + modify convert_configure.pl to support INSTALL. Change compiler options in that script to use multithreading, needed for the mouse. + modify OS/2 mouse support, retrying as a 2-button mouse if code fails to set up a 3-button mouse. + improve code for OS/2 mouse support, using _nc_timed_wait() to replace select() call. 20001007 + change type of ospeed variable back to short to match its use in legacy applications (reported by Andrey A Chernov). + add case to configure script for --enable-rpath on IRIX (patch by Albert Chin-A-Young). + minor fix to position_check() function, to ensure it gets the whole cursor report before decoding. + add configure option --disable-assumed-color, to allow pre-5.1 convention of default colors used for color-pair 0 to be configured (see assume_default_colors()). + rename configure option --enable-hashmap --disable-hashmap, and reorder the configure options, splitting the experimental and development + add configure option --disable-root-environ, which tells ncurses to disregard $TERMINFO and similar environment variables if the current user is root, or running setuid/setgid (based on discussion with several people). + modified misc/run_tic.in to use tic -o, to eliminate dependency on $TERMINFO variable for installs. + add table entry for plab_norm to tput, so it passes in strings for that capability. + modify parse_format() in lib_tparm.c to ignore precision if it is longer than 10000 (report by Jouko Pynnonen). + rewrote limit checks in lib_mvcur.c using new functions _nc_safe_strcat(), etc. Made other related changes to check lengths used for strcat/strcpy (report by Jouko Pynnonen ). 20000930 + modify several descriptions, including those for setaf, setab, in include/Caps to indicate that the entries are parameterized. This information is used to tell which strings are translated when converting to termcap. Fixes a problem where the generated termcap would contain a spurious "%p1" for the terminfo "%p1%d". + modify ld -rpath options (e.g., Linux, and Solaris) to use an absolute pathname for the build tree's lib directory (prompted by discussion with Albert Chin-A-Young). + modify "make install.man" and "make uninstall.man" to include tack's man-page. + various fixes for install scripts used to support configure --srcdir and --with-install-prefix (reported by Matthew Clarke ). + make configure script checks on variables $GCC and $GXX consistently compare against 'yes' rather than test if they are nonnull, since either may be set to the corresponding name of the C or C++ compiler (report/patch by Albert Chin-A-Young). 20000923 + modify rs2 capability in xterm-r6 and similar where cursor save/restore bracketed the sequence for resetting video attributes. The cursor restore would undo that (report by John Hawkinson (see NetBSD misc/11052)). + using parameter check added to tic, corrected 27 typos in terminfo.src -TD + modify tic to verify that its inputs are really files, in case someone tries to read a directory (or /dev/zero). + add a check for empty buffers returned by fgets() in comp_scan.c next_char() function, in case tic is run on a non-text file (fixes a core dump reported by Aaron Campbell ). + add to railroad.c some code exercising tgoto(), providing an alternate form of display if the terminal supports cursor addressing. + split-out tgoto() again, this time into new file lib_tgoto.c, and implement a conventional BSD-style tgoto() which is used if the capability string does not contain terminfo-style padding or parameters (requested by Andrey A Chernov). + add check to tic which reports capabilities that do not reference the expected number of parameters. + add error checking to infocmp's -v and -m options to ensure that the option value is indeed a number. + some cleanup of logic in _nc_signal_handler() to verify if SIGWINCH handler is setup. Separated the old/new sigaction data for SIGTSTP from the other signals. 20000917 + add S0, E0 extensions to screen's terminfo entry, which is another way to solve the misconfiguration issue -TD + completed special case for tgoto from 20000916 20000916 + update xterm terminfo entries to match XFree86 xterm patch #146 -TD + add Matrix Orbital terminfo entries (from Eric Z Ayers ). + add special case to lib_tparm.c to allow 'screen' program to use a termcap-style parameter "%." to tgoto() for switching character sets. + use LN_S substitution in run_tic.in, to work on OS/2 EMX which has no symbolic links. + updated notes in README.emx regarding autoconf patches. + replace a lookup table in lib_vidattr.c used to decode no_color_video with a logic expression (suggested by Philippe Blain). + add a/A toggle to ncurses.c 'b' test, which clears/sets alternate character set attribute from the displayed text. + correct inequality in parameter analysis of rewritten lib_tparm.c which had the effect of ignoring p9 in set_attributes (sgr), breaking alternate character set (reported by Piotr Majka ). + correct ifdef'ing for GCC_PRINTF, GCC_SCANF which would not compile with Sun WorkShop compilers since these tokens were empty (cf: 20000902, reported by Albert Chin-A-Young). 20000909 + correct an uninitialized parameter to open_tempfile() in tic.c which made "tic -I" give an ambiguous error message about tmpnam. + add special case in lib_vidattr.c to reset underline and standout for devices that have no sgr0 defined (patch by Don Lewis ). Note that this will not work for bold mode, since there is no exit-bold-mode capability. + improved patch for Make_Enum_Type (patch by Juergen Pfeifer). + modify tparm to disallow arithmetic on strings, analyze the varargs list to read strings as strings and numbers as numbers. + modify tparm's internal function spop() to treat a null pointer as an empty string. + modify tput program so it can be renamed or invoked via a link as 'reset' or 'init', producing the same effect as 'tput reset' or 'tput init'. + add private entrypoint _nc_basename(), use to consolidate related code in progs, as well as accommodating OS/2 EMX pathnames. + remove NCURSES_CONST line from edit_cfg.sh to compensate for its removal (except via AC_SUBST) from configure.in, making --enable-const work again (reported by Juergen Pfeifer). + regen'd configure to pick up "hpux*" change from 20000902. 20000902 + modify tset.c to check for transformed "reset" program name, if any. + add a check for null pointer in Make_Enum_Type() (reported by Steven W Orr ). + change functions _nc_parse_entry() and postprocess_termcap() to avoid using strtok(), because it is non-reentrant (reported by Andrey A Chernov ). + remove "hpux10.*" case from CF_SHARED_OPTS configure script macro. This differed from the "hpux*" case by using reversed symbolic links, which made the 5.1 version not match the configuration of 5.0 shared libraries (reported by Albert Chin-A-Young). + correct a dependency in Ada95/src/Makefile.in which prevented building with configure --srcdir (patch by H Nanosecond ). + modify ifdef's in curses.h.in to avoid warning if GCC_PRINTF or GCC_SCANF was not previously defined (reported by Pavel Roskin ). + add MKncurses_def.sh to generate fallback definitions for ncurses_cfg.h, to quiet gcc -Wundef warnings, modified ifdef's in code to consistently use "#if" rather than "#ifdef". 20000826 + add QNX qansi entries to terminfo -TD + add os2 entry to misc/emx.src (). + add configure option --with-database to allow specifying a different terminfo source-file to install. On OS/2 EMX, this defaults to misc/emx.src + change misc/run_tic.sh to derive it from misc/run_tic.in, to simplify setting .exe extension on OS/2 EMX. + add .exe extension in Ada95/gen/Makefile.in, Ada95/samples/Makefile.in, for OS/2 EMX (reported by ). + add configure check for filesystems (such as OS/2 EMX) which do not distinguish between upper/lowercase filenames, use this to fix tags rules in makefiles. + initialize fds[] array to 0's in _nc_timed_wait(); apparently poll() only sets the revents members of that array when there is activity corresponding to the related file (report by Glenn Cooper , using Purify on Solaris 5.6). + change configure script to use AC_CANONICAL_SYSTEM rather than AC_CANONICAL_HOST, which means that configure --target will set a default program-prefix. + add note on cross-compiling to INSTALL (which does not rely on the AC_CANONICAL_* macros). 20000819 + add cases for EMX OS/2 to config.guess, config.sub + new version of config.guess, config.sub from lynx 2.8.4dev.7 + add definitions via transform.h to allow tic and tput to check for the transformed aliases rather than the original infotocap, etc. + simplify transform-expressions in progs/Makefile.in, make the uninstall rule work for transformed program names. + change symbol used by --install-prefix configure option from INSTALL_PREFIX to DESTDIR (the latter has become common usage although the name is misleading). + modify programs to use curses_version() string to report the version of ncurses with which they are compiled rather than the NCURSES_VERSION string. The function returns the patch level in addition to the major and minor version numbers. 20000812 + modify CF_MAN_PAGES configure macro to make transformed program names a parameter to that macro rather than embedding them in the macro. + newer config.guess, config.sub (reference version used in lynx 2.8.4dev.7). + add configure option --with-default-terminfo-dir=DIR to allow specifying the default terminfo database directory (request by Albert Chin-A-Young). + minor updates for terminfo.src from FreeBSD termcap change-history. + correct notes in README and INSTALL regarding documentation files that were moved from misc directory to doc (report by Rich Kulawiec ). + change most remaining unquoted parameters of 'test' in configure script to use quotes, for instance fixing a problem in the --disable-database option (reported by Christian Mondrup ). + minor adjustments to work around some of the incompatibilities/bugs in autoconf 2.29a alpha. + add -I/usr/local/include when --with-ncurses option is used in test/configure script. + correct logic in adjust_cancels(), which did not check both alternatives when reclassifying an extended name between boolean, number and string, causing an infinite loop in tic. 20000730 + correct a missing backslash in curses.priv.h 20000729 + change handling of non_dest_scroll_region in tty_update.c to clear text after it is shifted in rather than before shifting out. Also correct row computation (reported by Ruediger Kuhlmann ). + add/use new trace function to display chtype values from winch() and getbkgd(). + add trace mask TRACE_ATTRS, alter several existing _tracef calls that trace attribute changes under TRACE_CALLS to use this. + modify MKlib_gen.sh so that functions returning chtype will call returnChar(). + add returnChar() trace, for functions returning chtype. + change indent.pro to line up parenthesis. 20000722 + fix a heap problem with the c++ binding (report by , patch by Juergen Pfeifer). + minor adjustment to ClrToEOL() to handle an out-of-bounds parameter. + modify the check for big-core to force a couple of memory accesses, which may work as needed for older/less-capable machines (if not, there's still the explicit configure option). > fixes based on diff's for Amiga and BeOS found at http://www.mathematik.uni-karlsruhe.de/~kuhlmann/cross/ncurses/ + alter definition of NCURSES_CONST to make it non-empty. + add amiga-vnc terminfo entry. + redefine 'TEXT' in menu.h for AMIGA, since it is reported to have an (unspecified) symbol conflict. + replaced case-statement in _nc_tracebits() for CSIZE with a table to simplify working around implementations that define random combinations of the related macros to zero. + modify configure test for tcgetattr() to allow for old implementations, e.g., on BeOS, which only defined it as a macro. > patches by Bruno Haible: + when checking LC_ALL/LC_CTYPE/LANG environment variables for UTF-8 locale, ignore those which are set to an empty value, as per SUSV2. + encode 0xFFFD in UTF-8 with 3 bytes, not 2. + modify _nc_utf8_outch() to avoid sign-extension when checking for out-of-range value. 20000715 + correct manlinks.sed script to avoid using ERE "\+", which is not understood by older versions of sed (patch by Albert Chin-A-Young). + implement configure script options that transform installed program names, e.g., --program-prefix, including the manpage names and cross references (patch by Albert Chin-A-Young ). + correct several mismatches between manpage filename and ".TH" directives, renaming dft_fgbg.3x to default_colors.3x and menu_attribs.3x to menu_attributes.3x (report by Todd C Miller). + correct missing includes for in several places, including the C++ binding. This is not noted by gcc unless we use the -fno-builtin option (reported by Igor Schein ). + modified progs/tset.c and tack/sysdep.c to build with sgttyb interface if neither termio or termios is available. Tested this with FreeBSD 2.1.5 (which does have termios - but the sgttyb does work). 20000708 5.1 release for upload to ftp.gnu.org + document configure options in INSTALL. + add man-page for ncurses trace functions. + correct return value shown in curs_touch.3x for is_linetouched() and is_wintouched(), in curs_initscr.3x for isendwin(), and in curs_termattr.3x for has_ic() and has_il(). + add prototypes for touchline() and touchwin(), adding them to the list of generated functions. + modify fifo_push() to put ERR into the fifo just like other values to return from wgetch(). It was returning without doing that, making end-of-file condition incorrectly return a 0 (reported by Todd C Miller). + uncomment CC_SHARED_OPTS for progs and tack (see 971115), since they are needed for SCO OpenServer. + move _nc_disable_period from free_ttype.c to comp_scan.c to appease dynamic loaders on SCO and IRIX64. + add "-a" option to test/ncurses.c to invoke assume_default_colors() for testing. + correct assignment in assume_default_colors() which tells ncurses whether to use default colors, or the assumed ones (reported by Gary Funck ). + review/correct logic in mk-1st.awk for making symbolic links for shared libraries, in particular for FreeBSD, etc. + regenerate misc/*.def files for OS/2 EMX dll's. + correct quoting of values for CC_SHARED_OPTS in aclocal.m4 for cases openbsd2*, openbsd*, freebsd* and netbsd* (patch by Peter Wemm) (err in 20000610). + minor updates to release notes, as well as adding/updating URLs for examples cited in announce.html > several fixes from Philippe Blain : + correct placement of ifdef for NCURSES_XNAMES in function _nc_free_termtype(), fixes a memory leak. + add a call to _nc_synchook() to the end of function whline() like that in wvline() (difference was in 1.9.4). + make ClearScreen() a little faster by moving two instances of UpdateAttr() out of for-loops. + simplify ClrBottom() by eliminating the tstLine data, using for-loops (cf: 960428). 20000701 pre-release + change minor version to 1, i.e., ncurses 5.1 + add experimental configure option --enable-colorfgbg to check for $COLORTERM variable as set by rxvt/aterm/Eterm. + add Eterm terminfo entry (Michael Jennings ). + modify manlinks.sed to pick aliases from the SYNOPSIS section, and several manpages so manlinks.sed can find aliases for creating symbolic links. + add explanation to run_tic.sh regarding extended terminal capabilities. + change message format for edit_cfg.sh, since some people interpret it as a warning. + correct unescaped '$' in sysv5uw7*|unix_sv* rule for CF_SHARED_OPTS configure macro (report by Thanh Ma ). + correct logic in lib_twait.c as used by lib_mouse.c for GPM mouse support when poll() is used rather than select() (prompted by discussion with David Allen ). 20000624 pre-release + modify TransformLine() to check for cells with different color pairs that happen to render the same display colors. + apply $NCURSES_NO_PADDING to cost-computation in mvcur(). + improve cost computation in PutRange() by accounting for the use of parm_right_cursor in mvcur(). + correct cost computation in EmitRange(), which was not using the normalized value for cursor_address. + newer config.guess, config.sub (reference version used in TIN 1.5.6). 20000617 + update config.guess, config.sub (reference version used in PCRE 3.2). + resync changes to gnathtml against version 1.22, regenerated html files under doc/html/ada using this (1.22.1.1). + regenerated html files under doc/html/man after correcting top and bottom margin options for man2html in dist.mk + minor fixes to test programs ncurses 'i' and testcurs program to make the subwindow's background color cover the subwindow. + modify configure script so AC_MSG_ERROR is temporarily defined to a warning in AC_PROG_CXX to make it recover from a missing C++ compiler without requiring user to add --without-cxx option (adapted from comment by Akim Demaille to autoconf mailing list). + modify headers.sh to avoid creating temporary files in the build directory when installing headers (reported by Sergei Pokrovsky ) 20000610 + regenerated the html files under doc/html/ada/files and doc/html/ada/funcs with a slightly-improved gnathtml. + add kmous capability to linux terminfo entry to allow it to use xterm-style events provided by gpm patch by Joerg Schoen. + make the configure macro CF_SHARED_OPTS a little smarter by testing if -fPIC is supported by gcc rather than -fpic. The former option allows larger symbol tables. + update config.guess and config.sub (patches by Kevin Buettner (for elf64_ia64), Bernd Kuemmerlen (for MacOS X)). + add warning for 'tic -cv' about use of '^?' in terminfo source, which is an extension. 20000527 + modify echo() behavior of getch() to match Solaris curses for carriage return and backspace (reported by Neil Zanella). + change _nc_flush() to a function. + modify delscreen() to check if the output stream has been closed, and if so, free the buffer allocated for setbuf (this provides an ncurses-specific way to avoid a memory leak when repeatedly calling newterm reported by Chipp C ). + correct typo in curs_getch.3x manpage regarding noecho (reported by David Malone ). + add a "make libs" rule. + make the Ada95 interface build with configure --enable-widec. + if the configure --enable-widec option is given, append 'w' to names of the generated libraries (e.g., libncursesw.so) to avoid conflict with existing ncurses libraries. 20000520 + modify view.c to make a rudimentary viewer of UTF-8 text if ncurses is configured with the experimental wide-character support. + add a simple UTF-8 output driver to the experimental wide-character support. If any of the environment variables LC_ALL, LC_CTYPE or LANG contain the string "UTF-8", this driver will be used to translate the output to UTF-8. This works with XFree86 xterm. + modify configure script to allow building shared libraries on BeOS (from a patch by Valeriy E Ushakov). + modify lib_addch.c to allow repeated update to the lower-right corner, rather than displaying only the first character written until the cursor is moved. Recent versions of SVr4 curses can update the lower-right corner, and behave this way (reported by Neil Zanella). + add a limit-check in _nc_do_color(), to avoid using invalid color pair value (report by Brendan O'Dea ). 20000513 + the tack program knows how to use smcup and rmcup but the "show caps that can be tested" feature did not reflect this knowledge. Correct the display in the menu tack/test/edit/c (patch by Daniel Weaver). + xterm-16color does allow bold+colors, removed ncv#32 from that terminfo entry. 20000506 + correct assignment to SP->_has_sgr_39_49 in lib_dft_fgbg.c, which broke check for screen's AX capability (reported by Valeriy E Ushakov ). + change man2html rule in dist.mk to workaround bug in some man-programs that ignores locale when rendering hyphenation. + change web- and ftp-site to dickey.his.com 20000429 + move _nc_curr_token from parse_entry.c to comp_scan.c, to work around problem linking tack on MacOS X DP3. + include in lib_napms.c to compile on MacOS X DP3 (reported by Gerben Wierda ). + modify lib_vidattr.c to check for ncv fixes when pair-0 is not default colors. + add -d option to ncurses.c, to turn on default-colors for testing. + add a check to _nc_makenew() to ensure that newwin() and newpad() calls do not silently fail by passing too-large limits. + add symbol NCURSES_SIZE_T to use rather than explicit 'short' for internal window and pad sizes. Note that since this is visible in the WINDOW struct, it would be an ABI change to make this an 'int' (prompted by a question by Bastian Trompetter , who attempted to create a 96000-line pad). 20000422 + add mgterm terminfo entry from NetBSD, minor adjustments to sun-ss5, aixterm entries -TD + modify tack/ansi.c to make it more tolerant of bad ANSI replies. An example of an illegal ANSI resonse can be found using Microsoft's Telnet client. A correct display can be found using a VT-4xx terminal or XFree86 xterm with: XTerm*VT100*decTerminalID: 450 (patch by Daniel Weaver). + modify gdc.c to recognize 'q' for quit, 's' for single-step and ' ' for resume. Add '-n' option to force gdc's standard input to /dev/null, to both illustrate the use of newterm() for specifying alternate inputs as well as for testing signal handling. + minor fix for configure option --with-manpage-symlinks, for target directories that contain a period ('.') (reported by Larry Virden). 20000415 + minor additions to beterm entry (feedback from Rico Tudor) -TD + corrections/updates for some IBM terminfo entries -TD + modify _nc_screen_wrap() so that when exiting curses mode with non-default colors, the last line on the screen will be cleared to the screen's default colors (request by Alexander V Lukyanov). + modify ncurses.c 'r' example to set nonl(), allowing control/M to be read for demonstrating the REQ_NEW_LINE operation (prompted by a question by Tony L Keith ). + modify ncurses.c 'r' example of field_info() to work on Solaris 2.7, documented extension of ncurses which allows a zero pointer. + modify fmt_complex() to avoid buffer overflow in case of excess recursion, and to recognize "%e%?" as a synonym for else-if, which means that it will not recur for that special case. + add logic to support $TERMCAP variable in case the USE_GETCAP symbol is defined (patch by Todd C Miller). + modify one of the m4 files used to generate the Ada95 sources, to avoid using the token "symbols" (patch by Juergen Pfeifer). 20000408 + add terminfo entries bsdos-pc-m, bsdos-pc-mono (Jeffrey C Honig) + correct spelling error in terminfo entry name: bq300-rv was given as bg300-rv in esr's version. + modify redrawwin() macro so its parameter is fully parenthesized (fixes Debian #61088). + correct formatting error in dump_entry() which set incorrect column value when no newline trimming was needed at the end of an entry, before appending "use=" clauses (cf: 960406). 20000401 + add configure option --with-manpage-symlinks + change unctrl() to render C1 characters (128-159) as ~@, ~A, etc. + change makefiles so trace() function is provided only if TRACE is defined, e.g., in the debug library. Modify related calls to _tracechar() to use unctrl() instead. 20000325 + add screen's AX capability (for ECMA SGR 39 and 49) to applicable terminfo entries, use presence of this as a check for a small improvement in setting default colors. + improve logic in _nc_do_color() implementing assume_default_colors() by passing in previous color pair info to eliminate redundant call to set_original_colors(). (Part of this is from a patch by Alexander V Lukyanov). + modify warning in _nc_trans_string() about a possibly too-long string to do this once only rather than for each character past the threshold (600). Change interface of _nc_trans_string() to allow check for buffer overflow. + correct use of memset in _nc_read_entry_source() to initialize ENTRY struct each time before reading new data into it, rather than once per loop (cf: 990301). This affects multi-entry in-core operations such as "infocmp -Fa". 20000319 + remove a spurious pointer increment in _nc_infotocap() changes from 20000311. Add check for '.' in format of number, since that also is not permitted in termcap. + correct typo in rxvt-basic terminfo from temporary change made while integrating 20000318. 20000318 + revert part of the vt220 change (request by Todd C Miller). + add ansi-* terminfo entries from ESR's version. + add -a option to tic and infocmp, which retains commented-out capabilities during source translation/comparison, e.g., captoinfo and infotocap. + modify cardfile.c to display an empty card if no input data file is found, fixes a core dump in that case (reported by Bruno Haible). + correct bracketing in CF_MATH_LIB configure macro, which gave wrong result for OS/2 EMX. + supply required parameter for _nc_resolve_uses() call in read_termcap.c, overlooked in 20000311 (reported by Todd C Miller). > patches by Bruno Haible : + fix a compiler warning in fty_enum.c + correct LIB_PREFIX expression for DEPS_CURSES in progs, tack makefiles, which resulted in redundant linking (cf: 20000122). 20000311 + make ifdef's for BROKEN_LINKER consistent (patch by Todd C Miller). + improved tack/README (patch by Daniel Weaver). + modify tput.c to ensure that unspecified parameters are passed to tparm() as 0's. + add a few checks in infocmp to guard against buffer overflow when displaying string capabilities. + add check for zero-uses in infocmp's file_comparison() function before calling _nc_align_termtype(). Otherwise one parameter is indexed past the end of the uses-array. + add an option -q to infocmp to specify the less verbose output, keeping the existing format as the default, though not retaining the previous behavior that made the -F option compare each entry to itself. + adapted patch by ESR to make infocmp -F less verbose -TD (the submitted patch was unusable because it did not compile properly) + modify write_entry.c to ensure that absent or cancelled booleans are written as FALSE, for consistency with infocmp which now assumes this. Note that for the small-core configuration, tic may not produce the same result as before. + change some private library interfaces used by infocmp, e.g., _nc_resolve_uses(). + add a check in _nc_infotocap() to ensure that cm-style capabilities accept only %d codes when converting the format from terminfo to termcap. + modify ENTRY struct to separate the data in 'parent' into the name and link values (the original idea to merge both into 'parent' was not good). + discard repair_acsc(tterm); > patch by Juergen Pfeifer: + drop support for gnat 3.10 + move generated documentation and html files under ./doc directory, adding makefile rules for this to dist.mk 20000304 + correct conflicting use of tparm() in 20000226 change to tic, which made it check only one entry at a time. + fix errors in ncurses-intro.html and hackguide.html shown by Dave Raggett's tidy. + make the example in ncurses-intro.html do something plausible, and corrected misleading comment (reported by Neil Zanella). + modify pnoutrefresh() to set newscr->_leaveok as wnoutrefresh() does, to fix a case where the cursor position was not updated as in Solaris (patch by David Mosberger ). + add a limit-check for wresize() to ensure that a subwindow does not address out of bounds. + correct offsets used for subwindows in wresize() (patch by Michael Andres ). + regenerate html'ized manual pages with man2html 3.0.1 (patch by Juergen Pfeifer). This generated a file with a space in its name, which I removed. + fix a few spelling errors in tack. + modify tack/Makefile.in to match linker options of progs/Makefile.in; otherwise it does not build properly for older HPUX shared library configurations. + add several terminfo entries from esr's "11.0". 20000226 + make 'tput flash' work properly for xterm by flushing output in delay_output() when using napms(), and modifying xterm's terminfo to specify no padding character. Otherwise, xterm's reported baud rate can mislead ncurses into producing too few padding characters (Debian #58530). + add a check to tic for consistency between sgr and the separate capabilities such as smso, use this to check/correct several terminfo entries (Debian #58530). + add a check to tic if cvvis is the same as cnorm, adjusted several terminfo entries to remove the conflict (Debian #58530). + correct prototype shown in attr_set()/wattr_set() manpages (fixes Debian #53962). + minor clarification for curs_set() and leaveok() manpages. + use mkstemp() for creating temporary file for tic's processing of $TERMCAP contents (fixes Debian #56465). + correct two errors from integrating Alexander's changes: did not handle the non-bce case properly in can_erase_with() (noted by Alexander), and left fg/bg uninitialized in the pair-zero case of _nc_do_color() (reported by Dr Werner Fink and Ismael Cordeiro ). 20000219 + store default-color code consistently as C_MASK, even if given as -1 for convenience (adapted from patches by Alexander V Lukyanov). > patches by Alexander V Lukyanov: + change can_clear_with() macro to accommodate logic for assume_default_colors(), making most of the FILL_BCE logic unnecessary. Made can_clear_with() an inline function to make it simpler to read. 20000212 + corrected form of recent copyright dates. + minor corrections to xterm-xf86-v333 terminfo entry -TD > patches by Alexander V Lukyanov: + reworded dft_fgbg.3x to avoid assuming that the terminal's default colors are white on black. + fix initialization of tstLine so that it is filled with current blank character in any case. Previously it was possible to have it filled with old blank. The wrong over-optimization was introduced in 991002 patch. (it is not very critical as the only bad effect is not using clr_eos for clearing if blank has changed). 20000205 + minor corrections/updates to several terminfo entries: rxvt-basic, vt520, vt525, ibm5151, xterm-xf86-v40 -TD + modify ifdef's for poll() to allow it to use , thereby allowing poll() to be used on Linux. + add CF_FUNC_POLL macro to check if poll() is able to select from standard input. If not we will not use it, preferring select() (adapted from patch by Michael Pakovic ). + update CF_SHARED_OPTS macro for SCO Unixware 7.1 to allow building shared libraries (reported/tested by Thanh ). + override $LANGUAGE in build to avoid incorrect ordering of keynames. + correct CF_MATH_LIB parameter, must be sin(x), not sqrt(x). 20000122 + resync CF_CHECK_ERRNO and CF_LIB_PREFIX macros from tin and xterm -TD + modify CF_MATH_LIB configure macro to parameterize the test function used, for reuse in dialog and similar packages. + correct tests for file-descriptors in OS/2 EMX mouse support. A negative value could be used by FD_SET, causing the select() call to wait indefinitely. 20000115 + additional fixes for non-bce terminals (handling of delete_character) to work when assume_default_colors() is not specified. + modify warning message from _nc_parse_entry() regarding extended capability names to print only if tic/infocmp/toe have the -v flag set, and not at all in ordinary user applications. Otherwise, this warning would be shown for screen's extended capabilities in programs that use the termcap interface (reported by Todd C Miller). + modify use of _nc_tracing from programs such as tic so their debug level is not in the same range as values set by trace() function. + small panel header cleanup (patch by Juergen Pfeifer). + add 'railroad' demo for termcap interface. + modify 'tic' to write its usage message to stderr (patch by Todd C Miller). 20000108 + add prototype for erase() to curses.h.in, needed to make test programs build with c++/g++. + add .c.i and .c.h suffix rules to generated makefiles, for debugging. + correct install rule for tack.1; it assumed that file was in the current directory (reported by Mike Castle ). + modify terminfo/termcap translation to suppress acsc before trying sgr if the entry would be too large (patch by Todd C Miller). + document a special case of incompatiblity between ncurses 4.2 and 5.0, add a section for this in INSTALL. + add TRACE_DATABASE flag for trace(). 20000101 + update mach, add mach-color terminfo entries based on Debian diffs for ncurses 5.0 -TD + add entries for xterm-hp, xterm-vt220, xterm-vt52 and xterm-noapp terminfo entries -TD + change OTrs capabilities to rs2 in terminfo.src -TD + add obsolete and extended capabilities to 'screen' terminfo -TD + corrected conversion from terminfo rs2 to termcap rs (cf: 980704) + make conversion to termcap ug (underline glitch) more consistently applied. + fix out-of-scope use of 'personal[]' buffer in 'toe' (this error was in the original pre-1.9.7 version, when $HOME/.terminfo was introduced). + modify 'toe' to ignore terminfo directories to which it has no permissions. + modify read_termtype(), fixing 'toe', which could dump core when it found an incomplete entry such as "dumb" because it did not initialize its buffer for _nc_read_file_entry(). + use -fPIC rather than -fpic for shared libraries on Linux, not needed for i386 but some ports (from Debian diffs for 5.0) -TD + use explicit VALID_NUMERIC() checks in a few places that had been overlooked, and add a check to ensure that init_tabs is nonzero, to avoid divide-by-zero (reported by Todd C Miller). + minor fix for CF_ANSI_CC_CHECK configure macro, for HPUX 10.x (from tin) -TD 19991218 + reorder tests during mouse initialization to allow for gpm to run in xterm, or for xterm to be used under OS/2 EMX. Also drop test for $DISPLAY in favor of kmous=\E[M or $TERM containing "xterm" (report by Christian Weisgerber ). + modify raw() and noraw() to clear/restore IEXTEN flag which affects stty lnext on systems such as FreeBSD (report by Bruce Evans , via Jason Evans ). + fix a potential (but unlikely) buffer overflow in failed() function of tset.c (reported by Todd C Miller). + add manual-page for ncurses extensions, documented curses_version(), use_extended_names(). 19991211 + treat as untranslatable to termcap those terminfo strings which contain non-decimal formatting, e.g., hexadecimal or octal. + correct commented-out capabilities that cannot be translated to termcap, which did not check if a colon must be escaped. + correct termcap translation for "%>" and "%+", which did not check if a colon must be escaped, for instance. + use save_string/save_char for _nc_captoinfo() to eliminate fixed buffer (originally for _nc_infotocap() in 960301 -TD). + correct expression used for terminfo equivalent of termcap %B, adjust regent100 entry which uses this. + some cleanup and commenting of ad hoc cases in _nc_infotocap(). + eliminate a fixed-buffer in tic, used for translating comments. + add manpage for infotocap 19991204 + add kvt and gnome terminfo entries -TD + correct translation of "%%" by infotocap, which was emitted as "%". + add "obsolete" termcap strings to terminfo.src + modify infocmp to default to showing obsolete capabilities rather than terminfo only. + modify write_entry.c so that if extended names (i.e., configure --enable-tcap-names) are active, then tic will also write "obsolete" capabilities that are present in the terminfo source. + modify tic so that when running as captoinfo or infotocap, it initializes the output format as in -C and -I options, respectively. + improve infocmp and tic -f option by splitting long strings that do not have if-then-else construct, but do have parameters, e.g., the initc for xterm-88color. + refine MKtermsort.sh slightly by using bool for the *_from_termcap arrays. 19991127 + additional fixes for non-bce terminals (handling of clear_screen, clr_eol, clr_eos, scrolling) to work when assume_default_colors() is not specified. + several small changes to xterm terminfo entries -TD. + move logic for _nc_windows in lib_freeall.c inside check for nonnull SP, since it is part of that struct. + remove obsolete shlib-versions, which was unintentionally re-added in 970927. + modify infocmp -e, -E options to ensure that generated fallback.c type for Booleans agrees with term.h (reported by Eric Norum ). + correct configure script's use of $LIB_PREFIX, which did not work for installing the c++ directory if $libdir did not end with "/lib" (reported by Huy Le ). + modify infocmp so -L and -f options work together. + modify the initialization of SP->_color_table[] in start_color() so that color_content() will return usable values for COLORS greater than 8. + modify ncurses 'd' test in case COLORS is greater than 16, e.g., for xterm-88color, to limit the displayed/computed colors to 16. > patch by Juergen Pfeifer: + simplify coding of the panel library according to suggestions by Philippe Blain. + improve macro coding for a few macros in curses.priv.h 19991113 + modify treatment of color pair 0 so that if ncurses is configured to support default colors, and they are not active, then ncurses will set that explicitly, not relying on orig_colors or orig_pair. + add new extension, assume_default_colors() to provide better control over the use of default colors. + modify test programs to use more-specific ifdef's for existence of wresize(), resizeterm() and use_default_colors(). + modify configure script to add specific ifdef's for some functions that are included when --enable-ext-funcs is in effect, so their existence can be ifdef'd in the test programs. + reorder some configure options, moving those extensions that have evolved from experimental status into a new section. + change configure --enable-tcap-names to enable this by default. 19991106 + install tack's manpage (reported by Robert Weiner ) + correct worm.c's handling of KEY_RESIZE (patch by Frank Heckenbach). + modify curses.h.in, undef'ing some symbols to avoid conflict with C++ STL (reported by Matt Gerassimoff ) 19991030 + modify linux terminfo entry to indicate that dim does not mix with color (reported by Klaus Weide ). + correct several typos in terminfo entries related to missing '[' in CSI's -TD + fix several compiler warnings in c++ binding (reported by Tim Mooney for alphaev56-dec-osf4.0f + rename parameter of _nc_free_entries() to accommodate lint. + correct lint rule for tack, used incorrect list of source files. + add case to config.guess, config.sub for Rhapsody. + improve configure tests for libg++ and libstdc++ by omitting the math library (which is missing on Rhapsody), and improved test for the math library itself (adapted from path by Nelson H. F. Beebe). + explicitly initialize to zero several data items which were implicitly initialized, e.g., cur_term. If not explicitly initialized, their storage type is C (common), and causes problems linking on Rhapsody 5.5 using gcc 2.7.2.1 (reported by Nelson H. F. Beebe). + modify Ada95 binding to not include the linker option for Ada bindings in the Ada headers, but in the Makefiles instead (patch by Juergen Pfeifer). 19991023 5.0 release for upload to ftp.gnu.org + effective with release of 5.0, change NCURSES_VERSION_PATCH to 4-digit year. + add function curses_version(), to return ncurses library version (request by Bob van der Poel). + remove rmam, smam from cygwin terminfo entry. + modify FreeBSD cons25 terminfo entry to add cnorm and cvvis, as well as update ncv to indicate that 'dim' conflicts with colors. + modify configure script to use symbolic links for FreeBSD shared libraries by default. + correct ranf() function in rain and worm programs to ensure it does not return 1.0 + hide the cursor in hanoi.c if it is running automatically. + amend lrtest.c to account for optimizations that exploit margin wrapping. + add a simple terminfo demo, dots.c + modify SIGINT/SIGQUIT handler to set a flag used in _nc_outch() to tell it to use write() rather than putc(), since the latter is not safe in a signal handler according to POSIX. + add/use internal macros _nc_flush() and NC_OUTPUT to hide details of output-file pointer in ncurses library. + uncomment CC_SHARED_OPTS (see 971115), since they are needed for SCO OpenServer. + correct CC_SHARED_OPTS for building shared libraries for SCO OpenServer. + remove usleep() from alternatives in napms(), since it may interact with alarm(), causing a process to be interrupted by SIGALRM (with advice from Bela Lubkin). + modify terminal_interface-curses-forms.ads.m4 to build/work with GNAT 3.10 (patch by Juergen Pfeifer). + remove part of CF_GPP_LIBRARY configure-script macro, which did not work with gcc 2.7.2.3 + minor fix to test/tclock.c to avoid beeping more than once per second + add 's' and ' ' decoding to test/rain.c 991016 pre-release + corrected BeOS code for lib_twait.c, making nodelay() function work. 991009 pre-release + correct ncurses' value for cursor-column in PutCharLR(), which was off-by-one in one case (patch by Ilya Zakharevich). + fix some minor errors in position_check() debugging code, found while using this to validate the PutCharLR() patch. + modify firework, lrtest, worm examples to be resizable, and to recognize 'q' for quit, 's' for single-step and ' ' for resume. + restore reverted change to terminal_interface-curses-forms.ads.m4, add a note on building with gnat 3.10p to Ada95/TODO. + add a copy of the standalone configure script for the test-directory to simplify testing on SCO and Solaris. 991002 pre-release + minor fixes for _nc_msec_cost(), color_content(), pair_content(), _nc_freewin(), ClrBottom() and onscreen_mvcur() (analysis by Philippe Blain, comments by Alexander V Lukyanov). + simplify definition of PANEL and eliminate internal functions _nc_calculate_obscure(), _nc_free_obscure() and _nc_override(), (patch by Juergen Pfeifer, analysis by Philippe Blain )). + change renaming of dft_fgbg.3x to use_default_colors.3ncurses in man_db.renames, since Debian is not concerned with 14-character filename limitation (Debian bug report by Josip Rodin ). + corrected scoansi terminfo entry by testing with scoterm and console. + revert change from 990614 to terminal_interface-curses-forms.ads.m4, since this does not work for gnat 3.10p + modify tclock example to be resizable (if ncurses' sigwinch handler is used), and in color. + use $(CC) rather than 'gcc' in MK_SHARED_LIB symbols, used for Linux shared library rules. 990925 pre-release + add newer NetBSD console terminfo entries + add amiga-8bit terminfo entry (from Henning 'Faroul' Peters ) + remove -lcurses -ltermcap from configure script's check for the gpm library, since they are not really necessary (a properly configured gpm library has no dependency on any curses library), and if the curses library is not installed, this would cause the test to fail. + modify tic's -C option so that terminfo "use=" clauses are translated to "tc=" clauses even when running it as captoinfo. + modify CF_STDCPP_LIBRARY configure macro to perform its check only for GNU C++, since that library conflicts with SGI's libC on IRIX-6.2 + modify CF_SHARED_OPTS configure macro to support build on NetBSD with ELF libraries (patch by Bernd Ernesti ). + correct a problem in libpanel, where the _nc_top_panel variable was not set properly when bottom_panel() is called to hide a panel which is the only one on the stack (report/analysis by Michael Andres , patch by Juergen Pfeifer). 990918 pre-release + add acsc string to HP 70092 terminfo entry (patch by Joerg Wunsch ). + add top-level uninstall.data and uninstall.man makefile rules. + correct logic of CF_LINK_FUNCS configure script, from BeOS changes so that hard-links work on Unix again. + change default value of cf_cv_builtin_bool to 1 (suggested by Jeremy Buhler), making it less likely that a conflicting declaration of bool will be seen when compiling with C++. 990911 pre-release + improved configure checks for builtin.h + minor changes to C++ binding (remove static initializations, and make configure-test for parameter initializations) for features not allowed by vendor's C++ compilers (reported by Martin Mokrejs, this applies to SGI, though I found SCO has the same characteristics). + corrected quoting of ETIP_xxx definitions which support old versions of g++, e.g., those using -lg++ + remove 'L' code from safe_sprintf.c, since 'long double' is not widely portable. safe_sprintf.c is experimental, however, and exists mainly as a fallback for systems without snprintf (reported by Martin Mokrejs , for IRIX 6.2) + modify definition of _nc_tinfo_fkeys in broken-linker configuration so that it is not unnecessarily made extern (Jeffrey C Honig). 990904 pre-release + move definition for builtin.h in configure tests to specific check for libg++, since qt uses the same filename incompatibly. + correct logic of lib_termcap.c tgetstr function, which did not copy the result to the buffer parameter. Testing shows Solaris does update this, though of course tgetent's buffer is untouched (reported in Peter Edwards in mpc.lists.freebsd.current newsgroup. + corrected beterm terminfo entry, which lists some capabilities which are not actually provided by the BeOS Terminal. + add special logic to replace select() calls on BeOS, whose select() function works only for sockets. + correct missing escape in mkterm.h.awk.in, which caused part of the copyright noticed to be omitted (reported by Peter Wemm ). > several small changes to make the c++ binding and demo work on OS/2 EMX (related to a clean reinstall of EMX): + correct library-prefix for c++ binding; none is needed. + add $x suffix to make_hash and make_keys so 'make distclean' works. + correct missing $x suffix for tack, c++ demo executables. + split CF_CXX_LIBRARY into CF_GPP_LIBRARY (for -lg++) and CF_STDCPP_LIBRARY (for -lstdc++) 990828 pre-release + add cygwin terminfo entry -TD + modify CF_PROG_EXT configure macro to set .exe extension for cygwin. + add configure option --without-cxx-binding, modifying the existing --without-cxx option to check only for the C++ compiler characteristics. Whether or not the C++ binding is needed, the configure script checks for the size/type of bool, to make ncurses match. Otherwise C++ applications cannot use ncurses. 990821 pre-release + updated configure macros CF_MAKEFLAGS, CF_CHECK_ERRNO + minor corrections to beterm terminfo entry. + modify lib_setup.c to reject values of $TERM which have a '/' in them. + add ifdef's to guard against CS5, CS6, CS7, CS8 being zero, as more than one is on BeOS. That would break a switch statement. + add configure macro CF_LINK_FUNCS to detect and work around BeOS's nonfunctional link(). + improved configure macros CF_BOOL_DECL and CF_BOOL_SIZE to detect BeOS's bool, which is declared as an unsigned char. 990814 pre-release + add ms-vt100 terminfo entry -TD + minor fixes for misc/emx.src, based on testing with tack. + minor fix for test/ncurses.c, test 'a', in case ncv is not set. 990731 pre-release + minor correction for 'screen' terminfo entry. + clarify description of errret values for setupterm in manpage. + modify tput to allow it to emit capabilities for hardcopy terminals (patch by Goran Uddeborg ). + modify the 'o' (panel) test in ncurses.c to show the panels in color or at least in bold, to test Juergen's change to wrefresh(). > patches by Juergen Pfeifer: + Fixes a problem using wbkgdset() with panels. It has actually nothing to with panels but is a problem in the implementation of wrefresh(). Whenever a window changes its background attribute to something different than newscr's background attribute, the whole window is touched to force a copy to newscr. This is an unwanted side-effect of wrefresh() and it is actually not necessary. A changed background attribute affects only further outputs of background it doesn't mean anything to the current content of the window. So there is no need to force a copy. (reported by Frank Heckenbach ). + an upward compatible enhancement of the NCursesPad class in the C++ binding. It allows one to add a "viewport" window to a pad and then to use panning to view the pad through the viewport window. 990724 pre-release + suppress a call to def_prog_mode() in the SIGTSTP handler if the signal was received while not in curses mode, e.g., endwin() was called in preparation for spawning a shell command (reported by Frank Heckenbach ) + corrected/enhanced xterm-r5, xterm+sl, xterm+sl-twm terminfo entries. + change test for xterm mouse capability: it now checks only if the user's $DISPLAY variable is set in conjunction with the kmous capability being present in the terminfo. Before, it checked if any of "xterm", "rxvt" or "kterm" were substrings of the terminal name. However, some emulators which are incompatible with xterm in other ways do support the xterm mouse capability. + reviewed and made minor changes in ncurses to quiet g++ warnings about shadowed or uninitialized variables. g++ incorrectly warns about uninitialized variables because it does not take into account short-circuit expression evaluation. + change ncurses 'b' test to start in color pair 0 and to show in the right margin those attributes which are suppressed by no_color_video, i.e., "(NCV)". + modify ifdef's in curses.h so that __attribute__ is not redefined when compiling with g++, but instead disabled the macros derived for __attribute__ since g++ does not consistently recognize the same keywords as gcc (reported by Stephan K Zitz ). + update dependencies for term.h in ncurses/modules (reported by Ilya Zakharevich). 990710 pre-release + modify the form demo in ncurses.c to illustrate how to manipulate the field appearance, e.g, for highlighting or translating the field contents. + correct logic in write_entry from split-out of home_terminfo in 980919, which prevented update of $HOME/.terminfo (reported by Philip Spencer ). 990703 pre-release + modify linux terminfo description to make use of kernel 2.2.x mods that support cursor style, e.g., to implement cvvis (patch by Frank Heckenbach ) + add special-case in setupterm to retain previously-saved terminal settings in cur_term, which happens when curses and termcap calls are mixed (from report by Bjorn Helgaas ). + suppress initialization of key-tries in _nc_keypad() if we are only disabling keypad mode, e.g., in endwin() called when keypad() was not. + modify the Ada95 makefile to ensure that always the Ada files from the development tree are used for building and not the eventually installed ones (patch by Juergen Pfeifer). 990626 pre-release + use TTY definition in tack/sysdep.c rather than struct termios (reported by Philippe De Muyter). + add a fallback for strstr, used in lib_mvcur.c and tack/edit.c, not present on sysV68 (reported by Philippe De Muyter). + correct definition in comp_hash.c to build with configure --with-rcs-ids option. 990619 pre-release + modified ifdef's for sigaction and sigvec to ensure we do not try to handle SIGTSTP if neither is available (from report by Philippe De Muyter). > patch by Philippe De Muyter: + in tic.c, use `unlink' if `remove' is not available. + use only `unsigned' as fallback value for `speed_t'. Some files used `short' instead. 990616 pre-release + fix some compiler warnings in tack. + add a check for predefined bool type in CC, based on report that BeOS predefines a bool type. + correct logic for infocmp -e option, i.e., the configure --with-fallbacks option, which I'd not updated when implementing extended names (cf: 990301). The new implementation adds a "-E" option to infocmp -TD > patch by Juergen Pfeifer: + introduce the private type Curses_Bool in the Ada95 binding implementation. This is to clearly represent the use of "bool" also in the binding. It should have no effect on the generated code. + improve the man page for field_buffer() to tell the people, that the whole buffer including leading/trailing spaces is returned. This is a common source of confusion, so it's better to document it clearly. 990614 pre-release > patch by Juergen Pfeifer: + use pragma PreElaborate in several places. + change a few System.Address uses to more specific types. + change interface version-number to 1.0 + regenerate Ada95 HTML files. 990612 pre-release + modify lib_endwin.c to avoid calling reset_shell_mode(), return ERR if it appears that curses was never initialized, e.g., by initscr(). For instance, this guards against setting the terminal modes to strange values if endwin() is called after setupterm(). In the same context, Solaris curses will dump core. + modify logic that avoids a conflict in lib_vidattr.c between sgr0 and equivalent values in rmso or rmul by ensuring we do not modify the data which would be returned by the terminfo or termcap interfaces (reported by Brad Pepers , cf: 960706). + add a null-pointer check for SP in lib_vidattr.c to logic that checks for magic cookies. + improve fallback declaration of 'bool' when the --without-cxx option is given, by using a 'char' on i386 and related hosts (prompted by discussion with Alexander V Lukyanov). 990605 pre-release + include time.h in lib_napms.c if nanosleep is used (patch by R Lindsay Todd ). + add an "#undef bool" to curses.h, in case someone tries to define it, e.g., perl. + add check to tparm to guard against divide by zero (reported by Aaron Campbell ). 990516 pre-release + minor fix to build tack on CLIX (mismatched const). > patch by Juergen Pfeifer: + change Juergen's old email address with new one in the files where it is referenced. The Ada95 HTML pages are regenerated. + update MANIFEST to list the tack files. 990509 pre-release + minor fixes to make 'tack' build/link on NeXT (reported by Francisco A. Tomei Torres). 990417 pre-release + add 'tack' program (which is GPL'd), updating it to work with the modified TERMTYPE struct and making a fix to support setaf/setab capabilities. Note that the tack program is not part of the ncurses libraries, but an application which can be distributed with ncurses. The configure script will ignore the directory if it is omitted, however. + modify gpm mouse support so that buttons 2 and 3 are used for select/paste only when shift key is pressed, making them available for use by an application (patch by Klaus Weide). + add complete list of function keys to scoansi terminfo entry - TD 990410 pre-release + add a simple test program cardfile.c to illustrate how to read form fields, and showing forms within panels. + change shared-library versioning for the Hurd to be like Linux rather than *BSD (patch by Mark Kettenis ). + add linux-lat terminfo entry. + back-out _nc_access check in read_termcap.c (both incorrect and unnecessary, except to guard against a small window where the file's ownership may change). 990403 pre-release + remove conflicting _nc_free_termtype() function from test module lib_freeall.c + use _nc_access check in read_termcap.c for termpaths[] array (noted by Jeremy Buhler, indicating that Alan Cox made a similar patch). > patch by Juergen Pfeifer: + modify menu creation to not inherit status flag from the default menu which says that the associated marker string has been allocated and should be freed (bug reported by Marek Paliwoda" ) 990327 pre-release (alpha.gnu.org:/gnu/ncurses-5.0-beta1.tar.gz) + minor fixes to xterm-xfree86 terminfo entry - TD. + split up an expression in configure script check for ldconfig to workaround limitation of BSD/OS sh (reported by Jeff Haas ). + correct a typo in man/form_hook.3x (Todd C Miller). 990318 pre-release + parenthesize and undef 'index' symbol in c++ binding and demo, to accommodate its definition on NeXT (reported by Francisco A. Tomei Torres). + add sigismember() to base/sigaction.c compatibility to link on NeXT (reported by Francisco A. Tomei Torres). + further refinements to inequality in hashmap.c to cover a case with ^U in nvi (patch by Alexander V Lukyanov). 990316 pre-release + add fallback definition for getcwd, to link on NeXT. + add a copy of cur_term to tic.c to make it link properly on NeXT (reported by Francisco A. Tomei Torres). + change inequality in hashmap.c which checks the distance traveled by a chunk so that ^D command in nvi (scrolls 1/2 screen) will use scrolling logic (patch by Alexander V Lukyanov, reported by Jeffrey C Honig). 990314 pre-release + modify lib_color.c to handle a special case where the curscr attributes have been made obsolete (patch by Alexander V Lukyanov). + update BSD/OS console terminfo entries to use klone+sgr and klone+color (patch by Jeffrey C Honig). + update glibc addon configure script for extended capabilities. + correct a couple of warnings in the --enable-const configuration. + make comp_hash build properly with _nc_strdup(), on NeXT (reported by Francisco A. Tomei Torres ). 990313 pre-release + correct typos in linux-c initc string - TD + add 'crt' terminfo entry, update xterm-xfree86 entry - TD + remove a spurious argument to tparm() in lib_sklrefr.c (patch by Alexander V Lukyanov). 990307 pre-release + back-out change to wgetch because it causes a problem with ^Z handling in lynx (reported by Kim DeVaughn). 990306 pre-release + add -G option to tic and infocmp, to reverse the "-g" option. + recode functions in name_match.c to avoid use of strncpy, which caused a 4-fold slowdown in tic (cf: 980530). + correct a few warnings about sign-extension in recent changes. > patch by Juergen Pfeifer: + fixes suggested by Jeff Bradbury : + improved parameter checking in new_fieldtype(). + fixed a typo in wgetch() timeout handling. + allow slk_init() to be called per newterm call. The internal SLK state is stored in the SCREEN struct after every newterm() and then reset for the next newterm. + fix the problem that a slk_refresh() refreshes stdscr if the terminal has true SLKs. + update HTML documentation for Ada binding. 990301 pre-release + remove 'bool' casts from definitions of TRUE/FALSE so that statements such as "#if TRUE" work. This was originally done to allow for a C++ compiler which would warn of implicit conversions between enum and int, but is not needed for g++ (reported by Kim DeVaughn). + add use_extended_names() function to allow applications to suppress read of the extended capabilities. + add configure option --enable-tcap-names to support logic which allows ncurses' tic to define new (i.e., extended) terminal capabilities. This is activated by the tic -x switch. The infocmp program automatically shows or compares extended capabilities. Note: This changes the Strings and similar arrays in the TERMTYPE struct so that applications which manipulate it must be recompiled. + use macros typeMalloc, typeCalloc and typeRealloc consistently throughout ncurses library. + add _nc_strdup() to doalloc.c. + modify define_key() to allow multiple strings to be bound to the same keycode. + correct logic error in _nc_remove_string, from 990220. > patch for Ada95 binding (Juergen Pfeifer): + regenerate some of the html documentation + minor cleanup in terminal_interface-curses.adb 990220 pre-release + resolve ambiguity of kend/kll/kslt and khome/kfnd/kich1 strings in xterm and ncsa terminfo entries by removing the unneeded ones. Note that some entries will return kend & khome versus kslt and kfnd, for PC-style keyboards versus strict vt220 compatiblity - TD + add function keybound(), which returns the definition associated with a given keycode. + modify define_key() to undefine the given string when no keycode is given. + modify keyok() so it works properly if there is more than one string defined for a keycode. + add check to tic to warn about terminfo descriptions that contain more than one key assigned to the same string. This is shown only if the verbose (-v) option is given. Moved related logic (tic -v) from comp_parse.c into the tic program. + add/use _nc_trace_tries() to show the function keys that will be recognized. + rename init_acs to _nc_init_acs (request by Alexander V Lukyanov). > patch for Ada95 binding (Juergen Pfeifer): + remove all the *_adabind.c from ncurses, menu and form projects. Those little helper routines have all been implemented in Ada and are no longer required. + The option handling routines in menu and form have been made more save. They now make sure that the unused bits in options are always zero. + modify configuration scripts to + use gnatmake as default compiler name. This is a safer choice than gcc, because some GNAT implementations use other names for the compilerdriver to avoid conflicts. + use new default installation locations for the Ada files according to the proposed GNU Ada filesystem standard (for Linux). + simplify the Makefiles for the Ada binding + rename ada_include directory to src. 990213 + enable sigwinch handler by default. + disable logic that allows setbuf to be turned off/on, because some implementations will overrun the buffer after it has been disabled once. 990206 + suppress sc/rc capabilities from terminal description if they appear in smcup/rmcup. This affects only scrolling optimization, to fix a problem reported by several people with xterm's alternate screen, though the problem is more general. > patch for Ada95 binding (Juergen Pfeifer): + removed all pragma Preelaborate() stuff, because the just released gnat-3.11p complains on some constructs. + fixed some upper/lower case notations because gnat-3.11p found inconsistent use. + used a new method to generate the HTML documentation of the Ada95 binding. This invalidates nearly the whole ./Ada95/html subtree. Nearly all current files in this subtree are removed 990130 + cache last result from _nc_baudrate, for performance (suggested by Alexander V Lukyanov). + modify ClrUpdate() function to workaround a problem in nvi, which uses redrawwin in SIGTSTP handling. Jeffrey C Honig reported that ncurses repainted the screen with nulls before resuming normal operation (patch by Alexander V Lukyanov). + generalize is_xterm() function a little by letting xterm/rxvt/kterm be any substring rather than the prefix. + modify lib_data.c to initialize SP. Some linkers, e.g., IBM's, will not link a module if the only symbols exported from the module are uninitialized ones (patch by Ilya Zakharevich). Ilya says that he has seen messages claiming this behavior conforms to the standard.) + move call on _nc_signal_handler past _nc_initscr, to avoid a small window where Nttyb hasn't yet been filled (reported by Klaus Weide). + modify lib_tstp.c to block SIGTTOU when handling SIGTSTP, fixes a problem where ncurses applications which were run via a shell script would hang when given a ^Z. Also, check if the terminal's process group is consistent, i.e., a shell has not taken ownership of it, before deciding to save the current terminal settings in the SIGTSTP handler (patch by Klaus Weide). + correct spelling of ACS_ names in curs_border.3x (reported by Bob van der Poel ). + correct a couple of typos in the macros supporting the configure --with-shlib-version option. 990123 + modify fty_regex.c to compile on HAVE_REGEXPR_H_FUNCS machine (patch by Kimio Ishii ). + rename BSDI console terminfo entries: bsdos to bsdos-pc-nobold, and bsdos-bold to bsdos-pc (patch by Jeffrey C Honig). + modify tput to accept termcap names as an alternative to terminfo names (patch by Jeffrey C Honig). + correct a typo in term.7 (Todd C Miller). + add configure --with-shlib-version option to allow installing shared libraries named according to release or ABI versions. This parameterizes some existing logic in the configure script, and is intended for compatiblity upgrades on Digital Unix, which used versioned libraries in ncurses 4.2, but no longer does (cf: 980425). + resync configure script against autoconf 2.13 + patches + minor improvements for teraterm terminfo entry based on the program's source distribution. 990116 + change default for configure --enable-big-core to assume machines do have enough memory to resolve terminfo.src in-memory. + correct name of ncurses library in TEST_ARGS when configuring with debug library. + minor fixes to compile ncurses library with broken-linker with g++. + add --enable-broken-linker configure option, default to environment variable $BROKEN_LINKER (request by Jeffrey C Honig). + change key_names[] array to static since it is not part of the curses interface (reported by Jeffrey C Honig ). 990110 + add Tera Term terminfo entry - TD 990109 + reviewed/corrected macros in curses.h as per XSI document. + provide support for termcap PC variable by copying it from terminfo data and using it as the padding character in tputs (reported by Alexander V Lukyanov). + corrected iris-ansi and iris-ansi-ap terminfo entries for kent and kf9-kf12 capabilities, as well as adding kcbt. + document the mouse handling mechanism in menu_driver and make a small change in menu_driver's return codes to provide more consistency (patch by Juergen Pfeifer). + add fallback definition for NCURSES_CONST to termcap.h.in (reported by Uchiyama Yasushi ). + move lib_restart.c to ncurses/base, since it uses curses functions directly, and therefore cannot be used in libtinfo.so + rename micro_char_size to micro_col_size, adding #define to retain old name. + add set_a_attributes and set_pglen_inch to terminfo structure, as per XSI and Solaris 2.5. + minor makefile files to build ncurses test_progs + update html files in misc directory to reflect changes since 4.2 990102 + disable scroll hints when hashmap is enabled (patch by Alexander V Lukyanov). + move logic for tic's verify of -e option versus -I and -C so that the terminfo data is not processed if we cannot handle -e (reported by Steven Schwartz . + add test-driver traces to terminfo and termcap functions. + provide support for termcap ospeed variable by copying it from the internal cur_term member, and using ospeed as the baudrate reference for the delay_output and tputs functions. If an application does not set ospeed, the library behaves as before, except that _nc_timed_wait is no longer used, or needed, since ospeed always has a value. But the application can modify ospeed to adjust the output of padding characters (prompted by a bug report for screen 3.7.6 and email from Michael Schroeder ). + removed some unused ifdef's as part of Alexander's restructuring. + reviewed/updated curses.h, term.h against X/Open Curses Issue 4 Version 2. This includes making some parameters NCURSES_CONST rather than const, e.g., in termcap.h. + change linux terminfo entry to use ncv#2, since underline does not work with color 981226 + miscellaneous corrections for curses.h to match XSI. + change --enable-no-padding configure option to be normally enabled. + add section to ncurses manpage for environment variables. + investigated Debian bug report that pertains to screen 3.7.4/3.7.6 changes, found no sign of problems on Linux (or on SunOS, Solaris) running screen built with ncurses. + check if tmp_fp is opened in tic.c before closing it (patch by Pavel Roskin ). + correct several font specification typos in man-pages. 981220 + correct default value for BUILD_CC (reported by Larry Virden). 981219 + modify _nc_set_writedir() to set a flag in _nc_tic_dir() to prevent it from changing the terminfo directory after chdir'ing to it. Otherwise, a relative path in $TERMINFO would confuse tic (prompted by a Debian bug report). + correct/update ncsa terminfo entry (report by Larry Virden). + update xterm-xfree86 terminfo to current (patch 90), smcur/rmcur changes + add Mathew Vernon's mach console entries to terminfo.src + more changes, moving functions, as part of Alexander's restructuring. + modify configure script for GNU/Hurd share-library support, introduce BUILD_CC variable for cross compiling (patch by Uchiyama Yasushi ) 981212 + add environment variable NCURSES_NO_SETBUF to allow disabling the setbuf feature, for testing purposes. + correct ifdef's for termcap.h versus term.h that suppress redundant declarations of prototypes (reported by H.J.Lu). + modify Makefile.os2 to add linker flags which allow multiple copies of an application to coexist (reported by Ilya Zakharevich). + update Makefile.glibc and associated configure script so that ncurses builds as a glibc add-on with the new directory configuration (reported by H.J.Lu). 981205 + modify gen_reps() function in gen.c to work properly on SunOS (sparc), which is a left-to-right architecture. + modify relative_move and tputs to avoid an interaction with the BSD-style padding. The relative_move function could produce a string to replace on the screen which began with a numeric character, which was then interpreted by tputs as padding. Now relative_move will not generate a string with a leading digit in that case (overwrite). Also, tputs will only interpret padding if the string begins with a digit; as coded it permitted a string to begin with a decimal point or asterisk (reported by Larry Virden). > patches by Juergen Pfeifer: + fix a typo in m_driver.c mouse handling and improves the error handling. + fix broken mouse handling in the Ada95 binding + make the Ada95 sample application menus work with the new menu mouse support + improve the mouse handling introduced by Ilya; it now handles menus with spacing. + repair a minor bug in the menu_driver code discovered during this rework. + add new function wmouse_trafo() to hide implementation details of _yoffset member of WINDOW struct needed for mouse coordinate transformation. 981128 + modify Ada95/gen/gen.c to avoid using return-value of sprintf, since some older implementations (e.g., SunOS 4.x) return the buffer address rather than its length. > patch by Rick Ohnemus: + modify demo.cc to get it to compile with newer versions of egcs. + trim a space that appears at the end of the table preprocessor lines ('\" t). This space prevents some versions of man from displaying the pages - changed to remove all trailing whitespace (TD) + finally, 'make clean' does not remove panel objects. > patches by Ilya Zakharevich: + allow remapping of OS/2 mouse buttons using environment variable MOUSE_BUTTONS_123 with the default value 132. + add mouse support to ncurses menus. 981121 + modify misc/makedef.cmd to report old-style .def file symbols, and to generate the .def files sorted by increasing names rather than the reverse. + add misc/*.ref which are J.J.G.Ripoll's dll definition files (renamed from misc/*.old), and updated based on the entrypoint coding he used for an older version of ncurses. + add README.emx, to document how to build on OS/2 EMX. + updates for config.guess, config.sub from Lynx > patches by Ilya Zakharevich: + minor fixes for mouse handling mode: a) Do not initialize mouse if the request is to have no mouse; b) Allow switching of OS/2 VIO mouse on and off. + modify Makefile.os2 to support alternative means of generating configure script, by translating Unix script with Perl. > patches by Juergen Pfeifer: + Updates MANIFEST to reflect changes in source structure + Eliminates a problem introduced with my last patch for the C++ binding in the panels code. It removes the update() call done in the panel destructor. + Changes in the Ada95 binding to better support systems where sizeof(chtype)!=sizeof(int) (e.g. DEC Alpha). 981114 + modify install-script for manpages to skip over .orig and .rej files (request by Larry Virden). > patches/discussion by Alexander V Lukyanov: + move base-library sources into ncurses/base and tty (serial terminal) sources into ncurses/tty, as part of Alexander V Lukyanov's proposed changes to ncurses library. + copy _tracemouse() into ncurses.c so that lib_tracemse.c need not be linked into the normal ncurses library. + move macro winch to a function, to hide details of struct ldat > patches by Juergen Pfeifer: + fix a potential compile problem in cursesw.cc + some Ada95 cosmetics + fix a gen.c problem when compiling on 64-Bit machines + fix Ada95/gen/Makefile.in "-L" linker switch + modify Ada95 makefiles to use the INSTALL_PREFIX setting. 981107 + ifdef'd out lib_freeall.c when not configured. + rename _tracebits() to _nc_tracebits(). + move terminfo-library sources into ncurses/tinfo, and trace-support functions into ncurses/trace as part of Alexander V Lukyanov's proposed changes to ncurses library. + modify generated term.h to always specify its own definitions for HAVE_TERMIOS_H, etc., to guard against inclusion by programs with broken configure scripts. 981031 + modify terminfo parsing to accept octal and hexadecimal constants, like Solaris. + remove an autoconf 2.10 artifact from the configure script's check for "-g" compiler options. (Though harmless, this confused someone at Debian, who recently issued a patch that results in the opposite effect). + add configure option --with-ada-compiler to accommodate installations that do not use gcc as the driver for GNAT (patch by Juergen Pfeifer). 981017 + ensure ./man exists in configure script, needed when configuring with --srcdir option. + modify infocmp "-r" option to remove limit on formatted termcap output, which makes it more like Solaris' version. + modify captoinfo to treat no-argument case more like Solaris' version, which uses the contents of $TERMCAP as the entry to format. + modify mk-2nd.awk to handle subdirectories, e.g., ncurses/tty (patch by Alexander V Lukyanov). 981010 + modify --with-terminfo-dirs option so that the default value is the ${datadir} value, unless $TERMINFO_DIRS is already set. This gets rid of a hardcoded list of candidate directories in the configure script. + add some error-checking to _nc_read_file_entry() to ensure that strings are properly terminated (Todd C Miller). + rename manpage file curs_scr_dmp.3x to curs_scr_dump.3x, to correspond with contents (reported by Neil Zanella ). + remove redundant configure check for C++ which did not work when $CXX was specified with a full pathname (reported by Andreas Jaeger). + corrected bcopy/memmove check; the macro was not standalone. 981003 + remove unnecessary portion of OS/2 EMX mouse change from check_pending() (reported by Alexander V Lukyanov). 980926 + implement mouse support for OS/2 EMX (adapted from patch against 4.2(?) by Ilya Zakharevich). + add configure-check for bcopy/memmove, for 980919 changes to hashmap. + merge Data General terminfo from Hasufin - TD + merge AIX 3.2.5 terminfo descriptions for IBM terminals, replaces some older entries - TD + modify tic to compile into %'char' form in preference to %{number}, since that is a little more efficient. + minor correction to infocmp to avoid displaying "difference" between two capabilities that are rendered in equivalent forms. + add "-g" option to tic/infocmp to force character constants to be displayed in quoted form. Otherwise their decimal values are shown. + modify setupterm so that cancelled strings are treated the same as absent strings, cancelled and absent booleans false (does not affect tic, infocmp). + modify tic, infocmp to discard redundant i3, r3 strings when output to termcap format. > patch by Alexander V Lukyanov: + improve performance of tparm, now it takes 19% instead of 25% when profiling worm. + rename maxlen/minlen to prec/width for better readability. + use format string for printing strings. + use len argument correctly in save_text, and pass it to save_number. 980919 + make test_progs compile (but hashmap does not function). + correct NC_BUFFERED macro, used in lib_mvcur test-driver, modify associated logic to avoid freeing the SP->_setbuf data. + add modules home_terminfo and getenv_num to libtinfo. + move write_entry to libtinfo, to work with termcap caching. + minor fixes to blue.c to build with atac. + remove softscroll.c module; no longer needed for testing. > patches by Todd C Miller: + use strtol(3) instead of atoi(3) when parsing env variables so we can detect a bogus (non-numeric) value. + check for terminal names > MAX_NAME_SIZE in a few more places when dealing with env variables again. + fix a MAX_NAME_SIZE that should be MAX_NAME_SIZE+1 + use sizeof instead of strlen(3) on PRIVATE_INFO since it is a fixed string #define (compile time vs runtime). + when setting errno to ENOMEM, set it right before the return, not before code that could, possibly, set errno to a different value. > patches by Alexander V Lukyanov: + use default background in update_cost_from_blank() + disable scroll-hints when hashmap is configured. + improve integration of hashmap scrolling code, by adding oldhash and newhash data to SP struct. + invoke del_curterm from delscreen. + modify del_curterm to set cur_term to null if it matches the function's parameter which is deleted. + modify lib_doupdate to prefer parm_ich to the enter_insert_mode and exit_insert_mode combination, adjusting InsCharCost to check enter_insert_mode, exit_insert_mode and insert_padding. Add insert_padding in insert mode after each char. This adds new costs to the SP struct. 980912 + modify test-driver in lib_mvcur.s to use _nc_setbuffer, for consistent treatment. + modify ncurses to restore output to unbuffered on endwin, and resume buffering in refresh (see lib_set_term.c and NC_BUFFERED macro). + corrected HTML version numbers (according to the W3C validator, they never were HTML 2.0-compliant, but are acceptable 3.0). 980905 + modify MKterminfo.sh to generate terminfo.5 with tables sorted by capability name, as in SVr4. + modified term.h, termcap.h headers to avoid redundant declarations. + change 'u_int' type in tset.c to unsigned, making this compile on Sequent PRX 4.1 (reported by Michael Sterrett ). 980829 + corrections to mailing addresses, and moving the magic line that causes the man program to invoke tbl to the first line of each manpage (patch by Rick Ohnemus ). + add Makefile.os2 and supporting scripts to generate dll's on OS/2 EMX (from J.J.G.Ripoll, with further integration by TD). + correct a typo in icl6404 terminfo entry. + add xtermm and xtermc terminfo entries. > from esr's terminfo version: + Added Francesco Potorti's tuned Wyse 99 entries. + dtterm enacs (from Alexander V Lukyanov). + Add ncsa-ns, ncsa-m-ns and ncsa-m entries from esr version. 980822 + document AT&T acs characters in terminfo.5 manpage. + use EMX _scrsize() function if terminfo and environment do not declare the screen size (reported by Ilya Zakharevich ). + remove spurious '\' characters from eterm and osborne terminfo entries (prompted by an old Debian bug report). + correct reversed malloc/realloc calls in _nc_doalloc (reported by Hans-Joachim Widmaier ). + correct misplaced parenthesis which caused file-descriptor from opening termcap to be lost, from 980725 changes (reported by Andreas Jaeger). 980815 + modify lib_setup.c to eliminate unneeded include of when termios is not used (patch by Todd C Miller). + add function _nc_doalloc, to ensure that failed realloc calls do not leak memory (reported by Todd C Miller). + improved ncsa-telnet terminfo entry. 980809 + correct missing braces around a trace statement in read_entry.c, from 980808 (reported by Kim DeVaughn and Liviu Daia). 980808 + fix missing include in ditto.c (reported by Bernhard Rosenkraenzer ) + add NCSA telnet terminfo entries from Francesco Potorti , from Debian bug reports. + make handling of $LINES and $COLUMNS variables more compatible with Solaris by allowing them to individually override the window size as obtained via ioctl. 980801 + modify lib_vidattr.c to allow for terminal types (e.g., xterm-color) which may reset all attributes in the 'op' capability, so that colors are set before turning on bold and other attributes, but still after turning attributes off. + add 'ditto.c' to test directory to illustrate use of newterm for initializing multiple screens. + modify _nc_write_entry() to recover from failed attempt to link alias for a terminfo on a filesystem which does not preserve character case (reported by Peter L Jordan ). 980725 + updated versions of config.guess and config.sub based on automake 1.3 + change name-comparisons in lib_termcap to compare no more than 2 characters (gleaned from Debian distribution of 1.9.9g-8.8, verified with Solaris curses). + fix typo in curs_insstr.3x (patch by Todd C Miller) + use 'access()' to check if ncurses library should be permitted to open or modify files with fopen/open/link/unlink/remove calls, in case the calling application is running in setuid mode (request by Cristian Gafton , responding to Duncan Simpson ). + arm100 terminfo entries from Dave Millen ). + qnxt2 and minitel terminfo entries from esr's version. 980718 + use -R option with ldconfig on FreeBSD because otherwise it resets the search path to /usr/lib (reported by Dan Nelson). + add -soname option when building shared libraries on OpenBSD 2.x (request by QingLong). + add configure options --with-manpage-format and --with-manpage-renames (request by QingLong). + correct conversion of CANCELLED_NUMERIC in write_object(), which was omitting the high-order byte, producing a 254 in the compiled terminfo. + modify return-values of tgetflag, tgetnum, tgetstr, tigetflag, tigetnum and tigetstr to be compatible with Solaris (gleaned from Debian distribution of 1.9.9g-8.8). + modify _nc_syserr_abort to abort only when compiled for debugging, otherwise simply exit with an error. 980711 + modify Ada95 'gen' program to use appropriate library suffix (e.g., "_g" for a debug build). + update Ada95 'make clean' rule to include generics .ali files + add a configure test to ensure that if GNAT is found, that it can compile/link working Ada95 program. + flush output in beep and flash functions, fixing a problem with getstr (patch by Alexander V Lukyanov) + fix egcs 1.0.2 warning for etip.h (patch by Chris Johns). + correct ifdef/brace nesting in lib_sprintf.c (patch by Bernhard Rosenkraenzer ). + correct typo in wattr_get macro from 980509 fixes (patch by Dan Nelson). 980704 + merge changes from current XFree86 xterm terminfo descriptions. + add configure option '--without-ada'. + add a smart-default for termcap 'ac' to terminfo 'acs_chars' which corresponds to vt100. + change translation for termcap 'rs' to terminfo 'rs2', which is the documented equivalent, rather than 'rs1'. 980627 + slow 'worm' down a little, for very fast machines. + corrected firstchar/lastchar computation in lib_hline.c + simplify some expressions with CHANGED_CELL, CHANGED_RANGE and CHANGED_TO_EOL macros. + modify init_pair so that if a color-pair is reinitialized, we will repaint the areas of the screen whose color changes, like SVr4 curses (reported by Christian Maurer ). + modify getsyx/setsyx macros to comply with SVr4 man-page which says that leaveok() affects their behavior (report by Darryl Miles, patch by Alexander V Lukyanov). 980620 + review terminfo.5 against Solaris 2.6 curses version, corrected several minor errors/omissions. + implement tparm %l format. + implement tparm printf-style width and precision for %s, %d, %x, %o as per XSI. + implement tparm dynamic variables (reported by Xiaodan Tang). 980613 + update man-page for for wattr_set, wattr_get (cf: 980509) + correct limits in hashtest, which would cause nonprinting characters to be written to large screens. + correct configure script, when --without-cxx was specified: the wrong variable was used for cf_cv_type_of_bool. Compilers up to gcc 2.8 tolerated the missing 'int'. + remove the hardcoded name "gcc" for the GNU Ada compiler. The compiler's name might be something like "egcs" (patch by Juergen Pfeifer). + correct curs_addch.3x, which implied that echochar could directly display control characters (patch by Alexander V Lukyanov). + fix typos in ncurses-intro.html (patch by Sidik Isani ) 980606 + add configure test for conflicting use of exception in math.h and other headers. + minor optimization to 'hash()' function in hashmap.c, reduces its time by 10%. + correct form of LD_SHARED_OPTS for HP-UX 10.x (patch by Tim Mooney). + fix missing quotes for 'print' in MKunctrl.awk script (reported by Mihai Budiu ). > patch by Alexander V Lukyanov: + correct problem on Solaris (with poll() function) where getch could hang indefinitely even if timeout(x) was called. This turned out to be because milliseconds was not updated before 'goto retry' in _nc_timed_wait. + simplified the function _nc_timed_wait and fixed another bug, which was the assumption of !GOOD_SELECT && HAVE_GETTIMEOFDAY in *timeleft assignment. + removed the cycle on EINTR, as it seems to be useless. 980530 + add makefile-rule for test/keynames + modify run_tic.sh and shlib to ensure that user's .profile does not override the $PATH used to run tic (patch by Tim Mooney). + restore LD_SHARED_OPTS to $(LD_SHARED_FLAGS) when linking programs, needed for HP-UX shared-library path (recommended by Tim Mooney). + remove special case of HP-UX -L options, use +b options to embed $(libdir) in the shared libraries (recommended by Tim Mooney). + add checks for some possible buffer overflows and unchecked malloc/realloc/calloc/strdup return values (patch by Todd C Miller ) 980523 + correct maxx/maxy expression for num_columns/num_lines in derwin (patch by Alexander V Lukyanov). + add /usr/share/lib/terminfo and /usr/lib/terminfo as compatibilty fallbacks to _nc_read_entry(), along with --with-terminfo-dirs configure option (suggested by Mike Hopkirk). + modify config.guess to recognize Unixware 2.1 and 7 (patch by Mike Hopkirk ). + suppress definition of CC_SHARED_OPTS in LDFLAGS_SHARED in c++ Makefile.in, since this conflicts when g++ is used with HP-UX compiler (reported by Tim Mooney). + parenthesize 'strcpy' calls in c++ binding to workaround redefinition in some C++ implementations (reported by several people running egcs with glibc 2.0.93, analysis by Andreas Jaeger. 980516 + modify write_entry.c so that it will not attempt to link aliases with embedded '/', but give only a warning. + put -L$(libdir) first when linking programs, except for HP-UX. + modify comp_scan.c to handle SVr4 terminfo description for att477, which contains a colon in the description field. + modify configure script to support SCO osr5.0.5 shared libraries, from comp.unix.sco.programmer newsgroup item (Mike Hopkirk). + eliminate extra GoTo call in lib_doupdate.c (patch by Alexander V. Lukyanov). + minor adjustments of const/NCURSES_CONST from IRIX compile. + add updates based on esr's 980509 version of terminfo.src. 980509 + correct macros for wattr_set, wattr_get, separate wattrset macro from these to preserve behavior that allows attributes to be combined with color pair numbers. + add configure option --enable-no-padding, to allow environment variable $NCURSES_NO_PADDING to eliminate non-mandatory padding, thereby making terminal emulators (e.g., for vt100) a little more efficient (request by Daniel Eisenbud ). + modify configure script to embed ABI in shared libraries for HP-UX 10.x (detailed request by Tim Mooney). + add test/example of the 'filter()' function. + add nxterm and xterm-color terminfo description (request by Cristian Gafton ). + modify rxvt terminfo description to clear alternate screen before switching back to normal screen, for compatibility with applications which use xterm (reported by Manoj Kasichainula ). + modify linux terminfo description to reset color palette (reported by Telford Tendys ). + correction to doupdate, for case where terminal does not support insert/delete character. The logic did not check that there was a difference in alignment of changes to old/new screens before repainting the whole non-blank portion of the line. Modified to fall through into logic that reduces by the portion which does not differ (reported by Daniel Eisenbud ). + minor performance improvement to wnoutrefresh by moving some comparisons out of inner loop. 980425 + modify configure script to substitute NCURSES_CONST in curses.h + updated terminfo entries for xterm-xf86-v40, xterm-16color, xterm-8bit to correspond to XFree86 3.9Ag. + remove restriction that forces ncurses to use setaf/setab if the number of colors is greater than 8. (see 970524 for xterm-16color). + change order of -L options (so that $(libdir) is searched first) when linking tic and other programs, to workaround HP's linker. Otherwise, the -L../lib is embedded when linking against shared libraries and the installed program does not run (reported by Ralf Hildebrandt). + modify configuration of shared libraries on Digital Unix so that versioning is embedded in the library, rather than implied by links (patch by Tim Mooney). 980418 + modify etip.h to avoid conflict with math.h on HP-UX 9.03 with gcc 2.8.1 which redefines 'exception' (reported by Ralf Hildebrandt ). + correct configure tests in CF_SHARED_OPTS which used $CC value to check for gcc, rather than autoconf's $GCC value. This did not work properly if the full pathname of the compiler were given (reported by Michael Yount ). + revise check for compiler options to force ANSI mode since repeating an option such as -Aa causes HP's compiler to fail on its own headers (reported by Clint Olsen ). 980411 + ifdef'd has_key() and mcprint() as extended functions. + modified several prototypes to correspond with 1997 version of X/Open Curses (affects ABI since developers have used attr_get). + remove spurious trailing blanks in glibc addon-scripts (patch by H.J.Lu). + insert a few braces at locations where gcc-2.8.x asks to use them to avoid ambigous else's, use -fpic rather than -fPIC for Linux (patch by Juergen Pfeifer). 980404 + split SHLIB_LIST into SHLIB_DIRS/SHLIB_LIST to keep -L options before -l to accommodate Solaris' linker (reported by Larry Virden). 980328 + modify lib_color.c to eliminate dependency on orig_colors and orig_pair, since SVr4 curses does not require these either, but uses them when they are available. + add detailed usage-message to infocmp. + correct a typo in att6386 entry (a "%?" which was "?"). + add -f option to infocmp and tic, which formats the terminfo if/then/else/endif so that they are readable (with newlines and tabs). + fixes for glibc addon scripts (patch by H.J.Lu). 980321 + revise configure macro CF_SPEED_TYPE so that termcap.h has speed_t declared (from Adam J Richter ) + remove spurious curs_set() call from leaveok() (J T Conklin). + corrected handling leaveok() in doupdate() (patch by Alexander V. Lukyanov). + improved version of wredrawln (patch by Alexander V. Lukyanov). + correct c++/Makefile.in so install target do not have embedded ../lib to confuse it (patch by Thomas Graf ). + add warning to preinstall rule which checks if the installer would overwrite a curses.h or termcap.h that is not derived from ncurses. (The recommended configuration for developers who need both is to use --disable-overwrite). + modify preinstall rule in top-level Makefile to avoid implicit use of 'sh', to accommodate Ultrix 4.4 (reported by Joao Palhoto Matos , patch by Thomas Esser ) + refine ifdef's for TRACE so that libncurses has fewer dependencies on libtinfo when TRACE is disabled. + modify configure script so that if the --with-termlib option is used to generate a separate terminfo library, we chain it to the ncurses library with a "-l" option (reported by Darryl Miles and Ian T. Zimmerman). 980314 + correct limits and window in wredrawln function (reported/analysis by Alexander V. Lukyanov). + correct sed expression in configure script for --with-fallback option (patch by Jesse Thilo). + correct some places in configure script where $enableval was used rather than $withval (patch by Darryl Miles ). + modify some man-pages so no '.' or '..' falls between TH and SH macros, to accommodate man_db program (reported by Ian T. Zimmerman ). + terminfo.src 10.2.1 downloaded from ESR's webpage (ESR). > several changes by Juergen Pfeifer: + add copyright notices (and rcs id's) on remaining man-pages. + corrected prototypes for slk_* functions, using chtype rather than attr_t. + implemented the wcolor_set() and slk_color() functions + the slk_attr_{set,off,on} functions need an additional void* parameter according to XSI. + fix the C++ and Ada95 binding as well as the man pages to reflect above enhancements. 980307 + use 'stat()' rather than 'access()' in toe.c to check for the existence of $HOME/.terminfo, since it may be a file. + suppress configure CF_CXX_LIBRARY check if we are not using g++ 2.7.x, since this is not needed with g++ 2.8 or egcs (patch by Juergen Pfeifer). + turn on hashmap scrolling code by default, intend to remedy defects by 4.3 release. + minor corrections to terminfo.src changelog. 980302 4.2 release for upload to prep.ai.mit.edu + correct Florian's email address in ncurses-intro.html + terminfo.src 10.2.0 (ESR). 980228 pre-release + add linux-koi8r replace linux-koi8, which is not KOI8 (patch by QingLong ). + minor documentation fixes (patch by Juergen Pfeifer). + add setlocale() call to ncurses.c (reported by Claes G. Lindblad ). + correct sign-extension in lib_insstr.c (reported by Sotiris Vassilopoulos ) 980221 pre-release + regenerated some documentation overlooked in 980214 patch (ncurses-intro.doc, curs_outopts.3x.html) + minor ifdef change to C++ binding to work with gcc 2.8.0 (patch by Juergen Pfeifer). + change maintainer's mailing address to florian@gnu.org, change tentative mailing list address to bug-ncurses-request@gnu.org (patch by Florian La Roche). + add definition of $(REL_VERSION) to c++/Makefile.in (reported by Gran Hasse ). + restore version numbers to Ada95 binding, accidentally deleted by copyright patch (patch by Juergen Pfeifer). 980214 pre-release + remove ncurses.lsm from MANIFEST so that it won't be used in FSF distributions, though it is retained in development. + correct scaling of milliseconds to nanoseconds in lib_napms.c (patch by Jeremy Buhler). + update mailing-list information (bug-ncurses@gnu.org). + update announcement for upcoming 4.2 release. + modify -lm test to check for 'sin()' rather than 'floor()' + remove spurious commas from terminfo.src descriptions. + change copyright notices to Free Software Foundation 980207 + minor fixes for autoconf macros CF_ERRNO, CF_HELP_MESSAGE and CF_SIZECHANGE + modify Makefile.glibc so that $(objpfx) is defined (H.J.Lu). + ifdef-out true-return from _nc_mouse_inline() which depends on merge of QNX patch (pending 4.2 release). > patch to split off seldom-used modules in ncurses (J T Conklin): This reduces size by up to 2.6kb. + move functionality of _nc_usleep into napms, add configuration case for nanosleep(). + moved wchgat() from lib_addch.c to lib_chgat.c + moved clearok(), immedok(), leaveok(), and scrollok() from lib_options.c to lib_clearok.c, lib_immedok.c, lib_leaveok.c and lib_scrollok.c. + moved napms() from lib_kernel.c to lib_napms.c + moved echo() and noecho() from lib_raw.c to lib_echo.c + moved nl() and nonl() from lib_raw.c to lib_nl.c 980131 + corrected conversion in tclock.c (cf: 971018). + updates to Makefile.glibc and associated Linux configure script (patch by H.J.Lu). + workaround a quoting problem on SunOS with tar-copy.sh + correct init_pair() calls in worm.c to work when use_default_colors() is not available. + include in CF_SYS_TIME_SELECT to work with FreeBSD 2.1.5 + add ncv capability to FreeBSD console (cons25w), making reverse work with color. + correct sense of configure-test for sys/time.h inclusion with sys/select.h + fixes for Ada95/ada_include/Makefile.in to work with --srcdir option. + remove unused/obsolete test-program rules from progs/Makefile.in (the rules in ncurses/Makefile.in work). + remove shared-library loader flags from test/Makefile.in, etc. + simplify test/configure.in using new version of autoconf to create test/ncurses_cfg.h + suppress suffix rules in test/Makefile.in, provide explicit dependency to work with --srcdir option and less capable 'make' programs. > adapted from patch for QNX by Xiaodan Tang: + initialize %P and %g variables set/used in tparm, and also ensure that empty strings don't return a null result from tparam_internal + add QNX-specific prototype for vsscanf() + move initialization of SP->_keytry from init_keytry() to newterm() to avoid resetting it via a keyok() call by mouse_activate(). + reorganized some functions in lib_mouse() to use case-statements. + remove sgr string from qnx terminfo entry since it is reported to turn off attributes inconsistently. 980124 + add f/F/b/B commands to ncurses 'b' test to toggle colors, providing test for no_color_video. + adjusted emx.src to use no_color_video, now works with ncurses 'b' and 'k' tests. + implement no_color_video attribute, and as a special case, reverse colors when the reverse attribute cannot be combined with color. + check for empty string in $TERM variable (reported by Brett Michaels ). > from reports by Fred Fish: + add configure-test for isascii + add configure-test for -lm library. + modify CF_BOOL_SIZE to check if C++ bool types are unsigned. > patches by J.J.G.Ripoll + add configure/makefile variables to support .exe extension on OS/2 EMX (requires additional autoconf patches). + explicitly initialize variables in lib_data.c to appease OS/2 linker > patches by Fred Fish + misc/Makefile.in (install.data): Avoid trying to install the CVS directory. + aclocal.m4 (install.includes): Remove files in the include directory where we are going to install new ones, not the original source files. + misc/terminfo.src: Add entry for "beterm", derived from termcap distributed with BeOS PR2 using captoinfo. + aclocal.m4: Wrap $cf_cv_type_of_bool with quotes (contains space) + aclocal.m4: Assume bool types are unsigned. + progs/infocmp.c: workaround mwcc 32k function data limit 980117 + correct initialization of color-pair (cf: 970524) in xmas.c, which was using only one color-pair for all colors (reported by J.J.G.Ripoll). + add multithread options for objects build on EMX, for compatibility with XFree86. + split up an expression in MKlib_gen.sh to work around a problem on OS/2 EMX, with 'ash' (patch by J.J.G.Ripoll). + change terminfo entries xterm (xterm-xf86-v40), xterm-8bit rs1 to use hard reset. + rename terminfo entry xterm-xf86-v39t to xterm-xf86-v40 + remove bold/underline from sun console entries since they're not implemented. + correct _tracef calls in _tracedump(), which did not separate format from parameters. + correct getopt string for tic "-o" option, and add it to man-page synopsis (reported by Darren Hiebert ). + correct typo in panel/Makefile.in, reversed if-statement in scrolling optimization (Alexander V. Lukyanov). + test for 'remove()', use 'unlink() if not found (patch by Philippe De Muyter ). > patches by Juergen Pfeifer: + Improve a feature of the forms driver. For invisible fields (O_VISIBLE off) only the contents but not the attributes are cleared. We now clear both. (Reported by Javier Kohan ) + The man page form_field_opts.3x makes now clear, that invisible fields are also always inactive. + adjust ifdef's to compile the C++ binding with the just released gcc-2.8.0 c++ and the corresponding new C++ libraries. 980110 + correct "?" command in ncurses.c; it was performing non-screen writes while the program was in screen mode. (It "worked" in 1.9.9e because that version sets OPOST and OCRNL incorrectly). + return error from functions in lib_kernel, lib_raw and lib_ti if cur_term is null, or if underlying I/O fails. + amend change to tputs() so that it does not return an error if cur_term is null, since some applications depend on being able to use tputs without initializing the terminal (reported by Christian J. Robinson ). 980103 + add a copy of emx.src from J.J.G.Ripoll's OS/2 EMX version of ncurses 1.9.9e, together with fixes/additions for the "ansi" terminal type. + add tic check for save/restore cursor if change_scroll_region is defined (reference: O'Reilly book). + modify read_termcap.c to handle EMX-style pathnames (reported by J.J.G.Ripoll). + modify lib_raw.c to use EMX's setmode (patch from J.J.G.Ripoll). Ripoll says EMX's curses does this. + modify _nc_tic_expand() to generate \0 rather than \200. + move/revise 'expand()' from dump_entry.c to ncurses library as _nc_tic_expand(), for use by tack. + decode \a as \007 for terminfo, as per XSI. + correct translation of terminfo "^@", to \200, like \0. + modify next_char() to treat the same as , for cross-platform compatibility. + use new version of autoconf (971230) to work around limited environment on CLIX, due to the way autoconf builds --help message. > patch by Juergen Pfeifer: + check that the Ada95 binding runs against the correct version of ncurses. + insert constants about the library version into the main spec-file of the Ada95 binding. 971227 + modify open/fopen calls to use binary mode, needed for EMX. + modify configure script to work with autoconf 2.10 mods for OS/2 EMX (from J.J.G.Ripoll). + generated ncurses_cfg.h with patch (971222) to autoconf 2.12 which bypasses limited sed buffer length. > several changes from Juan Jose Garcia Ripoll (J.J.G.Ripoll) to support OS/2 EMX: + add a _scrolling flag to SP, to set when we encounter a terminal that simply cannot scroll. + corrected logic in _nc_add_to_try(), by ensuring that strings with embedded \200 characters are matched. + don't assume the host has 'link()' function, for linking terminfo entries. 971220 + if there's no ioctl's to support sigwinch handler, disable it. + add configure option --disable-ext-funcs to remove the extended functions from the build. + add configure option --with-termlib to generate the terminfo functions as a separate library. + add 'sources' rule to facilitate cross-compiling. + review/fix order of mostlyclean/clean/distclean rules. + modify install-rule for headers to first remove old header, in case there was a symbolic link that confuses the install script. + corrected substitution for NCURSES_CONST in term.h (cf: 971108) + add null pointer checks in wnoutrefresh(), overlap() (patch by Xiaodan Tang ) + correct tputs(), which could dereference a null cur_term if invoked before terminal is initialized (patch by Christopher Seawood ) > patch by Juergen Pfeifer: + makes better use of "pragma Inline" in the Ada95 binding + resynchronizes the generated html manpages 971213 + additional fixes for man-pages section-references + add (for debugging) a check for ich/ich1 conflict with smir/rmir to tic, etc. + remove hpa/vpa from rxvt terminal description because they are not implemented correctly, added sgr0. + change ncurses 's' to use raw mode, so ^Q works (reported by Rudolf Leitgeb ) 971206 + modify protection when installing libraries to (normally) not executable. HP-UX shared libraries are an exception. + add configure check for 'tack'. + implement script for renaming section-references in man-page install, for Debian configuration. + add validity-check for SP in trace code in baudrate() (reported by Daniel Weaver). > patch by Alexander V. Lukyanov (fixes to match sol25 curses) + modify 'overlay()' so that copy applies target window background to characters. + correct 'mvwin()' so that it does not clear the previous locations. + correct lib_acs.c so that 8-bit character is not sign expanded in case of wide characters in chtype. + correct control-char test in lib_addch.c for use with wide chars + use attribute in the chtype when adding a control character in lib_addch.c control char was added with current attribute 971129 + save/restore errno in _tracef() function + change treatment of initialize_color to use a range of 0..1000 (recommended by Daniel Weaver). + set umask in mkinstalldirs, fixing problems reported by users who have set root's umask to 077. + correct bug in tic that caused capabilities to be reprinted at the end of output when they had embedded comments. + rewrote wredrawln to correspond to XSI, and split-out since it is not often used (from report by Alexander V. Lukyanov, 970825) + rewrote Dan Nelson's change to make it portable, as well as to correct logic for handling backslashes. + add code to _nc_tgetent() to make it work more like a real tgetent(). It removes all empty fields, and removes all but the first in a group of duplicate caps. The code was pulled from the BSD libtermcap code in termcap.c (patch by Dan Nelson + don't include --enable-widec in the --with-develop configure option, since it is not binary-compatible with 4.1 (noted by Alexander V. Lukyanov) > patch by Juergen Pfeifer: + further improvements of the usage of elaboration pragmas in the Ada95 binding + enhanced Ada95 sample to use the user_data mechanism for panels. + a fix for the configuration script to make gnat-3.10 the required version. + resync of the html version of the manpages 971122 > fixes/updates for terminfo.src: + add vt220-js, pilot, rbcomm, datapoint entries from esr's 27-jun-97 version. + add hds200 description (Walter Skorski) + add EMX 0.9b descriptions + correct rmso/smso capabilities in wy30-mc and wy50-mc (Daniel Weaver) + rename xhpterm back to hpterm. > patch by Juergen Pfeifer: + Improves the usage of elaboration pragmas for the Ada95 binding. + Adds a translation of the test/rain.c into Ada95 to the samples. This has been contributed to the project by Laurent Pautet (pautet@gnat.com) 971115 + increase MAX_NAME_SIZE to 512 to handle extremely long alias list in HP-UX terminfo. + correction & simplification of delay computation in tputs, based on comments from Daniel Weaver. + replace test for SCO with more precise header tests. + add configure test for unsigned literals, use in NCURSES_BITS macro. + comment-out the -PIC, etc., flags from c++, progs and test makefiles since they probably are not needed, and are less efficient (noted by Juergen Fluk) + add -L$(libdir) to loader options, after -L../lib so that loaders that record this information will tend to do the right thing if the programs are moved around after installing them (suggested by Juergen Fluk). + add -R option to loader options for programs for Solaris if the --enable-rpath option is specified for the libraries. 971112 + correct installed filename for shared libraries on *BSD (reported by Juergen Fluk). 971108 + cleanup logic for deciding when tputs() should call delay_output(), based on comments from Daniel Weaver. + modified tputs() to avoid use of float. + correct use of trailpad in tputs(), which used the wrong variable in call to delay_output(). + correct inverted expression for null-count in delay_output() (analysis by Daniel Weaver). + apply --enable-rpath option to Solaris (requested by Larry Virden). + correct substitution of EXTRA_CFLAGS for gcc 2.6.3 + correct check for error-return by _nc_tgetent(), which returns 0 for success. + add configure test for BSD 4.4 cgetent() function, modify read_termcap.c to use the host's version of that if found, using the terminal database on FreeBSD (reported by Peter Wemm). + add u8, u9 strings to sun-il description for Daniel Weaver. + use NCURSES_CONST in panel's user-pointer. + modify edit_cfg.sh and MKterm.h.awk.in to substitute NCURSES_CONST so that will work on NeXT. + use _nc_set_screen() rather than assignments to SP to fix port to NeXT (reported by Francisco A. Tomei Torres). 971101 + force mandatory padding in bell and flash_screen, as specified in XSI. + don't allow padding_baud_rate to override mandatory delays (reported by Daniel Weaver). + modify delay_output() to use _nc_timed_wait() if no baudrate has been defined, or if the cur_term pointer is not initialized. XSI treats this as unspecified. (requested by Daniel Weaver). + change getcap-cache ifdef's to eliminate unnecessary chdir/mkdir when that feature is not configured. + remove _nc_err_abort() calls when write_entry.c finds a directory but cannot write to it, e.g., when translating part/all of /etc/termcap (reported by Andreas Jaeger ). (this dates back to 951102 in 1.9.7a). + minor ifdef fixes to compile with atac and glibc 2.0.5c + add check for -lgen when configuring regexpr.h + modify Solaris shared-library option "-d y" to "-dy" to workaround incompatibility of gcc 2.7.2 vs vendor's tools. 971026 + correct ifdef's for struct winsize vs struct ttysize in lib_setup.c to compile on SCO. + remove dangling backslash in panel/Makefile.in + modify MKkeyname.awk to work with SCO's nawk, which dumps core in the length() function. + correct length of allocation in _nc_add_to_try(), to allow for trailing null. + correct logic in _nc_remove_key(), which was discarding too many nodes (patch by Alexander V. Lukyanov) 971025 + add definition for $(REL_VERSION) to test/Makefile.in, so *BSD shared libraries link properly (see 970524). + modify Linux shared-library generation to include library dependencies (e.g., -lncurses and -lgpm) in the forms, menu and panel libraries (suggested by Juergen Pfeifer). + modify configure script to use config.guess and config.sub rather than uname, which is unreliable on some systems. + updated Makefile.glibc, test-built with glibc 2.0.5c + modify keyname() to return values consistent with SVr4 curses (patch by Juergen Fluk). > changes requested by Daniel Weaver: + modify delay_output() so that it uses the same output function as tputs() if called from that function. + move _baudrate from SCREEN to TERMINAL so that low-level use of tputs works when SP is not set. > patch by Juergen Pfeifer: + factor lib_menu and lib_form into smaller modules + clean up the interface between panel and SCREEN + minor changes to the Ada95 mouse support implemenation + minor bugfix in C++ binding to ripoff windows + fix a few Ada95 html documentation pages 971018 + split-out lib_ungetch.c, make runtime link to resizeterm() to decouple those modules from lib_restart.c + add xterm-xf86-v39t description to terminfo.src + reset SP->_endwin in lib_tstp.c cleanup() function after calling endwin() to avoid unnecessary repainting if the application has established an atexit function, etc. Encountered this problem in the c++ demo, whose destructors repaint the screen. + combine _nc_get_screensize() and resizeterm() calls as new function _nc_update_screensize(). + minor fixes to allow compile with g++ (suggested by Nelson H. F. Beebe). + implement install-rules for Ada95 makefiles. + use screen_lines or MAXLINES as needed where LINES was coded, as well as screen_columns for COLS, in the ncurses library. > patch by Alexander V. Lukyanov: + modify logic for ripped-off lines to handle several SCREENs. > patch by Juergen Pfeifer: + factors lib_slk.c into some smaller modules + factors panel.c into some smaller modules + puts the static information about the current panel stack into the SCREEN structure to allow different panel stacks on different screens. + preliminary fix for an error adjusting LINES to account for ripped-off lines. 971011 + move _nc_max_click_interval and other mouse interface items to SCREEN struct so that they are associated with a single terminal, and also save memory when the application does not need a mouse (roughly 3k vs 0.5k on Linux). + modify mouseinterval() so that a negative parameter queries the click-interval without modifying it. + modify ncurses 'i' test to work with ncurses' apparent extension from SVr4, i.e., allows nocbreak+noecho (analysis by Alexander V. Lukyanov). + add configure options --with-ada-includes and --with-ada-objects, to drive Ada95 binding install (not yet implemented). + install C++ binding as -lncurses++ and associated headers with the other ncurses headers. + fix header uninstall if configure --srcdir is used. > minor interface changes to support 'tack' program -TD (request by Daniel Weaver ). + export functions _nc_trans_string() and _nc_msec_cost(). + add variable _nc_nulls_sent, to record the number of padding characters output in delay_output(). + move tests for generic_type and hard_copy terminals in setupterm() to the end of that function so that the library will still be initialized, though not generally useful for curses programs. > patches by Alexander V. Lukyanov: + modify ClrBottom() to avoid using clr_eos if there is only one line to erase. + typo in configure --help. > patch by J T Conklin (with minor resync against Juergen's changes) + split-out lib_flash.c from lib_beep.c + split-out lib_hline.c and lib_vline.c from lib_box.c + split-out lib_wattron.c, lib_wattroff.c from lib_addch.c 971005 > patch by Juergen Pfeifer: + correct source/target of c++/edit_cfg.sh 971004 + add color, mouse support to kterm terminfo entry. + modify lib_mouse.c to recognize rxvt, kterm, color_xterm also as providing "xterm"-style mouse. + updated rxvt's terminfo description to correspond to 2.21b, with fixes for the acsc (the box1 capability is incorrect, ech1 does not work). + fix logic in parse_entry.c that discarded acsc when 'synthesizing' an entry from equivalents in XENIX or AIX. This lets ncurses handle the distribution copy of rxvt's terminfo. + modify acsc capability for linux and linux-koi8 terminfo descriptions (from Pavel Roskin ). + corrected definition in curses.h for ACS_LANTERN, which was 'I' rather than 'i' (see 970802). + updated terminfo.src with reformatted acsc entries, and repaired the trashed entries with spurious '\' characters that this exposed. + add logic to dump_entry.c to reformat acsc entries into canonical form (sorted, unique mapping). + add configure script to generate c++/etip.h + add configure --with-develop option, to enable by default most of the experimental options (requested by Alexander V. Lukyanov). + rename 'deinstall' to 'uninstall', following GNU convention (suggested by Alexander V. Lukyanov). > patches by Alexander V. Lukyanov: + modify tactics 2 and 5 in onscreen_mvcur(), to allow them on the last line of the screen, since carriage return will not cause a newline. + remove clause from PutCharLR() that would try to use eat_newline_glitch since that apparently does not work on some terminals (e.g., M$ telnet). + correct a limit check in scroll_csr_backward() > patches by Juergen Pfeifer: + adds dummy implementations of methods above() and below() to the NCursesPanel class. + fixes missing returncode in NCursesWindow::ripoffline() + fixes missing returncode in TestApplication::run() in demo.cc + We should at least give a comment in etip.h why it is currently a problem to install the C++ binding somewhere + makes the WINDOW* argument of wenclose() a const. + modifies several of the routines in lib_adabind.c to use a const WINDOW* argument. 970927 + add 'deinstall' rules. + use explicit assignments in configure --without-progs option to work around autoconf bug which doesn't always set $withval. + check for ldconfig, don't try to run it if not found. + implement simple/unoptimized case in lib_doupdate.c to handle display with magic cookie glitch, tested with ncurses.c program. + correct missing _tracef in getmouse(), to balance the returnCode macro. + simplify show_attr() in ncurses.c using termattrs(). > patches by Juergen Pfeifer: + provides missing inlines for mvw[hv]line in cursesw.h of the C++ binding + fixes a typo in a comment of frm_driver.c + Enhances Ada95 Makefiles to fulfill the requirement of GNAT-3.10 that generics should be compiled. Proper fixes to the configuration scripts are also provided. 970920 + several modifications to the configure script (requested by Ward Horner): + add configure options --without-progs, to suppress the build of the utility programs, e.g., for cross-compiling. + add $(HOSTCCFLAGS) and $(HOSTLDFLAGS) symbols to ncurses Makefile.in, to simplify setup for cross compiling. + add logic in configure script to recognize "--target=vxworks", and generate load/install actions for VxWorks objects. + move typedef for sigaction_t into SigAction.h to work around problem generating lint library. + modify fty_regex.c to reflect renaming of ifdef's for regular expressions. + simplify ifdef in lib_setup.c for TIOCGWINSZ since that symbol may reside in . + merge testcurs.c with version from PDCurses 2.3, clarifying some of the more obscure tests, which rely upon color. + use macros getbegyx() and getmaxyx() in newdemo.c and testcurs.c + modify ncurses.c to use getbegyx() and getmaxyx() macros to cover up implementation difference wrt SVr4 curses, allow 's' test to work. + add missing endwin() to testscanw.c program (reported by Fausto Saporito ). + fixes/updates for Makefile.glibc and related files under sysdeps (patch by H.J.Lu). > patches by Juergen Pfeifer: + add checks for null pointers, especially WINDOW's throughout the ncurses library. + solve a problem with wrong calculation of panel overlapping (reported by Ward Horner): + make sure that a panel's window isn't a pad. + do more error checking in module lib_touch.c + missing files for Ada95 binding from the last patch + synch. of generated html pages (RCS-Id's were wrong in html files) + support for Key_Resize in Ada binding + changed documentation style in ./c++/cursesm.h > patches by Alexander V. Lukyanov: + undo attempt to do recursive inlining for PutChar(), noting that it did not improve timing measurably, but inflated the size of lib_doupdate.o 970913 + modify rain.c to use color. + correct scroll_csr_backward() to match scroll_csr_forward(). + minor adjustment to llib-lncurses, to work with Solaris 2.5.1 + minor fixes to sysdeps/unix/sysv/linux/configure to reflect renaming of configure cache variables in 970906. + correct logic involving changes to O_VISIBLE option in Synchronize_Options function in frm_driver.c (Tony Hoffmann ) + add $(HOSTCC) symbol to ncurses Makefile.in, to simplify setup for cross compiling (suggested by Chris Johns). + modify ifdef in lib_setup.c to only include if we can use it to support screen-size calculation (reported by Chris Johns). + #undef unctrl to avoid symbol conflict in port to RTEMS (reported by Chris Johns ) > patches by Juergen Pfeifer: + simplified, made minor corrections to Ada95 binding to form fieldtype. + The C++ binding has been enhanced: + Improve NCursesWindow class: added additional methods to cover more ncurses functionality. Make refresh() and noutrefresh() virtual members to allow different implementation in the NCursesPanel class. + CAUTION: changed order of parameters in vline() and hline() of NCursesWindow class. + Make refresh() in NCursesPanel non-static, it is now a reimplementation of refresh() in the base class. Added noutrefresh() to NCursesPanel. + Added NCursesForm and related classes to support libform functionality. + Moved most of configuration related stuff from cursesw.h to etip.h + Added NCursesApplication class to support easy configuration of menu and forms related attributes as well as ripped of title lines and Soft-Label-Keys for an application. + Support of Auto-Cleanup for a menu's fieldlist. + Change of return type for current_item() and operator[] for menus. + Enhanced demo. + Fixed a bug in form/fld_def.c: take into account that copyarg and freearg for a fieldtype may be NULL, makearg must not be NULL + Fixed a bug in form/fld_type.c: in set_fieldtype_arg() makearg must not be NULL, copyarg and freearg may be NULL. + Fixed a bug in form/frm_def.c: Allow Disconnect_Fields() if it is already disconnected. + Enhance form/frm_driver.c: Allow growth of dynamic fields also on navigation requests. + Fixed a bug in form/fty_enum.c: wrong position of postincrement in case-insensitiva comparision routine. + Enhanced form/lib_adabind.c with function _nc_get_field() to get a forms field by index. + Enhanced menu/m_adabind.c with function _nc_get_item() to get a menus item by index. + Fixed in curses.h.in: make chtype argument for pechochar() constant. Mark wbkgdset() as implemented, remove wbkgdset macro, because it was broken (didn't handle colors correctly). + Enhanced lib_mouse.c: added _nc_has_mouse() function + Added _nc_has_mouse() prototype to curses.priv.h + Modified lib_bkgd.c: hopefully correct implementation of wbkgdset(); streamlined implementation of wbkgd() + Modified lib_mvwin.c: Disable move of a pad. Implement (costly) move of subwindows. Fixed update behavior of movements of regular windows. + Fixed lib_pad.c: make chtype argument of pechochar() const. + Fixed lib_window.c: dupwin() is not(!) in every bit a really clone of the original. Subwindows become regular windows by doing a dupwin(). + Improved manpage form_fieldtype.3x > patches by Alexander V. Lukyanov: + simplify the PutChar() handling of exit_am_mode, because we already know that auto_right_margin is true. + add a check in PutChar() for ability to insert to the case of shifting character to LR corner. + in terminal initialization by _nc_screen_resume(), make sure that terminal right margin mode is known. + move logic that invokes touchline(), or does the equivalent, into _nc_scroll_window(). + modify scrolling logic use of insert/delete line capability, assuming that they affect the screen contents only within the current scrolling region. + modify rain.c to demonstrate SIGWINCH handler. + remove logic from getch() that would return an ERR if the application called getch() when the cursor was at the lower-right corner of the physical screen, and the terminal does not have insert-character ability. + change view.c so that it breaks out of getch() loop if a KEY_RESIZE is read, and modify logic in getch() so this fix will yield the desired behavior, i.e., the screen is repainted automatically when the terminal window is resized. 970906 + add configure option --enable-sigwinch + modify view.c to test KEY_RESIZE logic, with "-r" option. + modify testcurs.c to eliminate misleading display wrt cursor type by testing if the terminal supports cnorm, civis, cvvis. + several fixes for m68k/NeXT 4.0, to bring cur_term, _nc_curr_line and _nc_curr_col variables into linked programs: move these variables, making new modules lib_cur_term and trace_buf (reported by Francisco Alberto Tomei Torres ). > patches by Alexander V. Lukyanov: + add pseudo-functionkey KEY_RESIZE which is returned by getch() when the SIGWINCH handler has been called since the last call to doupdate(). + modify lib_twait.c to hide EINTR only if HIDE_EINTR is defined. + add SIGWINCH handler to ncurses library which is used if there is no application SIGWINCH handler in effect when the screen is initialized. + make linked list of all SCREEN structures. + move curses.h include before definition of SCREEN to use types in that structure. + correction to ensure that wgetstr uses only a newline to force a scroll (970831). 970831 + add experimental configure option --enable-safe-sprintf; the normal mode now allocates a buffer as large as the screen for the lib_printw.c functions. + modify wgetch to refresh screen when reading ungetch'd characters, since the application may require this - SVr4 does this. + refine treatment of newline in wgetstr to echo only when this would force the screen to scroll. 970830 + remove override in wgetstr() that forces keypad(), since SVr4 does not do this. + correct y-reference for erasure in wgetstr() when a wrap forces a scroll. + correct x-position in waddch() after a wrap forces a scroll. + echo newline in wgetstr(), making testscanw.c scroll properly when scanw is done. + modify vwscanw() to avoid potential buffer overflow. + rewrote lib_printw.c to eliminate fixed-buffer limits. > patches by Alexander V. Lukyanov: + correct an error in handling cooked mode in wgetch(); processing was in the wrong order. + simplified logic in wgetch() that handles backspace, etc., by using wechochar(). + correct wechochar() so that it interprets the output character as in waddch(). + modify pechochar() to use prefresh() rather than doupdate(), since the latter does not guarantee immediate refresh of the pad. + modify pechochar() so that if called with a non-pad WINDOW, will invoke wechochar() instead. + modify fifo indices to allow fifo to be longer than 127 bytes. 970823 + add xterm-8bit to terminfo.src + moved logic for SP->_fifohold inside check_pending() to make it work properly when we add calls to that function. + ensure that bool functions return only TRUE or FALSE, and TRUE/FALSE are assigned to bool values (patch by H.J.Lu). > patches by Alexander V. Lukyanov: + several fixes to getch: 1. Separate cooked and raw keys in fifo 2. Fix the case of ungetch'ed KEY_MOUSE 3. wrap the code for hiding EINTR with ifdef HIDE_EINTR 4. correctly handle input errors (i.e., EINTR) without loss of raw keys 5. recognize ESC KEY_LEFT and similar 6. correctly handle the case of receiption of KEY_MOUSE from gpm + correct off-by-one indexing error in _nc_mouse_parse(), that caused single mouse events (press/release) to be ignored in favor of composed events (click). Improves on a fix from integrating gpm support in 961229. + add another call to check_pending, before scrolling, for line-breakout optimization + improve hashmap.c by 1. fixed loop condition in grow_hunks() 2. not marking lines with offset 0 3. fixed condition of 'too far' criteria, thus one-line hunks are ignored and two lines interchanged won't pass. + rewrote/simplified _nc_scroll_optimize() by separating into two passes, forward/backward, looking for chunks moving only in the given direction. + move logic that emits sgr0 when initializing the screen to _nc_screen_init(), now invoked from newterm. + move cursor-movement cleanup from endwin() into _nc_mvcur_wrap() function and screen cleanup (i.e., color) into _nc_screen_wrap() function. + add new functions _nc_screen_init(), _nc_screen_resume() and _nc_screen_wrap(). + rename _nc_mvcur_scrolln() to _nc_scrolln(). + add a copy of acs_map[] to the SCREEN structure, where it can be stored/retrieved via set_term(). + move variables _nc_idcok, _nc_idlok, _nc_windows into the SCREEN structure. 970816 + implement experimental _nc_perform_scroll(). + modify newterm (actually _nc_setupscreen()) to emit an sgr0 when initializing the screen, as does SVr4 (reported by Alexander V. Lukyanov). + added test_progs rule to ncurses/Makefile. + modify test/configure.in to check if initscr is already in $LIBS before looking for (n)curses library. + correct version-number in configure script for OSF1 shared-library options (patch by Tim Mooney). + add -DNDEBUG to CPPFLAGS for --enable-assertions (as Juergen originally patched) since the c++ demo files do not necessarily include ncurses_cfg.h + supply default value for --enable-assertions option in configure script (reported by Kriang Lerdsuwanakij ). > patches by Alexander V. Lukyanov: + correct/simplify logic of werase(), wclrtoeol() and wclrbot(). See example firstlast.c + optimize waddch_literal() and waddch_nosync() by factoring out common subexpressions. + correct sense of NDEBUG ifdef for CHECK_POSITION macro. + corrections to render_char(), to make handling of colored blanks match SVr4 curses, as well as to correct a bug that xor'd space against the background character. + replaced hash function with a faster one (timed it) + rewrote the hashmap algorithm to be one-pass, this avoids multiple cost_effective() calls on the same lines. + modified cost_effective() so it is now slightly more precise. > patches for glibc integration (H.J.Lu): + add modules define_key, keyok, name_match, tries + add makefile rules for some of the unit tests in ncurses (mvcur, captoinfo, hardscroll, hashmap). + update Linux configure-script for wide-character definitions. 970809 + modify _tracebits() to show the character size (e.g., CS8). + modify tparm() to emit '\200' where the generated string would have a null (reported by From: Ian Dall for terminal type ncr7900). + modify install process so that ldconfig is not invoked if the package is built with an install-prefix. + correct test program for chtype size (reported by Tim Mooney). + add configure option --disable-scroll-hints, using this to ifdef the logic that computes indices for _nc_scroll_optimize(). + add module ncurses/softscroll.c, to perform single-stage computation of scroll indices used in _nc_scroll_optimize(). This is faster than the existing scrolling algorithm, but tends to make too-small hunks. + eliminate fixed buffer size in _nc_linedump(). + minor fixes to lib_doupdate.c to add tradeoff between clr_eol (el) and clr_bol (el1), refine logic in ClrUpdate() and ClrBottom() (patch by Alexander V. Lukyanov). + add test/testaddch.c, from a pending patch by Alexander V. Lukyanov. + correct processing of "configure --enable-assertions" option (patch by Juergen Pfeifer). 970802 + add '-s' (single-step) option too test/hashtest.c, correct an error in loop limit for '-f' (footer option), toggle scrollok() when writing footer to avoid wrap at lower-right corner. + correct behavior of clrtoeol() immediately after wrapping cursor, which was not clearing the line at the cursor position (reported by Liviu Daia ). + corrected mapping for ACS_LANTERN, which was 'I' rather than 'i' (reported by Klaus Weide ). + many corrections to make progs/capconvert work, as well as make it reasonably portable and integrated with ncurses 4.1 (reported by Dave Furstenau ). 970726 + add flag SP->_fifohold, corresponding logic to modify the behavior of the line breakout logic so that if the application does not read input, refreshes will not be stopped, but only slowed. + generate slk_attr_off(), slk_attr_on(), slk_attr_set(), vid_attr(), ifdef'd for wide-character support, since ncurses' WA_xxx attribute masks are identical with the A_xxx masks. + modify MKlib_gen.sh to generate ifdef'd functions to support optional configuration of wide-characters. + modify tset to behave more like SVr4's tset, which does not modify the settings of intr, quit or erase unless they are given as command options (reported by Nelson H. F. Beebe ). + modify tset to look in /etc/ttys or /etc/ttytype if the configuration does not have getttynam(). + extend baudrate table in tset.c to match baudrate() function. + add table entries for B230400 and B460800 to baudrate() function. + improve breakout logic by allowing it before the first line updated, which is what SVr4 curses does (patch by Alexander V. Lukyanov). + correct initialization of vcost in relative_move(), for cursor-down case (patch by Alexander V. Lukyanov). > nits gleaned from Debian distribution of 1.9.9g-3: + install symbolic link for intotocap. + reference libc directly when making shared libraries. + correct renaming of curs_scr_dmp.3x in man_db.renames. + guard tgetflag() and other termcap functions against null cur_term pointer. 970719 + corrected initial state of software echo (error in 970405, reported by Alexander V. Lukyanov). + reviewed/added messages to configure script, so that all non-test options should be accompanied by a message. + add configure check for long filenames, using this to determine if it is safe to allow long aliases for terminal descriptions as does SVr4. + add configure options for widec (wide character), hashmap (both experimental). > patch by Alexander V. Lukyanov: + hashmap.c - improved by heuristic, so that scroll test works much better when csr is not available. + hardscroll.c - patched so that it continues to scroll other chunks after failure to scroll one. + lib_doupdate.c - _nc_mvcur_scrolln extended to handle more cases; csr is avoided as it is relative costly. Fixed wrong coordinates in one case and wrong string in TRACE. > patch by Juergen Pfeifer: + modify C++ binding to compile on AIX 4.x with the IBM C-SET++ compiler. 970712 + remove alternate character set from kterm terminfo entry; it uses the shift-out control for a purpose incompatible with curses, i.e., font switching. + disentangle 'xterm' terminfo entry from some derived entries that should be based on xterm-r6 instead. + add cbt to xterm-xf86-xv32 terminfo entry; I added the emulation for XFree86 3.1.2F, but overlooked its use in terminfo then - T.Dickey. + correct logic in lib_mvcur.c that uses back_tab. 970706 + correct change from 970628 to ClrUpdate() in lib_doupdate.c so that contents of curscr are saved in newscr before clearing the screen. This is needed to make repainting work with the present logic of TransformLine(). + use napms() rather than sleep() in tset.c to avoid interrupting I/O. 970705 + add limit checks to _nc_read_file_entry() to guard against overflow of buffer when reading incompatible terminfo format, e.g, from OSF/1. + correct some loop-variable errors in xmc support in lib_doupdate.c + modify ncurses 'b' test to add gaps, specified by user, to allow investigation of interaction with xmc (magic cookie) code. + correct typo in 970524 mods to xmas.c, had omitted empty parameter list from has_colors(), which gcc ignores, but SVr4 does not (reported by Larry Virden). + correct rmso capability in wy50-mc description. + add configure option "--enable-hard-tabs", renamed TABS_OK ifdef to USE_HARD_TABS. > patch by Juergen Pfeifer: + Add bindings for keyok() and define_key() to the Ada95 packages. + Improve man pages menu_post.3x and menu_format.3x + Fix the HTML pages in the Ada95/html directory to reflect the above changes. 970628 + modify change from 970101 to ClrUpdate() in lib_doupdate.c so that pending changes to both curscr and newscr are flushed properly. This fixes a case where the first scrolling operation in nvi would cause the screen to be cleared unnecessarily and repainted before doing the indexing, i.e., by repeatedly pressing 'j' (reported by Juergen Pfeifer). + correct error in trans_string() which added embedded newlines in a terminfo description to the stored strings. + remove spurious newlines from sgr in wyse50 (and several other) terminfo descriptions. + add configure option for experimental xmc (magic cookie) code, "--enable-xmc-glitch". When disabled (the default), attributes that would store a magic cookie are suppressed in vidputs(). The magic cookie code is far from workable at this stage; the configuration option is a stopgap. + move _nc_initscr() from lib_initscr.c to lib_newterm.c + correct path for invoking make_keys (a missing "./"). 970621 + correct sign-extension problem with "infocmp -e", which corrupted acsc values computed for linux fallback data. + correct dependency on ncurses/names.c (a missing "./"). + modify configure script to use '&&' even for cd'ing to existing directories to work around broken shell interpreters. + correct a loop-limit in _nc_hash_map() (patch by Alexander V. Lukyanov). 970615 + restore logic in _nc_scroll_optimize() which marks as touched the lines in curscr that are shifted. + add new utility 'make_keys' to compute keys.tries as a table rather than a series of function calls. + correct include-dependency for tic.h used by name_match + removed buffer-allocation for name and description from m_item_new.c, since this might result in incompatibilities with SVr4. Also fixed the corresponding Ada95 binding module (patch by Juergen Pfeifer, report by Avery Pennarun ) + removed the mechanism to timestamp the generated Ada95 sources. This resulted always in generating patches for the HTML doc, even when nothing really changed (patch by Juergen Pfeifer). + improve man page mitem_new.3x (patch by Juergen Pfeifer). 970614 + remove ech capability from rxvt description because it does not work. + add missing case logic for infocmp -I option (reported by Lorenzo M. Catucci ) + correct old bug in pnoutrefresh() unmasked by fix in 970531; this caused glitches in the ncurses 'p' test since the area outside the pad was not compared when setting up indices for _nc_scroll_optimize. + rewrote tracebits() to workaround misdefinition of TOSTOP on Ultrix 4.4, as well as to eliminate fixed-size buffer (reported by Chris Tanner ) + correct prototype for termattrs() as per XPG4 version 2. + add placeholder prototypes for color_set(), erasewchar(), term_attrs(), wcolor_set() as per XPG4 version 2. + correct attribution for progs/progs.priv.h and lib_twait.c + improve line-breakout logic by checking based on changed lines rather than total lines (patch by Alexander V. Lukyanov). + correct loop limits for table-lookup of enumerated value in form (patch by Juergen Pfeifer). + improve threshhold computation for determining when to call ClrToEOL (patch by Alexander V. Lukyanov). 970531 + add configure option --disable-database to force the library to use only the fallback data. + add configure option --with-fallbacks, to specify list of fallback terminal descriptions. + add a symbolic link for ncurses.h during install; too many programs still assume there's an ncurses.h + add new terminfo.src entry for xterm-xf86-v33. + restore terminfo.src entry for emu to using setf/setb, since it is not, after all, generating ANSI sequences. Corrected missing comma that caused setf/setb entries to merge. + modify mousemask() to use keyok() to enable/disable KEY_MOUSE, so that applications can disable ncurses' mouse and supply their own handler. + add extensions keyok() and define_key(). These are designed to allow the user's application better control over the use of function keys, e.g., disabling the ncurses KEY_MOUSE. (The define_key idea was from a mailing-list thread started by Kenneth Albanowski Nov'1995). + restore original behavior in ncurses 'g' test, i.e., explicitly set the keypad mode rather than use the default, since it confuses people. + rewrote the newdemo banner so it's readable (reported by Hugh Daniel). + tidy up exit from hashtest (reported by Hugh Daniel). + restore check for ^Q in ncurses 'g' test broken in 970510 (reported by Hugh Daniel) + correct tput program, checking return-value of setupterm (patch by Florian La Roche). + correct logic in pnoutrefresh() and pechochar() functions (reported by Kriang Lerdsuwanakij ). The computation of 'wide' date to eric's #283 (1.9.9), and the pechochar bug to the original implementation (1.9.6). + correct typo in vt102-w terminfo.src entry (patch by Robert Wuest ) + move calls of _nc_background() out of various loops, as its return value will be the same for the whole window being operated on (patch by J T Conklin). + add macros getcur[xy] getbeg[xy] getpar[xy], which are defined in SVr4 headers (patch by J T Conklin ) + modify glibc addon-configure scripts (patch by H.J.Lu). + correct a bug in hashmap.c: the size used for clearing the hashmap table was incorrect, causing stack corruption for large values of LINES, e.g., >MAXLINES/2 (patch by Alexander V. Lukyanov). + eric's terminfo 9.13.23 & 9.13.24 changes: replaced minitel-2 entry, added MGR, ansi-nt (note: the changes described for 9.13.24 have not been applied). > several changes by Juergen Pfeifer: + correct a missing error-return in form_driver.c when wrapping of a field is not possible. + correct logic in form_driver.c for configurations that do not have memccpy() (reported by Sidik Isani ) + change several c++ binding functions to inline. + modify c++ menu binding to inherit from panels, for proper initialization. + correct freeing of menu items in c++ binding. + modify c++ binding to reflect removal of const from user data pointer in forms/menus libraries. 970524 + add description of xterm-16color. + modify name of shared-library on *BSD to end with $(REL_VERSION) rather than $(ABI_VERSION) to match actual convention on FreeBSD (cf: 960713). + add OpenBSD to shared-library case, same as NetBSD and FreeBSD (reported by Hugh Daniel ). + corrected include-dependency in menu/Makefile so that "make install" works properly w/o first doing "make". + add fallback definition for isascii, used in infocmp. + modify xmas to use color, and to exit right away when a key is pressed. + modify gdc so that the scrolled digits function as described (there was no time delay between the stages, and the digits overwrote the bounding box without tidying up). + modify lib_color.c to use setaf/setab only for the ANSI color codes 0 through 7. Using 16 colors requires setf/setb. + modify ncurses 'c' test to work with 16 colors, as well as the normal 8 colors. + remove const qualifier from user data pointer in forms and menus libraries (patch by Juergen Pfeifer). + rewrote 'waddchnstr()' to avoid using the _nc_waddch_nosync() function, thereby not interpreting tabs, etc., as per spec (patch by Alexander V. Lukyanov). 970517 + suppress check for pre-existing ncurses header if the --prefix option is specified. + add configure options "--with-system-type" and "--with-system-release" to assist in checking the generated makefiles. + add configure option "--enable-rpath" to allow installers to specify that programs linked against shared libraries will have their library path embedded, allowing installs into nonstandard locations. + add flags to OSF1 shared-library options to specify version and symbol file (patch by Tim Mooney ) + add missing definition for ABI_VERSION to c++/Makefile.in (reported by Satoshi Adachi ). + modify link flags to accommodate HP-UX linker which embeds absolute pathnames in executables linked against shared libraries (reported by Jason Evans , solved by Alan Shutko ). + drop unnecessary check for attribute-change in onscreen_mvcur() since mvcur() is the only caller within the library, and that check in turn is exercised only from lib_doupdate.c (patch by Alexander V. Lukyanov). + add 'blank' parameter to _nc_scroll_window() so _nc_mvcur_scrolln() can use the background of stdscr as a parameter to that function (patch by Alexander V. Lukyanov). + moved _nc_mvcur_scrolln() from lib_mvcur.c to lib_doupdate.c, to use the latter's internal functions, as well as to eliminate unnecessary cursor save/restore operations (patch by Alexander V. Lukyanov). + omit parameter of ClrUpdate(), since it is called only for newscr, further optimized/reduced by using ClearScreen() and TransformLine() to get rid of duplicate code (patch by Alexander V. Lukyanov). + modify scrolling algorithm in _nc_scroll_optimize() to reject hunks that are smaller than the distance to be moved (patch by Alexander V. Lukyanov). + correct a place where the panel library was not ifdef'd in ncurses.c (Juergen Pfeifer) + documentation fixes (Juergen Pfeifer) 970515 4.1 release for upload to prep.ai.mit.edu + re-tag changes since 970505 as 4.1 release. 970510 + modify ncurses 'g' test to allow mouse input + modify default xterm description to include mouse. + modify configure script to add -Wwrite-strings if gcc warnings are enabled while configuring --enable-const (and fixed related warnings). + add toggle, status display for keypad mode to ncurses 'g' test to verify that keypad and scrollok are not inherited from parent window during a call to newwin. + correction to MKexpanded.sh to make it work when configure --srcdir is used (reported by H.J.Lu). + revise test for bool-type, ensuring that it checks if builtin.h is available before including it, adding test for sizeof(bool) equal to sizeof(short), and warning user if the size cannot be determined (reported by Alexander V. Lukyanov). + add files to support configuration of ncurses as an add-on library for GNU libc (patch by H.J.Lu ) 970506 + correct buffer overrun in lib_traceatr.c + modify change to lib_vidattr.c to avoid redundant orig_pair. + turn on 'echo()' in hanoi.c, since it is initially off. + rename local 'errno' variable in etip.h to avoid conflict with global (H.J.Lu). + modify configure script to cache LD, AR, AR_OPTS (patch by H.J.Lu ) 970505 4.1 pre-release + regenerate the misc directory html dumps without the link list, which is not useful. + correct dependency in form directory makefile which caused unnecessary recompiles. + correct substitution for ABI_VERSION in test-makefile + modify install rules for shared-library targets to remove the target before installing, since some install programs do not properly handle overwrite of symbolic links. + change order of top-level targets so that 'include' immediate precedes the 'ncurses' directory, reducing the time between new headers and new libraries (requested by Larry Virden). + modify lib_vidattr.c so that colors are turned off only before modifying other attributes, turned on after others. This makes the hanoi.c program display correctly on FreeBSD console. + modify debug code in panel library to print user-data addresses rather than the strings which they (may) point to. + add check to ensure that C++ binding and demo are not built with g++ versions below 2.7, since the binding uses templates. + modify c++ binding and demo to build and run with SGI's c++ compiler. (It also compiles with the Sun SparcWorks compiler, but the demo does not link, due to a vtbl problem). + corrections to demo.cc, to fix out-of-scope variables (Juergen Pfeifer). 970503 + correct memory leak in _nc_trace_buf(). + add configure test for regexpr.h, for Unixware 1.x. + correct missing "./" prefixing names of generated files in ncurses directory. + use single-quotes in configure scripts assignments for MK_SHARED_LIB to workaround shell bug on FreeBSD 2.1.5 + remove tabs from intermediate #define's for GCC_PRINTF, GCC_SCANF that caused incorrect result in ncurses_cfg.h + correct initialization in lib_trace.c, which omitted version info. + remove ech, el1 attributes from cons25w description; they appear to malfunction in FreeBSD 2.1.5 + correct color attributes in terminfo.src and lib_color.c to match SVr4 behavior by interchanging codes 1,4, 3,6 in the setf/setb capabilities. + use curs_set() rather than checks via tigetstr() for test programs that hide the cursor: firework, rain, worm. + ensure that if the terminal lacks change_scroll_region, parm_index and parm_rindex are used only to scroll the whole screen (patch by Peter Wemm). + correct curs_set() logic, which did not return ERR if the requested attributes did not exist, nor did it assume an unknown initial state for the cursor (patch by Alexander V. Lukyanov). + combine IDcTransformLine and NoIDcTransformLine to new TransformLine function in lib_doupdate.c (patch by Alexander V. Lukyanov). + correct hashmap.c, which did not update index information (patch by Alexander V. Lukyanov). + fixes for C++ binding and demo (see c++/NEWS) (Juergen Pfeifer). + correct index in lib_instr.c (Juergen Pfeifer). + correct typo in 970426 patch from Tom's cleanup of lib_overlay.c (patch by Juergen Pfeifer). 970426 + corrected cost computation in PutRange(), which was using milliseconds compared to characters by adding two new members to the SCREEN struct, _hpa_ch_cost and _cup_ch_cost. + drop ncurses/lib_unctrl.c, add ncurses/MKunctrl.awk to generate a const array of strings (suggested by Alexander V. Lukyanov). The original suggestion in 970118 used a perl script. + rewrote ncurses 'b' test to better exercise magic-cookie (xmc), as well as noting the attributes that are not supported by a terminal. + trace the computation of cost values in lib_mvcur.c + modify _nc_visbuf() to use octal rather than hex, corrected sign extension bug in that function that caused buffer overflow. + modify trace in lib_acs.c to use _nc_visbuf(). + suppress trace within _traceattr2(). + correct logic of _tracechtype2(), which did not account for repeats or redefinition within an acsc string. + modify debug-library version baudrate() to use environment variable $BAUDRATE to override speed computation. This is needed for regression testing. + correct problems shown by "weblint -pedantic". + update mailing-list information (now ncurses@bsdi.com). 970419 + Improve form_field_validation.3x manpage to better describe the precision parameter for TYPE_NUMERIC and TYPE_INTEGER. Provide more precise information how the range checking can be avoided. (patch by Juergen Pfeifer, reported by Bryan Henderson) + change type of min/max value of form types TYPE_INTEGER to long to match SVr4 documentation. + set the form window to stdscr in set_form_win() so that form_win() won't return null (patch by Juergen Pfeifer, reported by Bryan Henderson ). 970412 + corrected ifdef'ing of inline (cf: 970321) for TRACE vs C++. + corrected toggle_attr_off() macro (patch by Andries Brouwer). + modify treatment of empty token in $MANPATH to /usr/man (reported by ) + modify traces that record functions-called so that chtype and attr_t values are expressed symbolically, to simplify reuse of generated test-scripts on SVr4 regression testing. + add new trace functions _traceattr2() and _tracechtype2() 970405 + add configure option --enable-const, to support the use of 'const' where XSI should have, but did not, specify. This defines NCURSES_CONST, which is an empty token otherwise, for strict compatibility. + make processing of configure options more verbose by echoing the --enable/--with values. + add configure option --enable-big-core + set initial state of software echo off as per XSI. + check for C++ builtin.h header + correct computation of absolute-path for $INSTALL that dropped "-c" parameter from the expression. + rename config.h to ncurses_cfg.h to avoid naming-conflict when ncurses is integrated into larger systems (adapted from diffs by H.J.Lu for libc). + correct inequality in lib_doupdate.c that caused a single-char to not be updated when the char on the right-margin was not blank, idcok() was true (patch by Alexander V Lukyanov (in 970124), reported by Kriang Lerdsuwanakij in 970329). + modify 'clean' rule in include/Makefile so that files created by configure script are removed in 'distclean' rule instead. 970328 + correct array limit in tparam_internal(), add case to interpret "%x" (patch by Andreas Schwab) + rewrote number-parsing in ncurses.c 'd' test; it did not reset the value properly when non-numeric characters were given (reported by Andreas Schwab ) 970321 + move definition of __INTERNAL_CAPS_VISIBLE before include for progs.priv.h (patch by David MacKenzie). + add configuration summary, reordered check for default include directory to better accommodate a case where installer is configuring a second copy of ncurses (reported by Klaus Weide ) + moved the #define for 'inline' as an empty token from the $(CFLAGS_DEBUG) symbol into config.h, to avoid redefinition warning (reported by Ward Horner). + modify test for bool builtin type to use 'unsigned' rather than 'unknown' when cross-compiling (reported by Ward Horner). 970315 + add header dependencies so that "make install.libs" will succeed even if "make all" is not done first. + moved some macros from lib_doupdate.c to curses.priv.h to use in expanded functions with ATAC. + correct implementation of lib_instr.c; both XSI and SVr4 agree that the winnstr functions can return more characters than will fit on one line. 970308 + modify script that generates lib_gen.c to support traces of called & return. + add new configure option "--disable-macros", for testing calls within lib_gen.c + corrected logic that screens level-checking of called/return traces. 970301 + use new configure macro NC_SUBST to replace AC_PATH_PROG, better addressing request by Ward Horner. + check for cross-compiling before trying to invoke the autoconf AC_FUNC_SETVBUF_REVERSED macro (reported by Ward Horner) + correct/simplify loop in _nc_visbuf(), 970201 changes omitted a pointer-increment. + eliminate obsolete symbol SHARED_ABI from dist.mk (noted by Florian La Roche). 970215 + add configure option --enable-expanded, together with code that implements an expanded form of certain complex macros, for testing with ATAC. + disable CHECK_POSITION unless --with-assertions is configured (Alexander V Lukyanov pointed out that this is redundant). + use keyname() to show traced chtype values where applicable rather than _tracechar(), which truncates the value to 8-bits. + minor fixes to TRACE_ICALLS, added T_CREATE, TRACE_CCALLS macros. + modify makefiles in progs and test directories to avoid using C preprocessor options on link commands (reported by Ward Horner) + correct ifdef/include-order for nc_alloc.h vs lib_freeall.c (reported by Ward Horner) + modify ifdef's to use configure-defined symbols consistently (reported by Ward Horner) + add/use new makefile symbols AR, AR_OPTS and LD to assist in non-UNIX ports (reported by Ward Horner ) + rename struct try to struct tries, to avoid name conflict with C++ (reported by Gary Johnson). + modify worm.c to hide cursor while running. + add -Wcast-qual to gcc warnings, fix accordingly. + use PutChar rather than PutAttrChar in ClrToEOL to properly handle wrapping (Alexander V Lukyanov). + correct spurious echoing of input in hanoi.c from eric's #291 & #292 patches (reported by Vernon C. Hoxie ). + extend IRIX configuration to IRIX64 + supply missing install.libs rule needed after restructuring test/Makefile.in 970208 + modify "make mostlyclean" to leave automatically-generated source in the ncurses directory, for use in cross-compiles. + autogenerated object-dependencies for test directory + add configure option --with-rcs-ids + modify configuration scripts to generate major/minor/patch versions (suggested by Alexander V Lukyanov). + supply missing va_end's in lib_scanw.c + use stream I/O for trace-output, to eliminate fixed-size buffer + add TRACE_ICALLS definition/support to lib_trace.c + modify Ada95 binding to work with GNAT 3.09 (Juergen Pfeifer). 970201 + add/modify traces for called/return values to simplify extraction for test scripts. + changed _nc_visbuf to quote its result, and to dynamically allocate the returned buffer. + invoke ldconfig after installing shared library + modify install so that overwrite applies to shared library -lcurses in preference to static library (reported by Zeyd M Ben-Halim 960928). + correct missing ';' in 961221 mod to overwrite optional use of $(LN_S) symbol. + fixes to allow "make install" to work without first doing a "make all" (suggested by Larry Virden). 970125 + correct order of #ifdef for TABS_OK. + instrumented toe.c to test memory-leaks. + correct memory-deallocation in toe.c (patch by Jesse Thilo). + include in configuration test for regex.h (patch by Andreas Schwab) + make infocmp recognize -I option, for SVr4 compatibility (reported by Andreas Schwab ) 970118 + add extension 'use_default_colors()', modified test applications that use default background (firework, gdc, hanoi, knight, worm) to demonstrate. + correct some limit checks in lib_doupdate.c exposed while running worm. + use typeCalloc macro for readability. + add/use definition for CONST to accommodate testing with Solaris (SVr4) curses, which doesn't use 'const' in its prototypes. + modify ifdef's in test/hashtest.c and test/view.c to compile with Solaris curses. + modify _tracedump() to pad colors & attrs lines to match change in 970101 showing first/last changes. + corrected location of terminating null on dynamically allocated forms fields (patch by Per Foreby). 970111 + added headers to make view.c compile on SCO with the resizeterm() code (i.e., struct winsize) - though this compiles, I don't have a suitable test configuration since SIGWINCH doesn't pass my network to that machine - T.Dickey. + update test/configure.in to supply some default substitutions. + modify configure script to add -lncurses after -lgpm to fix problem linking against static libraries. + add a missing noraw() to test/ncurses.c (places noted by Jeremy Buhler) + add a missing wclear() to test/testcurs.c (patch by Jeremy Buhler ) + modify headers to accommodate compilers that don't allow duplicate "#define" lines for NCURSES_VERSION (reported by Larry W. Virden ) + fix formatting glitch in curs_getch.3x (patch by Jesse Thilo). + modify lib_doupdate to make el, el1 and ed optimization use the can_clear_with macro, and change EmitRange to allow leaving cursor at the middle of interval, rather than always at the end (patch by Alexander V Lukyanov). This was originally 960929, resync 970106. 970104 + workaround defect in autoconf 2.12 (which terminates configuration if no C++ compiler is found) by adding an option --without-cxx. + modify several man-pages to use tbl, where .nf/.fi was used (reported by Jesse Thilo). + correct font-codes in some man-pages (patch by Jesse Thilo ) + use configure script's knowledge of existence of g++ library for the c++ Makefile (reported by Paul Jackson). + correct misleading description of --datadir configuration option (reported by Paul Jackson ) 970101 + several corrections to _nc_mvcur_scrolln(), prompted by a bug report from Peter Wemm: > the logic for non_dest_scroll_region was interchanged between the forward & reverse scrolling cases. > multiple returns from the function allowed certain conditions to do part of an operation before discovering that it couldn't be completed, returning an error without restoring the cursor. > some returns were ERR, where the function had completed the operation, because the insert/delete line logic was improperly tested (this was probably the case Peter saw). > contrary to comments, some scrolling cases were tested after the insert/delete line method. + modify _tracedump() to show first/last changes. + modify param of ClrUpdate() in lib_doupdate.c to 'newscr', fixes refresh problem (reported by Peter Wemm) that caused nvi to not show result of ":r !ls" until a ^L was typed. 961229 (internal alpha) + correct some of the writable-strings warnings (reported by Gary Johnson ). Note that most of the remaining ones are part of the XSI specification, and can't be "fixed". + improve include-dependencies in form, menu, panel directories. + correct logic of delay_output(), which would return early if there is data on stdin. + modify interface & logic of _nc_timed_wait() to support 2 file descriptors, needed for GPM. + integrate patch by Andrew Kuchling for GPM (mouse) support, correcting logic in wgetch() and _nc_mouse_parse() which prevented patch from working properly -TD + improve performance of panel algorithm (Juergen Pfeifer 961203). + strip RCS id's from generated .html files in Ada95 subtree. + resync with generated .html files (Juergen Pfeifer 961223). + terminfo.src 10.1.0 (ESR). 961224 4.0 release + release as 4.0 to accommodate Linux ld.so.1.8.5 + correct syntax/spelling, regenerated .doc files from .html using lynx 2.5 + refined forms/menus makefiles (Juergen Pfeifer 961223). 961221 - snapshot + remove logic in read_entry.c that attempts to refine errno by using 'access()' for the directory (from patch by Florian La Roche). + correct configure test/substitution that inhibits generating include-path to /usr/include if gcc is used (reported by Florian La Roche). + modify setupterm() to allocate new TERMINAL for each call, just as solaris' curses does (Alexander V Lukyanov 960829). + corrected memory leaks in read_entry.c + add configure options --with-dbmalloc, --with-dmalloc, and --disable-leaks, tested by instrumenting infocmp, ncurses programs. + move #include's for stdlib.h and string.h to *.priv.h to accommodate use of dbmalloc. + modify use of $(LN_S) to follow recommendation in autoconf 2.12, i.e., set current directory before linking. + split-out panel.priv.h, improve dependencies for forms, menus (Juergen Pfeifer 961204). + modify _nc_freewin() to reset globals curscr/newscr/stdscr when freeing the corresponding WINDOW (found using Purify). + modify delwin() to return ERR if the window to be deleted has subwindows, needed as a side-effect of resizeterm() (found using Purify). Tested and found that SVr4 curses behaves this way. + implement logic for _nc_freeall(), bringing stub up to date. 961215 + modify wbkgd() so that it doesn't set nulls in the rendered text, even if its argument doesn't specify a character (fixes test case by Juergen Pfeifer for bug-report). + set window-attributes in wbkgd(), to simplify comparison against Solaris curses, which does this. 961214 - snapshot + replace most constants in ncurses 'o' test by expressions, making it work with wider range of screen sizes. + add options to ncurses.c to specify 'e' test softkey format, and the number of header/footer lines to rip-off. + add ^R (repaint after resize), ^L (refresh) commands to ncurses 'p' test. + add shell-out (!) command to ncurses 'p' test to allow test of resize between endwin/refresh. + correct line-wrap case in mvcur() by emitting carriage return, overlooked in 960928, but needed due to SVr4 compatibility changes to terminal modes in 960907. + correct logic in wresize that causes new lines to be allocated, broken for the special case of increasing rows only in 960907's fix for subwindows. + modify configure script to generate $(LDFLAGS) with -L and -l options in preference to explicit library filenames. (NOTE: this may require further amending, since I vaguely recall a dynamic loader that did not work properly without the full names, but it should be handled as an exception to the rule, since some linkers do bulk inclusion of libraries when given the full name - T.Dickey). + modify configure script to allow user-supplied $CFLAGS to set the debug-option in all libraries (requested by lots of people) -TD + use return consistently from main(), rather than exit (reported by Florian La Roche). + add --enable-getcap-cache option to configure, normally disabled (requested by Florian La Roche). + make configure test for gettimeofday() and possibly -lbsd more efficient (requested by Florian La Roche ) + minor adjustments to Ada95 binding (patches by Juergen Pfeifer) + correct attributes after emitting orig_pair in lib_vidattr.c (patch by Alexander V Lukyanov). 961208 + corrected README wrt Ada95 (Juergen Pfeifer) 961207 - snapshot + integrate resizeterm() into doupdate(), so that if screen size changes between endwin/refresh, ncurses will resize windows to fit (this needs additional testing with pads and softkeys). + add, for memory-leak testing, _nc_freeall() entrypoint to free all data used in ncurses library. + initialize _nc_idcok, _nc_idlok statically to resolve discrepancy between initscr() and newwin() initialization (reported by Alexander V Lukyanov). + test built VERSION=4.0, SHARED_ABI=4 with Linux ld.so.1.8.5 (set beta versions to those values -- NOTE that subsequent pre-4.0 beta may not be interchangeable). + modify configure script to work with autoconf 2.12 961130 1.9.9g release + add copyright notices to configuration scripts (written by Thomas Dickey). 961127 > patch, mostly for panel (Juergen Pfeifer): + cosmetic improvement for a few routines in the ncurses core library to avoid warning messages. + the panel overlap detection was broken + the panel_window() function was not fool-proof. + Some inlining... + Cosmetic changes (also to avoid warning messages when compiling with -DTRACE). 961126 > patch by Juergen Pfeifer: + eliminates warning messages for the compile of libform. + inserts Per Foreby's new field type TYPE_IPV4 into libform. + Updates man page and the Ada95 binding to reflect this. + Improves inlining in libmenu and libform. 961120 + improve the use of the "const" qualifier in the panel library (Juergen Pfeifer) + change set_panel_userptr() and panel_userptr() to use void* (Juergen Pfeifer) 961119 + change ABI to 3.4 + package with 961119 version of Ada95 binding (fixes for gnat-3.07). (Juergen Pfeifer) + correct initialization of the stdscr pseudo panel in panel library (Juergen Pfeifer) + use MODULE_ID (rcs keywords) in forms and menus libraries (Juergen Pfeifer). > patch #324 (ESR): + typo in curs_termcap man page (reported by Hendrik Reichel <106065.2344@compuserve.com>) + change default xterm entry to xterm-r6. + add entry for color_xterm 961116 - snapshot + lint found several functions that had only #define implementations (e.g., attr_off), modified curses.h.in to generate them as per XSI Curses requirement that every macro be available as a function. + add check in infocmp.c to guard against string compare of CANCELLED_STRING values. + modify firework.c, rain.c to hide cursor while running. + correct missing va_end in lib_tparm.c + modify hanoi.c to work on non-color terminals, and to use timing delays when in autoplay mode. + correct 'echochar()' to refresh immediately (reported by Adrian Garside <94ajg2@eng.cam.ac.uk>) > patch #322 (ESR): + reorganize terminfo.src entries for xterm. 961109 - snapshot + corrected error in line-breakout logic (lib_doupdate.c) + modified newdemo to use wgetch(win) rather than getch() to eliminate a spurious clear-screen. + corrected ifdef's for 'poll()' configuration. + added modules to ncurses, form, menu for Ada95 binding (Juergen Pfeifer). + modify set_field_buffer() to allow assignment of string longer than the initial buffer length, and to return the complete string rather than only the initial size (Juergen Pfeifer and Per Foreby ). 961102 - snapshot + configure for 'poll()' in preference to 'select()', since older systems are more likely to have a broken 'select()'. + modified render_char() to avoid OR'ing colors. + minor fixes to testcurs.c, newdemo.c test programs: ifdef'd out the resize test, use wbkgd and corrected box() parameters. + make flushinp() test work in ncurses.c by using napms() instead of sleep(). + undo ESR's changes to xterm-x11r6 (it no longer matched the X11R6.1 distribution, as stated) + terminfo 9.13.18 resync (ESR) + check for getenv("HOME") returning null (ESR). + change buffer used to decode xterm-mouse commands to unsigned to handle displays wider than 128 chars (Juergen Pfeifer). + correct typo curs_outopts.3x (Juergen Pfeifer). + correct limit-checking in wenclose() (Juergen Pfeifer). + correction to Peter Wemm's newwin change (Thomas Fehr ). + corrections to logic that combines colors and attributes; they must not be OR'd (Juergen Pfeifer, extending from report/patch by Rick Marshall). 961026 - snapshot + reset flags in 'getwin()' that might cause refresh to attempt to manipulate the non-existent parent of a window that is read from a file (lib_screen.c). + restructure _nc_timed_wait() to log more information, and to try to recover from badly-behaved 'select()' calls (still testing this). + move define for GOOD_SELECT into configure script. + corrected extra '\' character inserted before ',' in comp_scan.c + corrected expansion of %-format characters in dump_entry.c; some were rendered as octal constants. + modify dump_entry.c to make terminfo output more readable and like SVr4, by using "\s" for spaces (leading/trailing only), "\," for comma, "\^" and "\:" as well. + corrected some memory leaks in ncurses.c, and a minor logic error in the top-level command-parser. + correction for label format 4 (PC style with info line), a slk_clear(), slk_restore() sequence didn't redraw the info line (Juergen Pfeifer). + modified the slk window (if simulated) to inherit the background and default character attributes from stdscr (Juergen Pfeifer). + corrected limit-check in set_top_row (Juergen Pfeifer). 961019 - snapshot + correct loop-limit in wnoutrefresh(), bug exposed during pipe-testing had '.lastchar' entry one beyond '._maxx'. + modify ncurses test-program to work with data piped to it. + corrected pathname computation in run_tic.sh, removing extra "../" (reported by Tim Mooney). + modified configure script to use previous install's location for curses.h + added NetBSD and FreeBSD to platforms that use --prefix=/usr as a default. 961013 + revised xterm terminfo descriptions to reflect the several versions that are available. + corrected a pointer reference in dump_entry.c that didn't test if the pointer was -1. 961005 - snapshot + correct _nc_mvcur_scrolln for terminals w/o scrolling region. + add -x option to hashtest to control whether it allows writes to the lower-right corner. + ifdef'd (NCURSES_TEST) the logic for _nc_optimize_enable to make it simpler to construct tests (for double-check of _nc_hash_map tests). + correct ifdef's for c++ in curses.h + change default xterm type to xterm-x11r6. + correct quoting in configure that made man-pages installed with $datadir instead of actual terminfo path. + correct whitespace in include/Caps, which caused kf11, clr_eol and clr_end to be omitted from terminfo.5 + fix memory leaks in delscreen() (adapted from Alexander V Lukyanov). + improve appearance of marker in multi-selection menu (Juergen Pfeifer) + fix behavior for forms with all fields inactive (Juergen Pfeifer) + document 'field_index()' (Juergen Pfeifer) > patch #321 (ESR): + add some more XENIX keycap translations to include/Caps. + modify newwin to set initial state of each line to 'touched' (from patch by Peter Wemm ) + in SET_TTY, replace TCSANOW with TCSADRAIN (Alexander V Lukyanov). 960928 - snapshot + ifdef'd out _nc_hash_map (still slower) + add graphic characters to vt52 description. + use PutAttrChar in ClrToEOL to ensure proper background, position. + simplify/correct logic in 'mvcur()' that does wrapping; it was updating the position w/o actually moving the cursor, which broke relative moves. + ensure that 'doupdate()' sets the .oldindex values back to a sane state; this was causing a spurious refresh in ncurses 'r'. + add logic to configure (from vile) to guard against builders who don't remove config.cache & config.status when doing new builds -TD + corrected logic for 'repeat_char' in EmitRange (cf: eric #317), which did not follow the 2-parameter scheme specified in XSI. + corrected logic of wrefresh, wnoutrefresh broken in #319, making clearok work properly (report by Michael Elkins). + corrected problem with endwin introduced by #314 (removing the scrolling-region reset) that broke ncurses.c tests. + corrected order of args in AC_CHECK_LIB (from report by Ami Fischman ). + corrected formatting of terminfo.5 tables (Juergen Ehling) > patch 320 (ESR): + change ABI to 3.3 + emit a carriage-return in 'endwin()' to workaround a kernel bug in BSDI. (requested by Mike Karels ) + reverse the default o configure --enable-termcap (consensus). > patch 319 (ESR): + modified logic for clearok and related functions (from report by Michael Elkins) - untested > patch 318 (ESR): + correction to #317. > patch 317 (ESR): + re-add _nc_hash_map + modify EmitRange to maintain position as per original design (patch by A. Lukyanov). + modify test/ncurses.c and tputs, etc., to allow trace counting output characters. + add hashtest.c program to time the hashmap optimization. > patch 316 (ESR): + add logic to deal with magic-cookie (how was this tested?) (lib_doupdate.c). + add ncurses.c driver for magic-cookie, some fixes to ncurses.c > patch 315 (ESR): + merge changes to lib_doupdate.c to use ech and rep - untested (patch by Alexander V Lukyanov). + modified handling of interrupted system calls - untested (lib_getch.c, lib_twait.c). + new function _nc_mvcur_resume() + fix return value for 'overlay()', 'overwrite()' 960914 - snapshot + implement subwindow-logic in wresize, minor fixes to ncurses 'g' test. + corrected bracketing of fallback.c (reported/suggested fix by Juergen Ehling ). + update xterm-color to reflect XFree86 3.1.3G release. + correct broken dtterm description from #314 patch (e.g., spurious newline. The 'pairs' change might work, but no one's tested it either ;-) + clarify the documentation for the builtin form fieldtypes (Juergen Pfeifer) > patch 314 (ESR): + reset scroll region on startup rather than at wrapup time (enhancement suggested by Alexander V Lukyanov). + make storage of palette tables and their size counts per-screen for multi-terminal applications (suggested by Alexander V Lukyanov). + Improved error reporting for infotocap translation errors. + Update terminfo.src to 9.13.14. 960907 - snapshot + rewrote wgetstr to make it erase control chars and also fix bogus use of _nc_outstr which caused the display to not wrap properly (display problem reported by John M. Flinchbaugh ) + modify ncurses 'f' test to accommodate terminal responses to C1 codes (and split up this screen to accommodate non-ANSI terminals). + test enter_insert_mode and exit_insert_mode in has_ic(). + removed bogus logic in mvcur that assumes nl/nonl set output modes (XSI says they are input modes; SVr4 implements this). + added macros SET_TTY, GET_TTY to term.h + correct getstr() logic that altered terminal modes w/o restoring. + disable ICRNL, etc., during initialization to match SVr4, removing the corresponding logic from raw, cbreak, etc. + disable ONLCR during initialization, to match SVr4 (this is needed for cursor optimization when the cursor-down is a newline). + replaced ESR's imitation of wresize with my original (his didn't work). 960831 - snapshot + memory leaks (Alexander V. Lukyanov). + modified pnoutrefresh() to be more tolerant of too-large screen size (reported by Michael Elkins). + correct handling of terminfo files with no strings (Philippe De Muyter) + correct "tic -s" to take into account -I, -C options. + modify ncurses 'f' test to not print codes 80 through 9F, since they are considered control codes by ANSI terminals. 960824 - snapshot + correct speed variable-type in 'tgetent()' (reported by Peter Wemm) + make "--enable-getcap" configuration-option work (reported by Peter Wemm ) 960820 + correct err in 960817 that changed return-value of tigetflag() (reported by Alexander V. Lukyanov). + modify infocmp to use library default search-path for terminfo directory (Alexander V. Lukyanov). 960817 - snapshot + corrected an err in mvcur that broke resizing-behavior. + correct fall-thru behavior of _nc_read_entry(), which was not finding descriptions that existed in directories past the first one searched (reported by Alexander V. Lukyanov) + corrected typo in dtterm description. > patch 313 (ESR): + add dtterm description + clarify ncurses 'i' test (drop mvwscanw subtest) 960810 - snapshot + correct nl()/nonl() to work as per SVr4 & XSI. + minor fixes to ncurses.c (use 'noraw()', mvscanw return-code) + refine configure-test for "-g" option (Tim Mooney). + correct interaction between O_BLANK and NEW_LINE request in form library (Juergen Pfeifer) 960804 + revised fix to tparm; previous fix reversed parameter order. > patch 312 (ESR): correct terminfo.src corrupted by #310 > patch 311 (ESR): + fix idlok() and idcok() and the default of the idlok switch (report by Ville Sulko). 960803 - snapshot + corrected tparm to handle capability strings without explicit pop (reported by William P Setzer) + add fallback def for GCC_NORETURN, GCC_UNUSED for termcap users (reported by Tim Mooney). > patch 310 (ESR): + documentation and prototyping errors for has_color, immedok and idcok (reported by William P Setzer ) + updated qnx terminfo entry (patch by Michael Hunter) 960730 + eliminate quoted includes in ncurses subdirectory, ensure config.h is included first. + newterm initializes terminal settings the same as initscr (reported by Tim Mooney). 960727 - snapshot + call cbreak() in initscr(), as per XSI & SVr4. + turn off hardware echo in initscr() as per XSI & SVr4 > patch 309 (ESR): + terminfo changes (9.3.9), from BRL + add more checks to terminfo parser. + add more symbols to infocmp. 960720 - snapshot + save previous-attribute in lib_vidattr.c if SP is null (reported by Juergen Fluk ) + corrected calls on _nc_render so that background character is set as per XSI. + corrected wbkgdset macro (XSI allows background character to be null), and tests that use it. + more corrections to terminfo (xterm & rxvt) + undid change to mcprint prototype (cannot use size_t in curses.h because not all systems declare it in the headers that we can safely include therein). + move the ifdefs for errno into curses.priv.h > patch 308 (ESR): + terminfo changes (9.3.8) + modified logic of error-reporting in terminfo parser + fix option-processing bug in toe. 960713 - snapshot + always check for since ISC needs it to declare fd_set (Juergen Pfeifer) + install shared-libraries on NetBSD/FreeBSD with ABI-version (reported by Juergen Pfeifer, Mike Long) + add LOCAL_LDFLAGS2 symbol (Juergen Pfeifer) + corrected prototype for delay_output() -- bump ABI to 3.2 + patch 307 (ESR): + enable more translations of nonstandard caps, and document them. + misc/terminfo.src update to 9.13.8 + patch 306 (ESR): + moved logic that filters out rmul and rmso from setupterm to newterm where it is less likely to interfere with termcap applications. + cosmetic fixes to test/ncurses.c + modify open() call in ncurses/read_entry.c to use O_RDONLY symbol rather than constant (report by mib). + misc/terminfo.src sgr0 and acsc changes (report by Philippe De Muyter). + modify ncurses/comp_parse.c so that entries containing a "+" can have missing rmcup vs smcup. 960707 + rollback ESR's #305 change to terminfo.src (it breaks existing applications, e.g., 'less 290'). + correct path of edit_man.sh, and fix typo that made all man-pages preformatted. + restore man/menu_requestname.3x omitted in Zeyd's resync (oops). + auto-configure the GCC_PRINTFLIKE/GCC_SCANFLIKE macros (reported by Philippe De Muyter). 960706 - snapshot + make lib_vidattr.c more readable using macros. + filter out rmul, rmso that conflict with sgr0 when reading terminal descriptions. + work around autoconf bug, force $INSTALL to absolute path (reported by Zeyd). + modify man-page install for BSDI to install preformatted .0 files (reported by David MacKenzie). + add/use gcc __attribute__ for printf and scanf in curses.h + added SGR attributes test-case to ncurses + revised ncurses 't' logic to show trace-disable effect in the menu. + use getopt in ncurses program to process -s and -t options. + make ncurses 'p' legend toggle with '?' + disable scrollok during the ncurses 'p' test; if it is enabled the stdscr will scroll when putting the box-corners in the lower-right of the screen. > patch 305 (ESR): + added sanity-checking of various paired string attributes. + misc/terminfo.src update to 9.13.7 (report by A. Lukyanov). + modify man/Makefile.in to make terminfo.5 during normal build. > patch 304 (ESR): + corrected allocation-length for $HOME/.terminfo path. 960629 - snapshot + check return code of _nc_mvcur_scrolln() in _nc_scroll_optimize() for terminals with no scrolling-support (reported by Nikolay Shadrin ) + added ^S scrollok-toggle to ncurses 'g' test. + added ^T trace-toggle to ncurses tests. + modified ncurses test program to use ^Q or ESC consistently for terminating tests (rather than ^D), and to use control keys rather than function keys in 'g' test. + corrected misplaced wclrtoeol calls in addch to accommodate wrapping (reported by Philippe De Muyter). + modify lib_doupdate.c to use effective costs to tradeoff between delete-character/insert-character vs normal updating (reported by David MacKenzie). + compute effective costs for screen update operations (e.g., clr_eos, delete_character). + corrected error in knight.c exposed by wrap fixes in 960622; the msgwin needed scrollok set. + corrected last change to IDcTransformLine logic to avoid conflict between PutRange and InsStr + modified run_tic.sh to not use /usr/tmp (reported by David MacKenzie), and further revised it and aclocal.m4 to use $TMPDIR if set. + corrected off-by-one in RoomFor call in read_entry.c 960622 - snapshot + modified logic that wraps cursor in addch to follow the XSI spec, (implemented in SVr4) which states that the cursor position is updated when wrapping. Renamed _NEED_WRAP to _WRAPPED to reflect the actual semantics. + added -s option to tic, to provide better diagnostics in run_tic.sh + improved error-recovery for tabset install. + change ABI to 3.1 (dropped tparam, corrected getbkgd(), added _yoffset to WINDOW). + modified initialization of SP->_ofp so that init_acs() is called with the "right" file pointer (reported by Rick Marshall + documentation fixes (Juergen Pfeifer). + corrected, using new SCREEN and WINDOW members, the behavior of ncurses if one uses ripoffline() to remove a line from the top of the screen (Juergen Pfeifer). + modified autoconf scripts to prepare for Ada95 (GNAT) binding to ncurses (Juergen Pfeifer). + incorrect buffer-size in _nc_read_entry, reported by ESR. 960617 + corrected two logic errors in read_entry.c, write_entry.c (called by tic, the write/read of terminfo entries used inconsistent rules for locating the entries; the $TERMINFO_DIRS code would find only the first entry in a list). + refined pathname computation in run_tic.sh and shlib. + corrected initialization of $IP in misc/run_tic.sh 960615 - snapshot + ifdef'd out _nc_hash_map() call because it does not improve speed. + display version of gcc if configure script identifies it. + modify configure script to use /usr as Linux's default prefix. + modify run_tic.sh to use shlib script, fixes some problems installing with a shared-library configuration. + adjusted configure script so that it doesn't run tests with the warnings turned on, which makes config.log hard to read. + added 'lint' rule to top-level Makefile. + added configure option '--with-install-prefix' for use by system builders to install into staging locations (requested by Charles Levert ). + corrected autoconfigure for Debian man program; it's not installed as "man_db". + set noecho in 'worm'; it was ifdef'd for debug only + updated test/configure.in for timing-display in ncurses 'p' test + corrected misspelled 'getbkgd()'. + corrected wbkgdset to work like observed syvr4 (sets A_CHARTEXT part to blank if no character given, copies attributes to window's attributes). + modified lib_doupdate.c to use lower-level SP's current_attr state instead of curscr's state, since it is redundant. + correction to IDcTransformLine logic which controls where InsStr is invoked (refined by Alexander V Lukyanov). > patch 303 (ESR): + conditionally include Chris Torek's hash function _nc_hash_map(). + better fix for nvi refresh-bug (Rick Marshall) + fix for bug in handling of interrupted keystroke waits, (Werner Fleck). + misc/ncurses-intro.html syntax fix (Kajiyama Tamito). 960601 - snapshot + auto-configure man-page compression-format and renames for Debian. + corrected several typos in curses.h.in (i.e., the mvXXXX macros). + re-order curses.priv.h for lint. + added rules for lintlib, lint + corrected ifdef for BROKEN_LINKER in MKnames.awk.in + corrected missing INSTALL_DATA in misc/Makefile.in + flush output when changing cursor-visibility (Rick Marshall) + fix a minor bug in the _nc_ripoff() routine and improve error checking when creating the label window (Juergen Pfeifer). + enhancement to the control over the new PC-style soft key format. allow caller now to select whether or not one wants to have the index-line; see curs_slk.3x for documentation (Juergen Pfeifer). + typos, don't use inline with "-g" (Philippe De Muyter) + fixes for menus & wattr-, slk-functions (Juergen Pfeifer) 960526 - snapshot + removed --with-ticdir option altogether, maintain compatibility with existing applications via symbolic link in run_tic.sh + patch for termio.h, signal (Philippe De Muyter) + auto-configure gcc warning options rather than infer from version. + auto-configure __attribute__ for different gcc versions. + corrected special use of clearok() in hardscroll.c by resetting flag in wrefresh(). + include stdlib.h before defs for EXIT_SUCCESS, for OSF/1. + include sys/types.h in case stdlib.h does not declare size_t. + fixes for makefile (Tim Mooney) + fixes for menus & forms (Juergen Pfeifer) > patch 302 (ESR): + improve hash function (suggested by Alexander V Lukyanov). + 9.13.4 update for terminfo.src 960518 - snapshot + revised ncurses.c panner test, let pad abut all 4 sides of screen. + refined case in lib_doupdate.c for ClrToEOL(). + corrected prior change for PutRange (Alexander V Lukyanov ). + autoconf mods (Tim Mooney ). + locale fix for forms (Philippe De Muyter ) + renamed "--with-datadir" option to "--with-ticdir" to avoid confusion, and made this check for the /usr/lib/terminfo pre-existing directory. > patches 299-301 (ESR): + html fixes (Phillippe de Muyter). + fix typo in ncurses-intro.html (report by Fabrizio Polacco). + added hashmap.c + mods to tracing, especially for ACS chars. + corrected off-by-one in IDCtransform. + corrected intermittent mouse bug by using return-value from read(). + mods to parse_entry.c, for smarter defaults. 960512 + use getopt in 'tic'; added -L option and modified -e option to allow list from a file. 960511 + don't use fixed buffer-size in tparm(). + modified tic to create terminfo directory if it doesn't exist. + added -T options to tic and infocmp (for testing/analysis) + refined the length criteria for termcap and terminfo + optimize lib_doupdate with memcpy, PutRange > patches 297, 298 (ESR): + implement TERMINFO_DIRS, and -o option of tic + added TRACE_IEVENT + fix REQ_TOGGLE_ITEM in menu/menu_driver.c; it could select but not deselect. + added lib_print.c (request by Rick Marshall). + added has_key() (request by Juergen Pfeifer). + do not issue clrtoeol or clrtobot if the relevant portion of the line is already blank (analysis by Keith Bostic). + add parentheses for parameters of COLOR_PAIR and PAIR_NUMBER macros (analysis by Jurgen Eidt). + update screen's notion of cursor position in endwin() (analysis by Alexander Lukyanov). + added 't' to ncurses.c test. + moved delay_output() to lib_tputs.c + removed tparam() (was added in 1.9.9, but conflicts with emacs and is not part of X/Open Curses). + removed boolean version of 'getm'. + misc cursor & optimization fixes. 960504 - snapshot + modified ncurses 'p' test to allow full-screen range for panner size. + fixes for locale (Philippe De Muyter ) + don't use fixed buffer-size in fmt_entry(). + added usage-message to 'infocmp'. + modified install.includes rules to prepend subdirectory-name to "#include" if needed. 960430 + protect wrefresh, wnoutrefresh from invocation with pad argument. + corrected default CCFLAGS in test/Makefile. 960428 - snapshot + implemented logic to support terminals with background color erase (e.g., rxvt and the newer color xterm). + improved screen update logic (off-by-one logic error; use clr_eos if possible) 960426 - snapshot + change ncurses 'a' test to run in raw mode. + make TIOCGWINSZ configure test less stringent, in case user configures via terminal that cannot get screen size. > patches 295, 296 (ESR): + split lib_kernel.c, lib_setup.c and names.c in order to reduce overhead for programs that use only termcap features. + new "-e" and "-h" options of tic (request by Tony Nugent). + fix bug in mandatory-delay logic in lib_tputs.c (report by Sven Verdoolaege). + fix for "infocmp -e" to emit correct initializers (reported by Manual J Novoa III). + restore working-directory in read_termcap.c (report by Kayvan Sylvan). + use "-h" option on Solaris when generating shared libraries on Solaris 2.5 to record the library name in the file, for assisting the loader (patch by Scott Kramer). + undo patch #294 changes to form and menu libraries (request by Juergen Pfeifer). 960418 - snapshot + use autoconf 2.9 + fix for AIX 3.2.5 (must define _POSIX_SOURCE to get termios struct definitions via , modified macros in lib_raw.c to avoid K&R-style substitution) > patches 293, 294 (ESR): + rewrite wsyncup(), wsyncdown(), as well as small fixes to form and menu libraries to fix echo-breakage introduced by 1.8.9, 1.9.9e changes (patches by Juergen Pfeifer). + fix compile under QNX 4.2 by defining ONLCR in lib_raw.c when __QNX__ is defined (patch by Michael Hunter). + modify setupterm() to match documentation for its return value, fix newterm to work with this change (report by Emmet Lazich). + add checks in getch() for error, return ERR as appropriate (report by Emmet Lazich). + mods to wgetch() in cooked mode (report by Pete Seebach). + corrected askuser() logic in tset (patch by Remco Treffkorn). + correct interaction of endwin() with mouse processing (report by Michael Elkins). + added trace support for TTY flags + update terminfo.src to 9.13.1 + FreeBSD console entries (patch by Andrew Chernov). 960406 + fixes for NeXT, ISC and HPUX auto-configure + autogenerate development header-dependencies (config.h, *.priv.h) + corrected single-column formatting of "use=" (e.g., in tic) + modify tic to read full terminfo-names + corrected divide-by-zero that caused hang (or worse) when redirecting output + modify tic to generate directories only as-needed (and corrected instance of use of data from function that had already returned). ### ncurses-1.9.8a -> 1.9.9e * fixed broken wsyncup()/wysncdown(), as a result wnoutrefresh() now has copy-changed-lines behavior. * added and documented wresize() function. * more fixes to LOWER-RIGHT corner handling. * changed the line-breakout optimization code to allow some lines to be emitted before the first check. * added option for tic to use symbolic instead of hard links (for AFS) * fix to restore auto-wrap mode. * trace level can be controlled by environment variable. * better handling of NULs in terminal descriptions. * improved compatibility with observed SVR4 behavior. * the refresh behavior of over-lapping windows is now more efficient and behaves like SVR4. * use autoconf 2.7, which results in a working setup for SCO 5.0. * support for ESCDELAY. * small fixes for menu/form code. * the test directory has its own configure. * fixes to pads when optimizing scrolling. * fixed several off-by-one bugs. * fixes for termcap->terminfo translation; less restrictions more correct behavior. ### ncurses-1.9.7 -> 1.9.8a * teach infocmp -i to recognize ECMA highlight sequences * infocmp now dumps all SVr4 termcaps (not just the SVr4 ones) on -C * support infocmp -RBSD. * satisfy XSI Curses requirement that every macro be available as a function. * This represents the last big change to the public interface of ncurses. The ABI_VERSION has now been set at 3.0 and should stay there barring any great catastrophies or acts of God. * The C++ has been cleaned up in reaction to the changes to satisfy XSI's requirements. * libncurses now gets linked to libcurses to help seamless emulation (replacement) of a vendor's curses. --disable-overwrite turns this behavior off. ### ncurses-1.9.6 -> 1.9.7 * corrected return values of setupterm() * Fixed some bugs in tput (it does padding now) * fixed a bug in tic that made it do the wrong thing on entries with more than one `use' capability. * corrected the screen-size calculation at startup time to alter the numeric capabilities as per SVr4, not just LINES and COLS. * toe(1) introduced; does what infocmp -T used to. * tic(1) can now translate AIX box1 and font[0123] capabilities. * tic uses much less core, the dotic.sh kluge can go away now. * fix read_entry() and write_entry() to pass through cancelled capabilities OK. * Add $HOME/.terminfo as source/target directory for terminfo entries. * termcap compilation now automatically dumps an entry to $HOME/.terminfo. * added -h option to toe(1). * added -R option to tic(1) and infocmp(1). * added fallback-entry-list feature. * added -i option to infocmp(1). * do a better job at detecting if we're on SCO. ### ncurses-1.9.5 -> 1.9.6 * handling of TERMCAP environment variables now works correctly. * various changes to shorten termcap translations to less that 1024 chars. * tset(1) added * mouse support for xterm. * most data tables are now const and accordingly live in shareable text space. * Obey the XPG4/SVr4 practice that echo() is initally off. * tic is much better at translating XENIX and AIX termcap entries now. * tic can interpret ko capabilities now. * integrated Juergen Pfeifer's forms library. * taught write_entry() how not to write more than it needs to; this change reduces the size of the terminfo tree by a full 26%! * infocmp -T option added. * better warnings about historical tic quirks from tic. ### ncurses 1.9.4 -> 1.9.5 * menus library is now included with documentation. * lib_mvcur has been carefully profiled and tuned. * Fixed a ^Z-handling bug that was tanking lynx(1). * HJ Lu's patches for ELF shared libraries under Linux * terminfo.src 9.8.2 * tweaks for compiling in seperate directories. * Thomas Dickey's patches to support NeXT's brain-dead linker * Eric Raymond's patches to fix problems with long termcap entries. * more support for shared libraries under SunOS and IRIX. ### ncurses 1.9.3 -> 1.9.4 * fixed an undefined-order-of-evaluation bug in lib_acs.c * systematically gave non-API public functions and data an _nc_ prefix. * integrated Juergen Pfeifer's menu code into the distribution. * totally rewrote the knight test game's interface ### ncurses 1.9.2c -> 1.9.3 * fixed the TERMCAP_FILE Support. * fixed off-by-one errors in scrolling code * added tracemunch to the test tools * took steps to cut the running time of make install.data ### ncurses 1.9.2c -> 1.9.2d * revised 'configure' script to produce libraries for normal, debug, profile and shared object models. ### ncurses 1.9.1 -> 1.9.2 * use 'autoconf' to implement 'configure' script. * panels support added * tic now checks for excessively long termcap entries when doing translation * first cut at eliminating namespace pollution. ### ncurses 1.8.9 -> 1.9 * cleanup gcc warnings for the following: use size_t where 'int' is not appropriate, fixed some shadowed variables, change attr_t to compatible with chtype, use attr_t in some places where it was confused with 'int'. * use chtype/attr_t casts as appropriate to ensure portability of masking operations. * added-back waddchnstr() to lib_addstr.c (it had been deleted). * supplied missing prototypes in curses.h * include in lib_termcap.c to ensure that the prototypes are consistent (they weren't). * corrected prototype of tputs in * rewrote varargs parsing in lib_tparm.c (to avoid referencing memory that may be out of bounds on the stack) -- Purify found this. * ensure that TRACE is defined in lib_trace.c (to solve prototype warnings from gcc). * corrected scrolling-region size in 'mvcur_wrap()' * more spelling fixes * use 'calloc()' to allocate WINDOW struct in lib_newwin.c (Purify). * set default value for SP->_ofp in lib_set_term.c (otherwise SunOS dumps core in init_acs()). * include in write_entry.c (most "braindead" includes declare errno in that file). ### ncurses 1.8.8 -> 1.8.9 * compile (mostly) clean with gcc 2.5.8 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wconversion and using __attribute__ to flush out non-portable use of "%x" for pointers, or for chtype data (which is declared as a long). * modified doupdate to ensure that typahead was turned on before attempting select-call (otherwise, some implementations hang). * added trace mask TRACE_FIFO, use this in lib_getch.c to allow finer resolution of traces. * improved bounds checking on several critical functions. * the data directory has been replaced by the new master terminfo file. * -F file-comparison option added to infocmp. * compatibility with XSI Curses is now documented in the man bages. * wsyncup/wsyncdown functions are reliable now; subwindow code in general is much less flaky. * capabilities ~msgr, tilde_glitch, insert_padding, generic_type, no_pad_char, memory_above, memory_below, and hard_copy are now used properly. * cursor-movement optimization has been completely rewritten. * vertical-movement optimization now uses hardware scrolling, il, dl. ### ncurses 1.8.7 -> 1.8.8 * untic no longer exists, infocmp replaces it. * tic can understand termcap now, especially if it is called captoinfo. * The Linux Standard Console terminfo entry is called linux insead of console. It also uses the kernel's new method of changing charsets. * initscr() will EXIT upon error (as the docs say) This wil mostly happen if you try to run on an undefined terminal. * I can get things running on AIX but tic can't compile terminfo. I have to compile entries on another machine. Volunteers to hunt this bug are welcome. * wbkgd() and wbkgdset() can be used to set a windows background to color. wclear()/werase() DO NOT use the current attribute to clear the screen. This is the way SVR4 curses works. PDCurses 2.1 is broken in this respect, though PDCurses 2.2 has been fixed. * cleaned up the test/ directory. * test/worm will segfault after quite a while. * many spelling corrections courtesy of Thomas E. Dickey ### ncurses 1.8.6 -> 1.8.7 * cleaned up programs in test/ directory. * fixed wbkgdset() macro. * modified getstr() to stop it from advancing cursor in noecho mode. * modified linux terminfo entry to work with the latest kernel to get the correct alternate character set. * also added a linux-mono entry for those running on monochrome screens. * changed initscr() so that it behaves like the man page says it does. this fixes the problem with programs in test/ crashing with SIGSEV if a terminal is undefined. * modified addch() to avoid using any term.h #define's * removed duplicate tgoto() in lib_tparm.c * modified dump_entry.c so that infocmp deals correctly with ',' in acsc * modified delwin() to correctly handle deleting subwindows. * fixed Makefile.dist to stop installing an empty curses.h * fixed a couple of out-of-date notes in man pages. ### ncurses 1.8.5 -> 1.8.6 * Implemented wbkgd(), bkgd(), bkgdset(), and wbkgdset(). * The handling of attributes has been improved and now does not turn off color if other attributes are turned off. * scrolling code is improved. Scrolling in subwindows is still broken. * Fixes to several bugs that manifest them on platforms other than Linux. * The default to meta now depends on the status of the terminal when ncurses is started. * The interface to the tracing facility has changed. Instead of the pair of functions traceon() and traceoff(), there is just one function trace() which takes a trace mask argument. The trace masks, defined in curses.h, are as follows: #define TRACE_DISABLE 0x00 /* turn off tracing */ #define TRACE_ORDINARY 0x01 /* ordinary trace mode */ #define TRACE_CHARPUT 0x02 /* also trace all character outputs */ #define TRACE_MAXIMUM 0x0f /* maximum trace level */ More trace masks may be added, or these may be changed, in future releases. * The pad code has been improved and the pad test code in test/ncurses.c has been improved. * The prototype ansi entry has been changed to work with a wider variety of emulators. * Fix to the prototype ansi entry that enables it to work with PC emulators that treat trailing ";m" in a highlight sequence as ";0m"; this doesn't break operation with any emulators. * There are now working infocmp, captoinfo, tput, and tclear utilities. * tic can now compile entries in termcap syntax. * Core-dump bug in pnoutrefresh fixed. * We now recognize and compile all the nonstandard capabilities in Ross Ridge's mytinfo package (rendering it obsolete). * General cleanup and documentation improvements. * Fixes and additions to the installation-documentation files. * Take cursor to normal mode on endwin. ### ncurses 1.8.4 -> 1.8.5 * serious bugs in updating screen which caused erratic non-display, fixed. * fixed initialization for getch() related variable which cause unpredictable results. * fixed another doupdate bug which only appeared if you have parm_char. * implemented redrawln() and redrawwin(). * implemented winsnstr() and related functions. * cleaned up insertln() and deleteln() and implemented (w)insdeln(). * changed Makefile.dist so that installation of man pages will take note of the terminfo directory. * fixed Configure (removed the mysterious 'X'). * Eric S. Raymond fixed the script.* files so that they work with stock awk. #### ncurses 1.8.3 -> 1.8.4 #### #### * fixed bug in refreshing the screen after return from shell_mode. There are still problems but they don't manifest themselves on my machine (Linux 0.99.14f). * added wgetnstr() and modified things accordingly. * fixed the script.src script.test to work with awk not just gawk. * Configure can now take an argument of the target system. * added test/ncurses.c which replaces several other programs and performs more testing. [Thanks to Eric S Raymond for the last 4] * more fixes to lib_overlay.c and added test/over.c to illustrate how it works. * fixed ungetch() to take int instead of ch. * fixes to cure wgetch() if flushinp() is called. One note I forgot to mention in 1.8.3 is that tracing is off by default starting in the version. If you want tracing output, put traceon(); in your code and link with -ldcurses. #### ncurses 1.8.2 -> ncurses 1.8.3 #### #### MAJOR CHANGES: 1) The order of capabilities has been changed in order to achieve binary compatibility with SVR4 terminfo database. This has the unfortunate effect of breaking application currently linked with ncurses. To ensure correct behavior, recompile all such programs. Most programs using color or newer capabilities will break, others will probably continue to work ok. 2) Pavel Curtis has renounced his copyright to the public domain. This means that his original sources (posted to comp.sources.unix, volume 1) are now in the public domain. The current sources are NOT in the public domain, they are copyrighted by me. I'm entertaining ideas on what the new terms ncurses is released under. 3) Eric S. Raymond has supplied a complete set of man pages for ncurses in ?roff format. They will eventually replace most of the current docs. Both sets are included in this release. Other changes and notes from 1.8.2 include: * SIGSEGV during scrolling no longer occurs. * Other problems with scrolling and use of idl have been corrected. * lib_getch.c has been re-written and should perform flawlessly. please use test/getch.c and any other programs to test this. * ripoffline() is implemented (Thanks to Eric) and slk_ functions changed accordingly. * I've added support for terminals that scroll if you write in the bottom-right corner. * fixed more bugs in pads code. If anybody has a program that uses pads I'd love a copy. * correct handling for terminal with back_color_erase capability (such as Linux console, and most PC terminals) * ^Z handling apparently didn't work (I should never trust code sent me to me without extensive testing). It now seems to be fixed. Let me know if you have problems. * I've added support for Apollo and NeXT, but it may still be incomplete, especially when dealing with the lack of POSIX features. * scrolling should be more efficient on terminals with idl capabilities. Please see src/lib_scroll.c for more notes. * The line drawing routines were offset by 1 at both ends. This is now fixed. * added a few missing prototypes and macros (e.g. setterm()) * fixed code in src/lib_overlay.c which used to crash. * added a few more programs in test/ The ones from the PDCurses package are useful, especially if you have SVR4 proper. I'm interested in the results you get on such a systems (Eric? ;-). They already exposed certain bugs in ncurses. * See src/README for porting notes. * The C++ code should really replace ncurses.h instead of working around it. It should avoid name-space clashes with nterm.h (use rows instead of lines, etc.) * The C++ should compile ok. I've added explicit rules to the Makefile because no C++ defaults are documented on the suns. * The docs say that echo() and nocbreak() are mutually exclusive. At the moment ncurses will switch to cbreak() if the case above occurs. Should it continue to do so? How about echo() and noraw()? * PDCurses seem to assume that wclear() will use current attribute when clearing the screen. According to Eric this is not the case with SVR4. * I have discovered, to my chagrin, SunOS 4.x (and probably other systems) * doesn't have vsscanf and God knows what else! I've will do a vsscanf(). * I've also found out that the src/script.* rely on gawk and will not work with stock awk or even with nawk. Any changes are welcome. * Linux is more tolerant of NULL dereferences than most systems. This fact was exposed by hanoi. * ncurses still seems inefficient in drawing the screen on a serial link between Linux and suns. The padding may be the culprit. * There seems to be one lingering problem with doupdate() after shelling out. Despite the fact the it is sending out the correct information to the terminal, nothing takes effect until you press ^L or another refresh takes place. And yes, output does get flushed. #### ncurses 1.8.1 -> ncurses 1.8.2 #### Nov 28, 1993 #### * added support for SVR4 and BSDI's BSD/386. * major update and fix to scrolling routine. * MORE fixes to stuff in lib_getch.c. * cleaned-up configuration options and can now generate Config.* files through an awk script. * changed setupterm() so it can be called more than once, add added set_curterm(), del_curterm(). * a few minor cleanups. * added more prototypes in curses.h #### ncurses 1.8 -> ncurses 1.8.1 #### Nov 4, 1993 #### * added support for NeXTStep 3.0 * added termcap emulation (not well tested). * more complete C++ interface to ncurses. * fixed overlay(), overwrite(), and added copywin(). * a couple of bug fixes. * a few code cleanups. #### ncurses 0.7.2/0.7.3 -> ncurses 1.8 #### Aug 31, 1993 #### * The annoying message "can't open file." was due to missing terminfo entry for the used terminal. It has now been replaced by a hopefully more helpful message. * Problems with running on serial lines are now fixed. * Added configuration files for SunOS, Linux, HP/UX, Ultrix, 386bsd/BSDI (if you have others send'em to me) * Cleaner Makefile. * The documentation in manual.doc is now more uptodate. * update optimization and support for hp terminals, and 386bsd console driver(s). * mvcur optimization for terminals without cursor addressing (doesn't work on Linux) * if cursor moved since last update, getch() will refresh the screen before working. * getch() & alarm() can now live together. in 0.7.3 a signal interrupted getch() (bug or feature?) now the getch is restarted. * scanw() et all were sick, now fixed. * support for 8-bit input (use meta()). * added default screen size to all terminfos. * added c++ Ncursesw class. * several minor bug fixes. #### ncurses 0.7.2 -> ncurses 0.7.3 #### May 27, 1993 #### * Config file to cope with different platforms (386BSD, BSDI, Ultrix, SunOS) * more fixes to lib_getch.c * changes related to Config #### ncurses 0.7 -> ncurses 0.7.2 #### May 22, 1993 #### * docs updated slightly (color usage is now documented). * yet another fix for getch(), this one fixes problems with ESC being swallowed if another character is typed before the 1 second timeout. * Hopefully, addstr() and addch() are 8-bit clean. * fixed lib_tparm.c to use stdarg.h (should run on suns now) * order of capabilities changed to reflect that specified in SYSV this will allow for binary-compatibility with existing terminfo dbs. * added halfdelay() * fixed problems with asc_init() * added A_PROTECT and A_INVIS * cleaned up vidputs() * general cleanup of the code * more attention to portability to other systems * added terminfos for hp70092 (wont work until changes to lib_update.c are made) and 386BSD pcvt drivers. Thanks to Hellmuth Michaelis for his help. optimization code is slated for the next major release, stay tuned! #### ncurses 0.6/0.61 -> ncurses 0.7 #### April 1, 1993 Please note that the next release will be called 1.8. If you want to know about the rationale drop me a line. Included are several test programs in test/. I've split up the panels library, reversi, tetris, sokoban. They are now available separately from netcom.com:pub/zmbenhal/ * color and ACS support is now fully compatible with SYSV at the terminfo level. * Capabilities now includes as many SYSV caps I could find. * tigetflag,tigetnum,tigetstr functions added. * boolnames, boolfnames, boolcodes numnames, numfnames, numcodes, strnames, strfnames, strcodes arrays are now added. * keyname() is added. * All function keys can be defined in terminfo entries. * fixed lin_tparm.c to behave properly. * terminfo entries for vt* and xterm are included (improvements are welcome) * more automation in handling caps and keys. * included fixes from 0.6.1 * added a few more missing functions. * fixed a couple of minor bugs. * updated docs JUST a little (still miles behind in documenting the newer features). #### ncurses 0.6 -> ncurses 0.61 #### 1) Included the missing data/console. 2) allow attributes when drawing boxes. 3) corrected usage of win->_delay value. 4) fixed a bug in lib_getch.c. if it didn't recognize a sequence it would simply return the last character in the sequence. The correct behavior is to return the entire sequence one character at a time. #### ncurses0.5 -> ncurses0.6 #### March 1, 1993 #### * removed _numchngd from struct _win_st and made appropriate changes. * rewritten kgetch() to remove problems with interaction between alarm and read(). It caused SIGSEGV every now and then. * fixed a bug that miscounted the numbers of columns when updating. (in lib_doupdate.c(ClrUpdate() -- iterate to columns not columns-1) * fixed a bug that cause the lower-right corner to be incorrect. (in lib_doupdate.c(putChar() -- check against columns not columns-1) * made resize() and cleanup() static to lib_newterm.c * added notimeout(). * added timeout() define in curses.h * added more function prototypes and fixed napms. * added use_env(). * moved screen size detection to lib_setup.c. * fixed newterm() to confirm to prototype. * removed SIGWINCH support as SYSV does not define its semantics. * cleaned-up lib_touch.c * added waddnstr() and relatives. * added slk_* support. * fixed a bug in wdeleteln(). * added PANEL library. * modified Makefile for smoother installation. * terminfo.h is really term.h #### ncurses 0.4 -> ncurses 0.5 #### Feb 14, 1993 #### * changed _win_st structure to allow support for missing functionality. * Addition of terminfo support for all KEY_*. * Support for nodelay(), timeout(), notimeout(). * fixed a bug with the keypad char reading that did not return ESC until another key is pressed. * nl mapping no longer occur on output (as should be) fixed bug '\n' no causing a LF. * fixed bug that reset terminal colors regardless of whether we use color or not. * Better support for ACS (not quite complete). * fixed bug in wvline(). * added curs_set(). * changed from signal() to sigaction(). * re-included the contents of important.patch into source. #### ncurses 0.3 -> ncurses 0.4 #### Feb 3, 1993 #### * Addition of more KEY_* definitions. * Addition of function prototypes. * Addition of several missing functions. * No more crashes if screen size is undefined (use SIGWINCH handler). * added a handler to cleanup after SIGSEGV (hopefully never needed). * changed SRCDIR from /etc/term to /usr/lib/terminfo. * renamed compile/dump to tic/untic. * New scrolling code. * fixed bug that reversed the sense of nl() and nonl(). #### ncurses 0.2 -> ncurses 0.3 #### Jan 20, 1993 #### * more support for color and graphics see test/ for examples. * fixed various files to allow correct update after shelling out. * more fixes for updates. * no more core dumps if you don't have a terminfo entry. * support for LINES and COLUMNS environment variables. * support for SIGWINCH signal. * added a handler for SIGINT for clean exits. #### ncurses 0.1 -> ncurses 0.2 #### Aug 14, 1992 #### * support for color. * support for PC graphic characters. * lib_trace.c updated to use stdarg.h and vprintf routines. * added gdc.c (Great Digital Clock) as an example of using color. #### ncurses -> ncurses 0.1 #### Jul 31, 1992 #### * replacing sgtty stuff by termios stuff. * ANSIfication of some functions. * Disabling cost analysis 'cause it's incorrect. * A quick hack for a terminfo entry. -- vile:txtmode: AdaCurses-20170708/configure0000755000175100001440000151474613054421655014313 0ustar tomusers#! /bin/sh # From configure.in Revision: 1.62 . # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20150926. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} ac_unique_file="gen/gen.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${datarootdir}/info' mandir='${datarootdir}/man' # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. build=$build_alias host=$host_alias target=$target_alias # FIXME: should be removed in autoconf 3.0. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat < if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. EOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue cd $ac_subdir # A "../" for each directory in /$ac_subdir. ac_dots=`echo $ac_subdir | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` case $srcdir in .) # No --srcdir option. We are building in place. ac_sub_srcdir=$srcdir ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_sub_srcdir=$srcdir/$ac_subdir ;; *) # Relative path. ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; esac # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_sub_srcdir/configure.gnu; then echo $SHELL $ac_sub_srcdir/configure.gnu --help=recursive elif test -f $ac_sub_srcdir/configure; then echo $SHELL $ac_sub_srcdir/configure --help=recursive elif test -f $ac_sub_srcdir/configure.ac || test -f $ac_sub_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\EOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. EOF exit 0 fi exec 5>config.log cat >&5 </dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` PATH = $PATH _ASUNAME } >&5 cat >&5 <\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" ac_sep=" " ;; esac # Get rid of the leading space. done # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. trap 'exit_status=$? # Save into config.log some information that might help in debugging. echo >&5 echo "## ----------------- ##" >&5 echo "## Cache variables. ##" >&5 echo "## ----------------- ##" >&5 echo >&5 # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } >&5 sed "/^$/d" confdefs.h >conftest.log if test -s conftest.log; then echo >&5 echo "## ------------ ##" >&5 echo "## confdefs.h. ##" >&5 echo "## ------------ ##" >&5 echo >&5 cat conftest.log >&5 fi (echo; echo) >&5 test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" >&5 echo "$as_me: exit $exit_status" >&5 rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:931: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} cat "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:942: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:950: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:966: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:970: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:976: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:978: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:980: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. It doesn't matter if # we pass some twice (in addition to the command line arguments). if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:999: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:1001: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C= # newlines do not sed ;-) only broken shells would use this case anyway ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if { (echo "$as_me:1022: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? echo "$as_me:1025: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else ac_path_separator=: fi PATH_SEPARATOR="$ac_path_separator" rm -f conftest.sh ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin" top_builddir=`pwd` ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:1055: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:1065: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:1069: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:1078: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:1082: error: $ac_config_sub $ac_cv_build_alias failed." >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1087: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:1094: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:1103: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1108: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then echo "$as_me:1116: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_target_alias=$target_alias test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || { { echo "$as_me:1125: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1130: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" if test -z "$system_name" ; then system_name="`(hostname) 2>/dev/null`" fi fi test -n "$system_name" && cat >>confdefs.h <&6 else cf_cv_system_name="$system_name" fi test -z "$system_name" && system_name="$cf_cv_system_name" test -n "$cf_cv_system_name" && echo "$as_me:1162: result: Configuring for $cf_cv_system_name" >&5 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6 if test ".$system_name" != ".$cf_cv_system_name" ; then echo "$as_me:1166: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6 { { echo "$as_me:1168: error: \"Please remove config.cache and try again.\"" >&5 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;} { (exit 1); exit 1; }; } fi # Check whether --with-system-type or --without-system-type was given. if test "${with_system_type+set}" = set; then withval="$with_system_type" { echo "$as_me:1176: WARNING: overriding system type to $withval" >&5 echo "$as_me: WARNING: overriding system type to $withval" >&2;} cf_cv_system_name=$withval host_os=$withval fi; ### Save the given $CFLAGS to allow user-override. cf_user_CFLAGS="$CFLAGS" ### Default install-location echo "$as_me:1188: checking for prefix" >&5 echo $ECHO_N "checking for prefix... $ECHO_C" >&6 if test "x$prefix" = "xNONE" ; then case "$cf_cv_system_name" in # non-vendor systems don't have a conflict (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*) prefix=/usr ;; (*) prefix=$ac_default_prefix ;; esac fi echo "$as_me:1200: result: $prefix" >&5 echo "${ECHO_T}$prefix" >&6 if test "x$prefix" = "xNONE" ; then echo "$as_me:1204: checking for default include-directory" >&5 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6 test -n "$verbose" && echo 1>&6 for cf_symbol in \ $includedir \ $includedir/ncurses \ $prefix/include \ $prefix/include/ncurses \ /usr/local/include \ /usr/local/include/ncurses \ /usr/include \ /usr/include/ncurses do cf_dir=`eval echo $cf_symbol` if test -f $cf_dir/curses.h ; then if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then includedir="$cf_symbol" test -n "$verbose" && echo $ac_n " found " 1>&6 break fi fi test -n "$verbose" && echo " tested $cf_dir" 1>&6 done echo "$as_me:1227: result: $includedir" >&5 echo "${ECHO_T}$includedir" >&6 fi ### Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return if test -n "$ac_tool_prefix"; then for ac_prog in gnatgcc gcc cc do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:1244: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:1259: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1267: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1270: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in gnatgcc gcc cc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1283: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:1298: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1306: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1309: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi test -z "$CC" && { { echo "$as_me:1319: error: no acceptable cc found in \$PATH" >&5 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:1324:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:1327: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:1330: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1332: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:1335: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1337: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:1340: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line 1344 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:1360: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:1363: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:1366: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. for ac_file in `ls a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1389: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:1395: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1400: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:1406: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1409: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:1416: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:1424: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1431: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:1433: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:1436: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 if { (eval echo "$as_me:1438: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:1441: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:1457: error: cannot compute EXEEXT: cannot compile and link" >&5 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:1463: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:1469: checking for object suffix" >&5 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1475 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:1487: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1490: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1502: error: cannot compute OBJEXT: cannot compile" >&5 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:1509: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:1513: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1519 "configure" #include "confdefs.h" int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1534: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1537: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1540: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1543: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:1555: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:1561: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1567 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1579: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1582: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1585: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1588: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:1598: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1625: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1628: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1631: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1634: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line 1646 "configure" #include "confdefs.h" #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1659: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1662: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1665: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1668: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 1678 "configure" #include "confdefs.h" $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1690: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1693: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1696: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1699: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -rf conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return GCC_VERSION=none if test "$GCC" = yes ; then echo "$as_me:1729: checking version of $CC" >&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown echo "$as_me:1733: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi echo "$as_me:1737: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line 1745 "configure" #include "confdefs.h" #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:1794: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1797: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1800: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1803: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:1820: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:1823: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # This should have been defined by AC_PROG_CC : ${CC:=cc} echo "$as_me:1831: checking \$CC variable" >&5 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6 case "$CC" in (*[\ \ ]-*) echo "$as_me:1835: result: broken" >&5 echo "${ECHO_T}broken" >&6 { echo "$as_me:1837: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;} # humor him... cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'` cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'` CC="$cf_prog" for cf_arg in $cf_flags do case "x$cf_arg" in (x-[IUDfgOW]*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_arg do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi ;; (*) CC="$CC $cf_arg" ;; esac done test -n "$verbose" && echo " resulting CC: '$CC'" 1>&6 echo "${as_me:-configure}:1954: testing resulting CC: '$CC' ..." 1>&5 test -n "$verbose" && echo " resulting CFLAGS: '$CFLAGS'" 1>&6 echo "${as_me:-configure}:1958: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5 test -n "$verbose" && echo " resulting CPPFLAGS: '$CPPFLAGS'" 1>&6 echo "${as_me:-configure}:1962: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5 ;; (*) echo "$as_me:1966: result: ok" >&5 echo "${ECHO_T}ok" >&6 ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return echo "$as_me:1977: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line 1998 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2003: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2009: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 2032 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2036: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2042: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:2079: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line 2089 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2094: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2100: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 2123 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2127: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2133: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:2161: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:2174: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF #line 2181 "configure" #include "confdefs.h" #include int Autoconf = TIOCGETP; _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -rf conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF #line 2196 "configure" #include "confdefs.h" #include int Autoconf = TCGETA; _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -rf conftest* fi fi echo "$as_me:2209: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi echo "$as_me:2216: checking whether $CC understands -c and -o together" >&5 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6 if test "${cf_cv_prog_CC_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.$ac_ext <&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2234: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (eval echo "$as_me:2236: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2239: \$? = $ac_status" >&5 (exit $ac_status); }; then eval cf_cv_prog_CC_c_o=yes else eval cf_cv_prog_CC_c_o=no fi rm -rf conftest* fi if test $cf_cv_prog_CC_c_o = yes; then echo "$as_me:2250: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:2253: result: no" >&5 echo "${ECHO_T}no" >&6 fi test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:2274: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_AWK="$ac_prog" echo "$as_me:2289: found $ac_dir/$ac_word" >&5 break done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:2297: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:2300: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done test -z "$AWK" && { { echo "$as_me:2307: error: No awk program found" >&5 echo "$as_me: error: No awk program found" >&2;} { (exit 1); exit 1; }; } echo "$as_me:2311: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:2321: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep test -z "$EGREP" && { { echo "$as_me:2325: error: No egrep program found" >&5 echo "$as_me: error: No egrep program found" >&2;} { (exit 1); exit 1; }; } # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:2341: checking for a BSD compatible install" >&5 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_IFS=$IFS; IFS=$ac_path_separator for ac_dir in $PATH; do IFS=$ac_save_IFS # Account for people who put trailing slashes in PATH elements. case $ac_dir/ in / | ./ | .// | /cC/* \ | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ | /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if $as_executable_p "$ac_dir/$ac_prog"; then if test $ac_prog = install && grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:2390: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:2401: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:2405: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:2408: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:2412: checking if $LN_S -f options work" >&5 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6 rm -f conf$$.src conf$$dst echo >conf$$.dst echo first >conf$$.src if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then cf_prog_ln_sf=yes else cf_prog_ln_sf=no fi rm -f conf$$.dst conf$$src echo "$as_me:2424: result: $cf_prog_ln_sf" >&5 echo "${ECHO_T}$cf_prog_ln_sf" >&6 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" echo "$as_me:2429: checking for long file names" >&5 echo $ECHO_N "checking for long file names... $ECHO_C" >&6 if test "${ac_cv_sys_long_file_names+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_long_file_names=yes # Test for long file names in all the places we know might matter: # . the current directory, where building will happen # $prefix/lib where we will be installing things # $exec_prefix/lib likewise # eval it to expand exec_prefix. # $TMPDIR if set, where it might want to write temporary files # if $TMPDIR is not set: # /tmp where it might want to write temporary files # /var/tmp likewise # /usr/tmp likewise if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then ac_tmpdirs=$TMPDIR else ac_tmpdirs='/tmp /var/tmp /usr/tmp' fi for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do test -d $ac_dir || continue test -w $ac_dir || continue # It is less confusing to not echo anything here. ac_xdir=$ac_dir/cf$$ (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue ac_tf1=$ac_xdir/conftest9012345 ac_tf2=$ac_xdir/conftest9012346 (echo 1 >$ac_tf1) 2>/dev/null (echo 2 >$ac_tf2) 2>/dev/null ac_val=`cat $ac_tf1 2>/dev/null` if test ! -f $ac_tf1 || test "$ac_val" != 1; then ac_cv_sys_long_file_names=no rm -rf $ac_xdir 2>/dev/null break fi rm -rf $ac_xdir 2>/dev/null done fi echo "$as_me:2468: result: $ac_cv_sys_long_file_names" >&5 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 if test $ac_cv_sys_long_file_names = yes; then cat >>confdefs.h <<\EOF #define HAVE_LONG_FILE_NAMES 1 EOF fi # if we find pkg-config, check if we should install the ".pc" files. echo "$as_me:2480: checking if you want to use pkg-config" >&5 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6 # Check whether --with-pkg-config or --without-pkg-config was given. if test "${with_pkg_config+set}" = set; then withval="$with_pkg_config" cf_pkg_config=$withval else cf_pkg_config=yes fi; echo "$as_me:2490: result: $cf_pkg_config" >&5 echo "${ECHO_T}$cf_pkg_config" >&6 case $cf_pkg_config in (no) PKG_CONFIG=none ;; (yes) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 echo "$as_me:2502: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word" echo "$as_me:2519: found $ac_dir/$ac_word" >&5 break fi done ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then echo "$as_me:2530: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6 else echo "$as_me:2533: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo "$as_me:2542: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word" echo "$as_me:2559: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none" ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then echo "$as_me:2571: result: $ac_pt_PKG_CONFIG" >&5 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 else echo "$as_me:2574: result: no" >&5 echo "${ECHO_T}no" >&6 fi PKG_CONFIG=$ac_pt_PKG_CONFIG else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi ;; (*) PKG_CONFIG=$withval ;; esac test -z "$PKG_CONFIG" && PKG_CONFIG=none if test "$PKG_CONFIG" != none ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".$PKG_CONFIG" in (.\$\(*\)*|.\'*\'*) ;; (..|./*|.\\*) ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX ;; (.\${*prefix}*|.\${*dir}*) eval PKG_CONFIG="$PKG_CONFIG" case ".$PKG_CONFIG" in (.NONE/*) PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (.no|.NONE/*) PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%` ;; (*) { { echo "$as_me:2617: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;} { (exit 1); exit 1; }; } ;; esac elif test "x$cf_pkg_config" != xno ; then { echo "$as_me:2624: WARNING: pkg-config is not installed" >&5 echo "$as_me: WARNING: pkg-config is not installed" >&2;} fi case $PKG_CONFIG in (no|none|yes) echo "$as_me:2630: checking for pkg-config library directory" >&5 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6 ;; (*) echo "$as_me:2634: checking for $PKG_CONFIG library directory" >&5 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6 ;; esac PKG_CONFIG_LIBDIR=no # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given. if test "${with_pkg_config_libdir+set}" = set; then withval="$with_pkg_config_libdir" PKG_CONFIG_LIBDIR=$withval else test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes fi; case x$PKG_CONFIG_LIBDIR in (x/*) ;; (xyes) # Look for the library directory using the same prefix as the executable if test "x$PKG_CONFIG" = xnone then cf_path=$prefix else cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'` fi # If you don't like using the default architecture, you have to specify the # intended library directory and corresponding compiler/linker options. # # This case allows for Debian's 2014-flavor of multiarch, along with the # most common variations before that point. Some other variants spell the # directory differently, e.g., "pkg-config", and put it in unusual places. # pkg-config has always been poorly standardized, which is ironic... case x`(arch) 2>/dev/null` in (*64) cf_search_path="\ $cf_path/lib/*64-linux-gnu \ $cf_path/share \ $cf_path/lib64 \ $cf_path/lib32 \ $cf_path/lib" ;; (*) cf_search_path="\ $cf_path/lib/*-linux-gnu \ $cf_path/share \ $cf_path/lib32 \ $cf_path/lib \ $cf_path/libdata" ;; esac test -n "$verbose" && echo " list..." 1>&6 echo "${as_me:-configure}:2689: testing list... ..." 1>&5 for cf_config in $cf_search_path do test -n "$verbose" && echo " checking $cf_config/pkgconfig" 1>&6 echo "${as_me:-configure}:2695: testing checking $cf_config/pkgconfig ..." 1>&5 if test -d $cf_config/pkgconfig then PKG_CONFIG_LIBDIR=$cf_config/pkgconfig echo "$as_me:2700: checking done" >&5 echo $ECHO_N "checking done... $ECHO_C" >&6 break fi done ;; (*) ;; esac if test "x$PKG_CONFIG_LIBDIR" != xno ; then echo "$as_me:2711: result: $PKG_CONFIG_LIBDIR" >&5 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6 fi echo "$as_me:2715: checking if you want to build test-programs" >&5 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6 # Check whether --with-tests or --without-tests was given. if test "${with_tests+set}" = set; then withval="$with_tests" cf_with_tests=$withval else cf_with_tests=yes fi; echo "$as_me:2725: result: $cf_with_tests" >&5 echo "${ECHO_T}$cf_with_tests" >&6 echo "$as_me:2728: checking if we should assume mixed-case filenames" >&5 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6 # Check whether --enable-mixed-case or --disable-mixed-case was given. if test "${enable_mixed_case+set}" = set; then enableval="$enable_mixed_case" enable_mixedcase=$enableval else enable_mixedcase=auto fi; echo "$as_me:2738: result: $enable_mixedcase" >&5 echo "${ECHO_T}$enable_mixedcase" >&6 if test "$enable_mixedcase" = "auto" ; then echo "$as_me:2742: checking if filesystem supports mixed-case filenames" >&5 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6 if test "${cf_cv_mixedcase+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes ; then case $target_alias in (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) cf_cv_mixedcase=no ;; (*) cf_cv_mixedcase=yes ;; esac else rm -f conftest CONFTEST echo test >conftest if test -f CONFTEST ; then cf_cv_mixedcase=no else cf_cv_mixedcase=yes fi rm -f conftest CONFTEST fi fi echo "$as_me:2769: result: $cf_cv_mixedcase" >&5 echo "${ECHO_T}$cf_cv_mixedcase" >&6 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF #define MIXEDCASE_FILENAMES 1 EOF else cf_cv_mixedcase=$enable_mixedcase if test "$enable_mixedcase" = "yes" ; then cat >>confdefs.h <<\EOF #define MIXEDCASE_FILENAMES 1 EOF fi fi # do this after mixed-case option (tags/TAGS is not as important as tic). echo "$as_me:2787: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:2807: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:2811: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi for ac_prog in exctags ctags do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:2820: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CTAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CTAGS"; then ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CTAGS="$ac_prog" echo "$as_me:2835: found $ac_dir/$ac_word" >&5 break done fi fi CTAGS=$ac_cv_prog_CTAGS if test -n "$CTAGS"; then echo "$as_me:2843: result: $CTAGS" >&5 echo "${ECHO_T}$CTAGS" >&6 else echo "$as_me:2846: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CTAGS" && break done for ac_prog in exetags etags do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:2857: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ETAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ETAGS"; then ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ETAGS="$ac_prog" echo "$as_me:2872: found $ac_dir/$ac_word" >&5 break done fi fi ETAGS=$ac_cv_prog_ETAGS if test -n "$ETAGS"; then echo "$as_me:2880: result: $ETAGS" >&5 echo "${ECHO_T}$ETAGS" >&6 else echo "$as_me:2883: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ETAGS" && break done # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args. set dummy ${CTAGS:-ctags}; ac_word=$2 echo "$as_me:2892: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKE_LOWER_TAGS"; then ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_LOWER_TAGS="yes" echo "$as_me:2907: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no" fi fi MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS if test -n "$MAKE_LOWER_TAGS"; then echo "$as_me:2916: result: $MAKE_LOWER_TAGS" >&5 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else echo "$as_me:2919: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$cf_cv_mixedcase" = yes ; then # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args. set dummy ${ETAGS:-etags}; ac_word=$2 echo "$as_me:2926: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKE_UPPER_TAGS"; then ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_UPPER_TAGS="yes" echo "$as_me:2941: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no" fi fi MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS if test -n "$MAKE_UPPER_TAGS"; then echo "$as_me:2950: result: $MAKE_UPPER_TAGS" >&5 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else echo "$as_me:2953: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAKE_UPPER_TAGS=no fi if test "$MAKE_UPPER_TAGS" = yes ; then MAKE_UPPER_TAGS= else MAKE_UPPER_TAGS="#" fi if test "$MAKE_LOWER_TAGS" = yes ; then MAKE_LOWER_TAGS= else MAKE_LOWER_TAGS="#" fi echo "$as_me:2973: checking for makeflags variable" >&5 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6 if test "${cf_cv_makeflags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_makeflags='' for cf_option in '-${MAKEFLAGS}' '${MFLAGS}' do cat >cf_makeflags.tmp </dev/null | fgrep -v "ing directory" | sed -e 's,[ ]*$,,'` case "$cf_result" in (.*k|.*kw) cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in (.*CC=*) cf_cv_makeflags= ;; (*) cf_cv_makeflags=$cf_option ;; esac break ;; (.-) ;; (*) echo "given option \"$cf_option\", no match \"$cf_result\"" ;; esac done rm -f cf_makeflags.tmp fi echo "$as_me:3007: result: $cf_cv_makeflags" >&5 echo "${ECHO_T}$cf_cv_makeflags" >&6 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:3013: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:3028: found $ac_dir/$ac_word" >&5 break done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:3036: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:3039: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:3048: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:3063: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:3072: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:3075: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. set dummy ${ac_tool_prefix}ld; ac_word=$2 echo "$as_me:3087: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LD"; then ac_cv_prog_LD="$LD" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_LD="${ac_tool_prefix}ld" echo "$as_me:3102: found $ac_dir/$ac_word" >&5 break done fi fi LD=$ac_cv_prog_LD if test -n "$LD"; then echo "$as_me:3110: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:3113: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_LD"; then ac_ct_LD=$LD # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo "$as_me:3122: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_LD"; then ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_LD="ld" echo "$as_me:3137: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld" fi fi ac_ct_LD=$ac_cv_prog_ac_ct_LD if test -n "$ac_ct_LD"; then echo "$as_me:3146: result: $ac_ct_LD" >&5 echo "${ECHO_T}$ac_ct_LD" >&6 else echo "$as_me:3149: result: no" >&5 echo "${ECHO_T}no" >&6 fi LD=$ac_ct_LD else LD="$ac_cv_prog_LD" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:3161: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:3176: found $ac_dir/$ac_word" >&5 break done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:3184: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:3187: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:3196: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_AR="ar" echo "$as_me:3211: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:3220: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:3223: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:3235: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:3250: found $ac_dir/$ac_word" >&5 break done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:3258: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:3261: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:3270: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_AR="ar" echo "$as_me:3285: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:3294: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:3297: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi echo "$as_me:3306: checking for options to update archives" >&5 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6 if test "${cf_cv_ar_flags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ar_flags=unknown for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv do # check if $ARFLAGS already contains this choice if test "x$ARFLAGS" != "x" ; then cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then cf_cv_ar_flags= break fi fi rm -f conftest.$ac_cv_objext rm -f conftest.a cat >conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3335: \$? = $ac_status" >&5 (exit $ac_status); } ; then echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null if test -f conftest.a ; then cf_cv_ar_flags=$cf_ar_flags break fi else test -n "$verbose" && echo " cannot compile test-program" 1>&6 echo "${as_me:-configure}:3346: testing cannot compile test-program ..." 1>&5 break fi done rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext fi echo "$as_me:3354: result: $cf_cv_ar_flags" >&5 echo "${ECHO_T}$cf_cv_ar_flags" >&6 if test -n "$ARFLAGS" ; then if test -n "$cf_cv_ar_flags" ; then ARFLAGS="$ARFLAGS $cf_cv_ar_flags" fi else ARFLAGS=$cf_cv_ar_flags fi echo "$as_me:3365: checking for PATH separator" >&5 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6 case $cf_cv_system_name in (os2*) PATH_SEPARATOR=';' ;; (*) ${PATH_SEPARATOR:=':'} ;; esac echo "$as_me:3372: result: $PATH_SEPARATOR" >&5 echo "${ECHO_T}$PATH_SEPARATOR" >&6 echo "$as_me:3375: checking if you have specified an install-prefix" >&5 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6 # Check whether --with-install-prefix or --without-install-prefix was given. if test "${with_install_prefix+set}" = set; then withval="$with_install_prefix" case "$withval" in (yes|no) ;; (*) DESTDIR="$withval" ;; esac fi; echo "$as_me:3388: result: $DESTDIR" >&5 echo "${ECHO_T}$DESTDIR" >&6 ############################################################################### # If we're cross-compiling, allow the user to override the tools and their # options. The configure script is oriented toward identifying the host # compiler, etc., but we need a build compiler to generate parts of the source. if test "$cross_compiling" = yes ; then # defaults that we might want to override : ${BUILD_CFLAGS:=''} : ${BUILD_CPPFLAGS:=''} : ${BUILD_LDFLAGS:=''} : ${BUILD_LIBS:=''} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} # Check whether --with-build-cc or --without-build-cc was given. if test "${with_build_cc+set}" = set; then withval="$with_build_cc" BUILD_CC="$withval" else for ac_prog in gcc cc cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:3416: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_BUILD_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$BUILD_CC"; then ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_BUILD_CC="$ac_prog" echo "$as_me:3431: found $ac_dir/$ac_word" >&5 break done fi fi BUILD_CC=$ac_cv_prog_BUILD_CC if test -n "$BUILD_CC"; then echo "$as_me:3439: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 else echo "$as_me:3442: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$BUILD_CC" && break done fi; echo "$as_me:3450: checking for native build C compiler" >&5 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6 echo "$as_me:3452: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 echo "$as_me:3455: checking for native build C preprocessor" >&5 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6 # Check whether --with-build-cpp or --without-build-cpp was given. if test "${with_build_cpp+set}" = set; then withval="$with_build_cpp" BUILD_CPP="$withval" else BUILD_CPP='${BUILD_CC} -E' fi; echo "$as_me:3465: result: $BUILD_CPP" >&5 echo "${ECHO_T}$BUILD_CPP" >&6 echo "$as_me:3468: checking for native build C flags" >&5 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6 # Check whether --with-build-cflags or --without-build-cflags was given. if test "${with_build_cflags+set}" = set; then withval="$with_build_cflags" BUILD_CFLAGS="$withval" fi; echo "$as_me:3476: result: $BUILD_CFLAGS" >&5 echo "${ECHO_T}$BUILD_CFLAGS" >&6 echo "$as_me:3479: checking for native build C preprocessor-flags" >&5 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6 # Check whether --with-build-cppflags or --without-build-cppflags was given. if test "${with_build_cppflags+set}" = set; then withval="$with_build_cppflags" BUILD_CPPFLAGS="$withval" fi; echo "$as_me:3487: result: $BUILD_CPPFLAGS" >&5 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6 echo "$as_me:3490: checking for native build linker-flags" >&5 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6 # Check whether --with-build-ldflags or --without-build-ldflags was given. if test "${with_build_ldflags+set}" = set; then withval="$with_build_ldflags" BUILD_LDFLAGS="$withval" fi; echo "$as_me:3498: result: $BUILD_LDFLAGS" >&5 echo "${ECHO_T}$BUILD_LDFLAGS" >&6 echo "$as_me:3501: checking for native build linker-libraries" >&5 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6 # Check whether --with-build-libs or --without-build-libs was given. if test "${with_build_libs+set}" = set; then withval="$with_build_libs" BUILD_LIBS="$withval" fi; echo "$as_me:3509: result: $BUILD_LIBS" >&5 echo "${ECHO_T}$BUILD_LIBS" >&6 # this assumes we're on Unix. BUILD_EXEEXT= BUILD_OBJEXT=o : ${BUILD_CC:='${CC}'} if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then { { echo "$as_me:3519: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&5 echo "$as_me: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&2;} { (exit 1); exit 1; }; } fi else : ${BUILD_CC:='${CC}'} : ${BUILD_CPP:='${CPP}'} : ${BUILD_CFLAGS:='${CFLAGS}'} : ${BUILD_CPPFLAGS:='${CPPFLAGS}'} : ${BUILD_LDFLAGS:='${LDFLAGS}'} : ${BUILD_LIBS:='${LIBS}'} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} fi ############################################################################### ### Options to allow the user to specify the set of libraries which are used. ### Use "--without-normal --with-shared" to allow the default model to be ### shared, for example. cf_list_models="" echo "$as_me:3544: checking if you want to build shared C-objects" >&5 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6 # Check whether --with-shared or --without-shared was given. if test "${with_shared+set}" = set; then withval="$with_shared" with_shared=$withval else with_shared=no fi; echo "$as_me:3554: result: $with_shared" >&5 echo "${ECHO_T}$with_shared" >&6 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" echo "$as_me:3558: checking for specified models" >&5 echo $ECHO_N "checking for specified models... $ECHO_C" >&6 test -z "$cf_list_models" && cf_list_models=normal echo "$as_me:3561: result: $cf_list_models" >&5 echo "${ECHO_T}$cf_list_models" >&6 ### Use the first model as the default, and save its suffix for use in building ### up test-applications. echo "$as_me:3566: checking for default model" >&5 echo $ECHO_N "checking for default model... $ECHO_C" >&6 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'` echo "$as_me:3569: result: $DFT_LWR_MODEL" >&5 echo "${ECHO_T}$DFT_LWR_MODEL" >&6 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` echo "$as_me:3574: checking for specific curses-directory" >&5 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6 # Check whether --with-curses-dir or --without-curses-dir was given. if test "${with_curses_dir+set}" = set; then withval="$with_curses_dir" cf_cv_curses_dir=$withval else cf_cv_curses_dir=no fi; echo "$as_me:3584: result: $cf_cv_curses_dir" >&5 echo "${ECHO_T}$cf_cv_curses_dir" >&6 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".$withval" in (.\$\(*\)*|.\'*\'*) ;; (..|./*|.\\*) ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX ;; (.\${*prefix}*|.\${*dir}*) eval withval="$withval" case ".$withval" in (.NONE/*) withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (.no|.NONE/*) withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; (*) { { echo "$as_me:3615: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; esac if test -d "$cf_cv_curses_dir" then if test -n "$cf_cv_curses_dir/include" ; then for cf_add_incdir in $cf_cv_curses_dir/include do while test $cf_add_incdir != /usr/include do if test -d $cf_add_incdir then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF #line 3648 "configure" #include "confdefs.h" #include int main () { printf("Hello") ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:3660: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3663: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3666: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3669: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_incdir=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:3686: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi if test -n "$cf_cv_curses_dir/lib" ; then for cf_add_libdir in $cf_cv_curses_dir/lib do if test $cf_add_libdir = /usr/lib ; then : elif test -d $cf_add_libdir then cf_have_libdir=no if test -n "$LDFLAGS$LIBS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_libdir in $LDFLAGS $LIBS ; do if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then cf_have_libdir=yes; break fi done fi if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 echo "${as_me:-configure}:3722: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi fi done fi fi fi cf_ncuconfig_root=ncurses cf_have_ncuconfig=no if test "x${PKG_CONFIG:=none}" != xnone; then echo "$as_me:3737: checking pkg-config for $cf_ncuconfig_root" >&5 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6 if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then echo "$as_me:3740: result: yes" >&5 echo "${ECHO_T}yes" >&6 echo "$as_me:3743: checking if the $cf_ncuconfig_root package files work" >&5 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6 cf_have_ncuconfig=unknown cf_save_CPPFLAGS="$CPPFLAGS" cf_save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`" cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" cat >conftest.$ac_ext <<_ACEOF #line 3769 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { initscr(); mousemask(0,0); tgoto((char *)0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3781: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3784: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3787: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3790: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if test "$cross_compiling" = yes; then cf_have_ncuconfig=maybe else cat >conftest.$ac_ext <<_ACEOF #line 3796 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main(void) { char *xx = curses_version(); return (xx == 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:3803: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3806: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:3808: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3811: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_have_ncuconfig=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_ncuconfig=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_ncuconfig=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:3828: result: $cf_have_ncuconfig" >&5 echo "${ECHO_T}$cf_have_ncuconfig" >&6 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes if test "$cf_have_ncuconfig" != "yes" then CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" NCURSES_CONFIG_PKG=none else cat >>confdefs.h <<\EOF #define NCURSES 1 EOF NCURSES_CONFIG_PKG=$cf_ncuconfig_root fi else echo "$as_me:3846: result: no" >&5 echo "${ECHO_T}no" >&6 NCURSES_CONFIG_PKG=none fi else NCURSES_CONFIG_PKG=none fi if test "x$cf_have_ncuconfig" = "xno"; then echo "Looking for ${cf_ncuconfig_root}-config" if test -n "$ac_tool_prefix"; then for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:3862: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NCURSES_CONFIG"; then ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog" echo "$as_me:3877: found $ac_dir/$ac_word" >&5 break done fi fi NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG if test -n "$NCURSES_CONFIG"; then echo "$as_me:3885: result: $NCURSES_CONFIG" >&5 echo "${ECHO_T}$NCURSES_CONFIG" >&6 else echo "$as_me:3888: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$NCURSES_CONFIG" && break done fi if test -z "$NCURSES_CONFIG"; then ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:3901: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NCURSES_CONFIG"; then ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog" echo "$as_me:3916: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG if test -n "$ac_ct_NCURSES_CONFIG"; then echo "$as_me:3924: result: $ac_ct_NCURSES_CONFIG" >&5 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6 else echo "$as_me:3927: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_NCURSES_CONFIG" && break done test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none" NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG fi if test "$NCURSES_CONFIG" != none ; then CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`" cf_add_libs="`$NCURSES_CONFIG --libs`" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" # even with config script, some packages use no-override for curses.h echo "$as_me:3960: checking if we have identified curses headers" >&5 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6 if test "${cf_cv_ncurses_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ncurses_header=none for cf_header in \ ncurses.h ncurses/ncurses.h \ curses.h ncurses/curses.h do cat >conftest.$ac_ext <<_ACEOF #line 3972 "configure" #include "confdefs.h" #include <${cf_header}> int main () { initscr(); tgoto("?", 0,0) ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:3984: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3987: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3990: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3993: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_header=$cf_header; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:4004: result: $cf_cv_ncurses_header" >&5 echo "${ECHO_T}$cf_cv_ncurses_header" >&6 if test "$cf_cv_ncurses_header" = none ; then { { echo "$as_me:4008: error: No curses header-files found" >&5 echo "$as_me: error: No curses header-files found" >&2;} { (exit 1); exit 1; }; } fi # cheat, to get the right #define's for HAVE_NCURSES_H, etc. for ac_header in $cf_cv_ncurses_header do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:4018: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 4024 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:4028: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:4034: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:4053: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <>confdefs.h <<\EOF #define NCURSES 1 EOF cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <conftest.$ac_ext <<_ACEOF #line 4106 "configure" #include "confdefs.h" #include int main () { printf("Hello") ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4118: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4121: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4124: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4127: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_incdir=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:4144: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi } echo "$as_me:4163: checking for $cf_ncuhdr_root header in include-path" >&5 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6 if test "${cf_cv_ncurses_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" for cf_header in $cf_header_list do cat >conftest.$ac_ext <<_ACEOF #line 4175 "configure" #include "confdefs.h" #include <$cf_header> int main () { #ifdef NCURSES_VERSION printf("%s\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\n"); #else make an error #endif #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4199: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4202: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4205: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4208: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_h=$cf_header else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_ncurses_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext test "$cf_cv_ncurses_h" != no && break done fi echo "$as_me:4223: result: $cf_cv_ncurses_h" >&5 echo "${ECHO_T}$cf_cv_ncurses_h" >&6 if test "$cf_cv_ncurses_h" != no ; then cf_cv_ncurses_header=$cf_cv_ncurses_h else echo "$as_me:4230: checking for $cf_ncuhdr_root include-path" >&5 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6 if test "${cf_cv_ncurses_h2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else test -n "$verbose" && echo cf_search= # collect the current set of include-directories from compiler flags cf_header_path_list="" if test -n "${CFLAGS}${CPPFLAGS}" ; then for cf_header_path in $CPPFLAGS $CFLAGS do case $cf_header_path in (-I*) cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` test "x$cf_header_path" != "xNONE" && \ test -d "$cf_header_path" && \ { test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path" test -d $cf_header_path/include && cf_search="$cf_search $cf_header_path/include" test -d $cf_header_path/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root" test -d $cf_header_path/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include" test -d $cf_header_path/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include" test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } cf_header_path_list="$cf_header_path_list $cf_search" ;; esac done fi # add the variations for the package we are looking for cf_search= test "x$prefix" != "xNONE" && \ test -d "$prefix" && \ { test -n "$verbose" && echo " ... testing for include-directories under $prefix" test -d $prefix/include && cf_search="$cf_search $prefix/include" test -d $prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" test -d $prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include" test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ $HOME do test "x$cf_subdir_prefix" != "x$prefix" && \ test -d "$cf_subdir_prefix" && \ (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix" test -d $cf_subdir_prefix/include && cf_search="$cf_search $cf_subdir_prefix/include" test -d $cf_subdir_prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root" test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include" test -d $cf_subdir_prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include" test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } done test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { test -d $includedir && cf_search="$cf_search $includedir" test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root" } test "$oldincludedir" != NONE && \ test "$oldincludedir" != "/usr/include" && \ test -d "$oldincludedir" && { test -d $oldincludedir && cf_search="$cf_search $oldincludedir" test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root" } cf_search="$cf_search $cf_header_path_list" test -n "$verbose" && echo search path $cf_search cf_save2_CPPFLAGS="$CPPFLAGS" for cf_incdir in $cf_search do if test -n "$cf_incdir" ; then for cf_add_incdir in $cf_incdir do while test $cf_add_incdir != /usr/include do if test -d $cf_add_incdir then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF #line 4348 "configure" #include "confdefs.h" #include int main () { printf("Hello") ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4360: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4363: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4366: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4369: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_incdir=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:4386: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi for cf_header in \ ncurses.h \ curses.h do cat >conftest.$ac_ext <<_ACEOF #line 4409 "configure" #include "confdefs.h" #include <$cf_header> int main () { #ifdef NCURSES_VERSION printf("%s\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\n"); #else make an error #endif #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4433: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4436: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4439: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4442: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_h2=$cf_header else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_ncurses_h2=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test "$cf_cv_ncurses_h2" != no ; then cf_cv_ncurses_h2=$cf_incdir/$cf_header test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&6 break fi test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6 done CPPFLAGS="$cf_save2_CPPFLAGS" test "$cf_cv_ncurses_h2" != no && break done test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4463: error: not found" >&5 echo "$as_me: error: not found" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:4468: result: $cf_cv_ncurses_h2" >&5 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6 cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'` cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header fi if test -n "$cf_1st_incdir" ; then for cf_add_incdir in $cf_1st_incdir do while test $cf_add_incdir != /usr/include do if test -d $cf_add_incdir then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF #line 4501 "configure" #include "confdefs.h" #include int main () { printf("Hello") ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4513: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4516: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4519: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4522: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_incdir=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:4539: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi fi # Set definitions to allow ifdef'ing for ncurses.h case $cf_cv_ncurses_header in (*ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_H 1 EOF ;; esac case $cf_cv_ncurses_header in (ncurses/curses.h|ncurses/ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_NCURSES_H 1 EOF ;; (ncursesw/curses.h|ncursesw/ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_NCURSES_H 1 EOF ;; esac echo "$as_me:4587: checking for terminfo header" >&5 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6 if test "${cf_cv_term_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case ${cf_cv_ncurses_header} in (*/ncurses.h|*/ncursesw.h) cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'` ;; (*) cf_term_header=term.h ;; esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat >conftest.$ac_ext <<_ACEOF #line 4605 "configure" #include "confdefs.h" #include #include <${cf_cv_ncurses_header:-curses.h}> #include <$cf_test> int main () { int x = auto_left_margin ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:4620: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4623: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:4626: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4629: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_term_header="$cf_test" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_term_header=unknown fi rm -f conftest.$ac_objext conftest.$ac_ext test "$cf_cv_term_header" != unknown && break done fi echo "$as_me:4645: result: $cf_cv_term_header" >&5 echo "${ECHO_T}$cf_cv_term_header" >&6 # Set definitions to allow ifdef'ing to accommodate subdirectories case $cf_cv_term_header in (*term.h) cat >>confdefs.h <<\EOF #define HAVE_TERM_H 1 EOF ;; esac case $cf_cv_term_header in (ncurses/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_TERM_H 1 EOF ;; (ncursesw/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_TERM_H 1 EOF ;; esac # some applications need this, but should check for NCURSES_VERSION cat >>confdefs.h <<\EOF #define NCURSES 1 EOF echo "$as_me:4683: checking for ncurses version" >&5 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6 if test "${cf_cv_ncurses_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ncurses_version=no cf_tempfile=out$$ rm -f $cf_tempfile if test "$cross_compiling" = yes; then # This will not work if the preprocessor splits the line after the # Autoconf token. The 'unproto' program does that. cat > conftest.$ac_ext < #undef Autoconf #ifdef NCURSES_VERSION Autoconf NCURSES_VERSION #else #ifdef __NCURSES_H Autoconf "old" #endif ; #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" { (eval echo "$as_me:4709: \"$cf_try\"") >&5 (eval $cf_try) 2>&5 ac_status=$? echo "$as_me:4712: \$? = $ac_status" >&5 (exit $ac_status); } if test -f conftest.out ; then cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" rm -f conftest.out fi else cat >conftest.$ac_ext <<_ACEOF #line 4722 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> #include int main() { FILE *fp = fopen("$cf_tempfile", "w"); #ifdef NCURSES_VERSION # ifdef NCURSES_VERSION_PATCH fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); # else fprintf(fp, "%s\n", NCURSES_VERSION); # endif #else # ifdef __NCURSES_H fprintf(fp, "old\n"); # else make an error # endif #endif ${cf_cv_main_return:-return}(0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:4747: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:4750: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:4752: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4755: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_version=`cat $cf_tempfile` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f $cf_tempfile fi echo "$as_me:4769: result: $cf_cv_ncurses_version" >&5 echo "${ECHO_T}$cf_cv_ncurses_version" >&6 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF #define NCURSES 1 EOF cf_nculib_root=ncurses # This works, except for the special case where we find gpm, but # ncurses is in a nonstandard location via $LIBS, and we really want # to link gpm. cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" echo "$as_me:4782: checking for Gpm_Open in -lgpm" >&5 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 4790 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char Gpm_Open (); int main () { Gpm_Open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:4809: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:4812: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:4815: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4818: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Open=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_gpm_Gpm_Open=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:4829: result: $ac_cv_lib_gpm_Gpm_Open" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6 if test $ac_cv_lib_gpm_Gpm_Open = yes; then echo "$as_me:4832: checking for initscr in -lgpm" >&5 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 4840 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char initscr (); int main () { initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:4859: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:4862: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:4865: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4868: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_initscr=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_gpm_initscr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:4879: result: $ac_cv_lib_gpm_initscr" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6 if test $ac_cv_lib_gpm_initscr = yes; then LIBS="$cf_ncurses_SAVE" else cf_ncurses_LIBS="-lgpm" fi fi case $host_os in (freebsd*) # This is only necessary if you are linking against an obsolete # version of ncurses (but it should do no harm, since it's static). if test "$cf_nculib_root" = ncurses ; then echo "$as_me:4894: checking for tgoto in -lmytinfo" >&5 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmytinfo $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 4902 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char tgoto (); int main () { tgoto (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:4921: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:4924: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:4927: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4930: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_mytinfo_tgoto=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_mytinfo_tgoto=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:4941: result: $ac_cv_lib_mytinfo_tgoto" >&5 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6 if test $ac_cv_lib_mytinfo_tgoto = yes; then cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS" fi fi ;; esac cf_add_libs="$cf_ncurses_LIBS" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) then cf_add_libs="-l$cf_nculib_root" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" else eval 'cf_cv_have_lib_'$cf_nculib_root'=no' cf_libdir="" echo "$as_me:4990: checking for initscr" >&5 echo $ECHO_N "checking for initscr... $ECHO_C" >&6 if test "${ac_cv_func_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 4996 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char initscr (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char initscr (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_initscr) || defined (__stub___initscr) choke me #else f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:5027: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5030: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:5033: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5036: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_initscr=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_initscr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:5046: result: $ac_cv_func_initscr" >&5 echo "${ECHO_T}$ac_cv_func_initscr" >&6 if test $ac_cv_func_initscr = yes; then eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' else cf_save_LIBS="$LIBS" echo "$as_me:5053: checking for initscr in -l$cf_nculib_root" >&5 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6 LIBS="-l$cf_nculib_root $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 5057 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { initscr() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:5069: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5072: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:5075: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5078: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:5080: result: yes" >&5 echo "${ECHO_T}yes" >&6 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 echo "$as_me:5087: result: no" >&5 echo "${ECHO_T}no" >&6 cf_search= cf_library_path_list="" if test -n "${LDFLAGS}${LIBS}" ; then for cf_library_path in $LDFLAGS $LIBS do case $cf_library_path in (-L*) cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'` test "x$cf_library_path" != "xNONE" && \ test -d "$cf_library_path" && \ { test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path" test -d $cf_library_path/lib && cf_search="$cf_search $cf_library_path/lib" test -d $cf_library_path/lib/$cf_nculib_root && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root" test -d $cf_library_path/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib" test -d $cf_library_path/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib" test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" } cf_library_path_list="$cf_library_path_list $cf_search" ;; esac done fi cf_search= test "x$prefix" != "xNONE" && \ test -d "$prefix" && \ { test -n "$verbose" && echo " ... testing for lib-directories under $prefix" test -d $prefix/lib && cf_search="$cf_search $prefix/lib" test -d $prefix/lib/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root" test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" test -d $prefix/$cf_nculib_root/lib && cf_search="$cf_search $prefix/$cf_nculib_root/lib" test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" } for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ $HOME do test "x$cf_subdir_prefix" != "x$prefix" && \ test -d "$cf_subdir_prefix" && \ (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix" test -d $cf_subdir_prefix/lib && cf_search="$cf_search $cf_subdir_prefix/lib" test -d $cf_subdir_prefix/lib/$cf_nculib_root && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root" test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib" test -d $cf_subdir_prefix/$cf_nculib_root/lib && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib" test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root" } done cf_search="$cf_library_path_list $cf_search" for cf_libdir in $cf_search do echo "$as_me:5155: checking for -l$cf_nculib_root in $cf_libdir" >&5 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #line 5159 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { initscr() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:5171: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5174: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:5177: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5180: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:5182: result: yes" >&5 echo "${ECHO_T}yes" >&6 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 echo "$as_me:5189: result: no" >&5 echo "${ECHO_T}no" >&6 LIBS="$cf_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root if test $cf_found_library = no ; then { { echo "$as_me:5204: error: Cannot link $cf_nculib_root library" >&5 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} { (exit 1); exit 1; }; } fi fi if test -n "$cf_ncurses_LIBS" ; then echo "$as_me:5212: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6 cf_ncurses_SAVE="$LIBS" for p in $cf_ncurses_LIBS ; do q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` if test "$q" != "$LIBS" ; then LIBS="$q" fi done cat >conftest.$ac_ext <<_ACEOF #line 5222 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { initscr(); mousemask(0,0); tgoto((char *)0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:5234: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5237: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:5240: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5243: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:5245: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 echo "$as_me:5250: result: no" >&5 echo "${ECHO_T}no" >&6 LIBS="$cf_ncurses_SAVE" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6 # Check whether --enable-widec or --disable-widec was given. if test "${enable_widec+set}" = set; then enableval="$enable_widec" with_widec=$enableval else with_widec=no fi; echo "$as_me:5278: result: $with_widec" >&5 echo "${ECHO_T}$with_widec" >&6 if test "$with_widec" = yes ; then echo "$as_me:5282: checking for multibyte character support" >&5 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6 if test "${cf_cv_utf8_lib+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_save_LIBS="$LIBS" cat >conftest.$ac_ext <<_ACEOF #line 5290 "configure" #include "confdefs.h" #include int main () { putwc(0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:5303: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5306: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:5309: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5312: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_utf8_lib=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these # will be set on completion of the AC_TRY_LINK below. cf_cv_header_path_utf8= cf_cv_library_path_utf8= echo "${as_me:-configure}:5324: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 cf_save_LIBS="$LIBS" cat >conftest.$ac_ext <<_ACEOF #line 5329 "configure" #include "confdefs.h" #include int main () { putwc(0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:5342: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5345: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:5348: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5351: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_find_linkage_utf8=yes cf_cv_header_path_utf8=/usr/include cf_cv_library_path_utf8=/usr/lib else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 LIBS="-lutf8 $cf_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #line 5365 "configure" #include "confdefs.h" #include int main () { putwc(0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:5378: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5381: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:5384: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5387: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_find_linkage_utf8=yes cf_cv_header_path_utf8=/usr/include cf_cv_library_path_utf8=/usr/lib cf_cv_library_file_utf8="-lutf8" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_find_linkage_utf8=no LIBS="$cf_save_LIBS" test -n "$verbose" && echo " find linkage for utf8 library" 1>&6 echo "${as_me:-configure}:5404: testing find linkage for utf8 library ..." 1>&5 echo "${as_me:-configure}:5406: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5 cf_save_CPPFLAGS="$CPPFLAGS" cf_test_CPPFLAGS="$CPPFLAGS" cf_search= # collect the current set of include-directories from compiler flags cf_header_path_list="" if test -n "${CFLAGS}${CPPFLAGS}" ; then for cf_header_path in $CPPFLAGS $CFLAGS do case $cf_header_path in (-I*) cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` test "x$cf_header_path" != "xNONE" && \ test -d "$cf_header_path" && \ { test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path" test -d $cf_header_path/include && cf_search="$cf_search $cf_header_path/include" test -d $cf_header_path/include/utf8 && cf_search="$cf_search $cf_header_path/include/utf8" test -d $cf_header_path/include/utf8/include && cf_search="$cf_search $cf_header_path/include/utf8/include" test -d $cf_header_path/utf8/include && cf_search="$cf_search $cf_header_path/utf8/include" test -d $cf_header_path/utf8/include/utf8 && cf_search="$cf_search $cf_header_path/utf8/include/utf8" } cf_header_path_list="$cf_header_path_list $cf_search" ;; esac done fi # add the variations for the package we are looking for cf_search= test "x$prefix" != "xNONE" && \ test -d "$prefix" && \ { test -n "$verbose" && echo " ... testing for include-directories under $prefix" test -d $prefix/include && cf_search="$cf_search $prefix/include" test -d $prefix/include/utf8 && cf_search="$cf_search $prefix/include/utf8" test -d $prefix/include/utf8/include && cf_search="$cf_search $prefix/include/utf8/include" test -d $prefix/utf8/include && cf_search="$cf_search $prefix/utf8/include" test -d $prefix/utf8/include/utf8 && cf_search="$cf_search $prefix/utf8/include/utf8" } for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ $HOME do test "x$cf_subdir_prefix" != "x$prefix" && \ test -d "$cf_subdir_prefix" && \ (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix" test -d $cf_subdir_prefix/include && cf_search="$cf_search $cf_subdir_prefix/include" test -d $cf_subdir_prefix/include/utf8 && cf_search="$cf_search $cf_subdir_prefix/include/utf8" test -d $cf_subdir_prefix/include/utf8/include && cf_search="$cf_search $cf_subdir_prefix/include/utf8/include" test -d $cf_subdir_prefix/utf8/include && cf_search="$cf_search $cf_subdir_prefix/utf8/include" test -d $cf_subdir_prefix/utf8/include/utf8 && cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8" } done test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { test -d $includedir && cf_search="$cf_search $includedir" test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8" } test "$oldincludedir" != NONE && \ test "$oldincludedir" != "/usr/include" && \ test -d "$oldincludedir" && { test -d $oldincludedir && cf_search="$cf_search $oldincludedir" test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8" } cf_search="$cf_search $cf_header_path_list" for cf_cv_header_path_utf8 in $cf_search do if test -d $cf_cv_header_path_utf8 ; then test -n "$verbose" && echo " ... testing $cf_cv_header_path_utf8" 1>&6 echo "${as_me:-configure}:5497: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5 CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8" cat >conftest.$ac_ext <<_ACEOF #line 5501 "configure" #include "confdefs.h" #include int main () { putwc(0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5514: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5517: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5520: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5523: \$? = $ac_status" >&5 (exit $ac_status); }; }; then test -n "$verbose" && echo " ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6 echo "${as_me:-configure}:5528: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=maybe cf_test_CPPFLAGS="$CPPFLAGS" break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 CPPFLAGS="$cf_save_CPPFLAGS" fi rm -f conftest.$ac_objext conftest.$ac_ext fi done if test "$cf_cv_find_linkage_utf8" = maybe ; then echo "${as_me:-configure}:5546: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5 cf_save_LIBS="$LIBS" cf_save_LDFLAGS="$LDFLAGS" if test "$cf_cv_find_linkage_utf8" != yes ; then cf_search= cf_library_path_list="" if test -n "${LDFLAGS}${LIBS}" ; then for cf_library_path in $LDFLAGS $LIBS do case $cf_library_path in (-L*) cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'` test "x$cf_library_path" != "xNONE" && \ test -d "$cf_library_path" && \ { test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path" test -d $cf_library_path/lib && cf_search="$cf_search $cf_library_path/lib" test -d $cf_library_path/lib/utf8 && cf_search="$cf_search $cf_library_path/lib/utf8" test -d $cf_library_path/lib/utf8/lib && cf_search="$cf_search $cf_library_path/lib/utf8/lib" test -d $cf_library_path/utf8/lib && cf_search="$cf_search $cf_library_path/utf8/lib" test -d $cf_library_path/utf8/lib/utf8 && cf_search="$cf_search $cf_library_path/utf8/lib/utf8" } cf_library_path_list="$cf_library_path_list $cf_search" ;; esac done fi cf_search= test "x$prefix" != "xNONE" && \ test -d "$prefix" && \ { test -n "$verbose" && echo " ... testing for lib-directories under $prefix" test -d $prefix/lib && cf_search="$cf_search $prefix/lib" test -d $prefix/lib/utf8 && cf_search="$cf_search $prefix/lib/utf8" test -d $prefix/lib/utf8/lib && cf_search="$cf_search $prefix/lib/utf8/lib" test -d $prefix/utf8/lib && cf_search="$cf_search $prefix/utf8/lib" test -d $prefix/utf8/lib/utf8 && cf_search="$cf_search $prefix/utf8/lib/utf8" } for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ $HOME do test "x$cf_subdir_prefix" != "x$prefix" && \ test -d "$cf_subdir_prefix" && \ (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix" test -d $cf_subdir_prefix/lib && cf_search="$cf_search $cf_subdir_prefix/lib" test -d $cf_subdir_prefix/lib/utf8 && cf_search="$cf_search $cf_subdir_prefix/lib/utf8" test -d $cf_subdir_prefix/lib/utf8/lib && cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib" test -d $cf_subdir_prefix/utf8/lib && cf_search="$cf_search $cf_subdir_prefix/utf8/lib" test -d $cf_subdir_prefix/utf8/lib/utf8 && cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8" } done cf_search="$cf_library_path_list $cf_search" for cf_cv_library_path_utf8 in $cf_search do if test -d $cf_cv_library_path_utf8 ; then test -n "$verbose" && echo " ... testing $cf_cv_library_path_utf8" 1>&6 echo "${as_me:-configure}:5621: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5 CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-lutf8 $cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8" cat >conftest.$ac_ext <<_ACEOF #line 5627 "configure" #include "confdefs.h" #include int main () { putwc(0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:5640: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5643: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:5646: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5649: \$? = $ac_status" >&5 (exit $ac_status); }; }; then test -n "$verbose" && echo " ... found utf8 library in $cf_cv_library_path_utf8" 1>&6 echo "${as_me:-configure}:5654: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=yes cf_cv_library_file_utf8="-lutf8" break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi done CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi else cf_cv_find_linkage_utf8=no fi fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" if test "$cf_cv_find_linkage_utf8" = yes ; then cf_cv_utf8_lib=add-on else cf_cv_utf8_lib=no fi fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:5696: result: $cf_cv_utf8_lib" >&5 echo "${ECHO_T}$cf_cv_utf8_lib" >&6 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between # ncurses/ncursesw: if test "$cf_cv_utf8_lib" = "add-on" ; then cat >>confdefs.h <<\EOF #define HAVE_LIBUTF8_H 1 EOF if test -n "$cf_cv_header_path_utf8" ; then for cf_add_incdir in $cf_cv_header_path_utf8 do while test $cf_add_incdir != /usr/include do if test -d $cf_add_incdir then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF #line 5731 "configure" #include "confdefs.h" #include int main () { printf("Hello") ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:5743: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5746: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:5749: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5752: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_incdir=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:5769: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi if test -n "$cf_cv_library_path_utf8" ; then for cf_add_libdir in $cf_cv_library_path_utf8 do if test $cf_add_libdir = /usr/lib ; then : elif test -d $cf_add_libdir then cf_have_libdir=no if test -n "$LDFLAGS$LIBS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_libdir in $LDFLAGS $LIBS ; do if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then cf_have_libdir=yes; break fi done fi if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 echo "${as_me:-configure}:5805: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi fi done fi cf_add_libs="$cf_cv_library_file_utf8" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" fi cf_ncuconfig_root=ncursesw cf_have_ncuconfig=no if test "x${PKG_CONFIG:=none}" != xnone; then echo "$as_me:5835: checking pkg-config for $cf_ncuconfig_root" >&5 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6 if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then echo "$as_me:5838: result: yes" >&5 echo "${ECHO_T}yes" >&6 echo "$as_me:5841: checking if the $cf_ncuconfig_root package files work" >&5 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6 cf_have_ncuconfig=unknown cf_save_CPPFLAGS="$CPPFLAGS" cf_save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`" cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" cat >conftest.$ac_ext <<_ACEOF #line 5867 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { initscr(); mousemask(0,0); tgoto((char *)0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:5879: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5882: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:5885: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5888: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if test "$cross_compiling" = yes; then cf_have_ncuconfig=maybe else cat >conftest.$ac_ext <<_ACEOF #line 5894 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main(void) { char *xx = curses_version(); return (xx == 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:5901: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5904: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:5906: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5909: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_have_ncuconfig=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_ncuconfig=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_ncuconfig=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:5926: result: $cf_have_ncuconfig" >&5 echo "${ECHO_T}$cf_have_ncuconfig" >&6 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes if test "$cf_have_ncuconfig" != "yes" then CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" NCURSES_CONFIG_PKG=none else cat >>confdefs.h <<\EOF #define NCURSES 1 EOF NCURSES_CONFIG_PKG=$cf_ncuconfig_root fi else echo "$as_me:5944: result: no" >&5 echo "${ECHO_T}no" >&6 NCURSES_CONFIG_PKG=none fi else NCURSES_CONFIG_PKG=none fi if test "x$cf_have_ncuconfig" = "xno"; then echo "Looking for ${cf_ncuconfig_root}-config" if test -n "$ac_tool_prefix"; then for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:5960: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NCURSES_CONFIG"; then ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog" echo "$as_me:5975: found $ac_dir/$ac_word" >&5 break done fi fi NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG if test -n "$NCURSES_CONFIG"; then echo "$as_me:5983: result: $NCURSES_CONFIG" >&5 echo "${ECHO_T}$NCURSES_CONFIG" >&6 else echo "$as_me:5986: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$NCURSES_CONFIG" && break done fi if test -z "$NCURSES_CONFIG"; then ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:5999: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NCURSES_CONFIG"; then ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog" echo "$as_me:6014: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG if test -n "$ac_ct_NCURSES_CONFIG"; then echo "$as_me:6022: result: $ac_ct_NCURSES_CONFIG" >&5 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6 else echo "$as_me:6025: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_NCURSES_CONFIG" && break done test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none" NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG fi if test "$NCURSES_CONFIG" != none ; then CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`" cf_add_libs="`$NCURSES_CONFIG --libs`" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" # even with config script, some packages use no-override for curses.h echo "$as_me:6058: checking if we have identified curses headers" >&5 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6 if test "${cf_cv_ncurses_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ncurses_header=none for cf_header in \ ncurses.h ncursesw/ncurses.h \ curses.h ncursesw/curses.h do cat >conftest.$ac_ext <<_ACEOF #line 6070 "configure" #include "confdefs.h" #include <${cf_header}> int main () { initscr(); tgoto("?", 0,0) ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6082: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6085: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6088: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6091: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_header=$cf_header; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:6102: result: $cf_cv_ncurses_header" >&5 echo "${ECHO_T}$cf_cv_ncurses_header" >&6 if test "$cf_cv_ncurses_header" = none ; then { { echo "$as_me:6106: error: No curses header-files found" >&5 echo "$as_me: error: No curses header-files found" >&2;} { (exit 1); exit 1; }; } fi # cheat, to get the right #define's for HAVE_NCURSES_H, etc. for ac_header in $cf_cv_ncurses_header do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:6116: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 6122 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:6126: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:6132: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:6151: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <>confdefs.h <<\EOF #define NCURSES 1 EOF cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <conftest.$ac_ext <<_ACEOF #line 6204 "configure" #include "confdefs.h" #include int main () { printf("Hello") ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6216: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6219: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6222: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6225: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_incdir=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:6242: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi } echo "$as_me:6261: checking for $cf_ncuhdr_root header in include-path" >&5 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6 if test "${cf_cv_ncurses_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" for cf_header in $cf_header_list do cat >conftest.$ac_ext <<_ACEOF #line 6273 "configure" #include "confdefs.h" #define _XOPEN_SOURCE_EXTENDED #undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */ #define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */ #include <$cf_header> int main () { #ifdef NCURSES_VERSION #ifndef WACS_BSSB make an error #endif printf("%s\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\n"); #else make an error #endif #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6305: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6308: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6311: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6314: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_h=$cf_header else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_ncurses_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext test "$cf_cv_ncurses_h" != no && break done fi echo "$as_me:6329: result: $cf_cv_ncurses_h" >&5 echo "${ECHO_T}$cf_cv_ncurses_h" >&6 if test "$cf_cv_ncurses_h" != no ; then cf_cv_ncurses_header=$cf_cv_ncurses_h else echo "$as_me:6336: checking for $cf_ncuhdr_root include-path" >&5 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6 if test "${cf_cv_ncurses_h2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else test -n "$verbose" && echo cf_search= # collect the current set of include-directories from compiler flags cf_header_path_list="" if test -n "${CFLAGS}${CPPFLAGS}" ; then for cf_header_path in $CPPFLAGS $CFLAGS do case $cf_header_path in (-I*) cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` test "x$cf_header_path" != "xNONE" && \ test -d "$cf_header_path" && \ { test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path" test -d $cf_header_path/include && cf_search="$cf_search $cf_header_path/include" test -d $cf_header_path/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root" test -d $cf_header_path/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include" test -d $cf_header_path/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include" test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } cf_header_path_list="$cf_header_path_list $cf_search" ;; esac done fi # add the variations for the package we are looking for cf_search= test "x$prefix" != "xNONE" && \ test -d "$prefix" && \ { test -n "$verbose" && echo " ... testing for include-directories under $prefix" test -d $prefix/include && cf_search="$cf_search $prefix/include" test -d $prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" test -d $prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include" test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ $HOME do test "x$cf_subdir_prefix" != "x$prefix" && \ test -d "$cf_subdir_prefix" && \ (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix" test -d $cf_subdir_prefix/include && cf_search="$cf_search $cf_subdir_prefix/include" test -d $cf_subdir_prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root" test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include" test -d $cf_subdir_prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include" test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } done test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { test -d $includedir && cf_search="$cf_search $includedir" test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root" } test "$oldincludedir" != NONE && \ test "$oldincludedir" != "/usr/include" && \ test -d "$oldincludedir" && { test -d $oldincludedir && cf_search="$cf_search $oldincludedir" test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root" } cf_search="$cf_search $cf_header_path_list" test -n "$verbose" && echo search path $cf_search cf_save2_CPPFLAGS="$CPPFLAGS" for cf_incdir in $cf_search do if test -n "$cf_incdir" ; then for cf_add_incdir in $cf_incdir do while test $cf_add_incdir != /usr/include do if test -d $cf_add_incdir then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF #line 6454 "configure" #include "confdefs.h" #include int main () { printf("Hello") ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6466: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6469: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6472: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6475: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_incdir=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:6492: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi for cf_header in \ ncurses.h \ curses.h do cat >conftest.$ac_ext <<_ACEOF #line 6515 "configure" #include "confdefs.h" #include <$cf_header> int main () { #ifdef NCURSES_VERSION printf("%s\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\n"); #else make an error #endif #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6539: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6542: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6545: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6548: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_h2=$cf_header else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_ncurses_h2=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test "$cf_cv_ncurses_h2" != no ; then cf_cv_ncurses_h2=$cf_incdir/$cf_header test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&6 break fi test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6 done CPPFLAGS="$cf_save2_CPPFLAGS" test "$cf_cv_ncurses_h2" != no && break done test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6569: error: not found" >&5 echo "$as_me: error: not found" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:6574: result: $cf_cv_ncurses_h2" >&5 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6 cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'` cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header fi if test -n "$cf_1st_incdir" ; then for cf_add_incdir in $cf_1st_incdir do while test $cf_add_incdir != /usr/include do if test -d $cf_add_incdir then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF #line 6607 "configure" #include "confdefs.h" #include int main () { printf("Hello") ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6619: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6622: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6625: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6628: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_incdir=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:6645: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi fi # Set definitions to allow ifdef'ing for ncurses.h case $cf_cv_ncurses_header in (*ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_H 1 EOF ;; esac case $cf_cv_ncurses_header in (ncurses/curses.h|ncurses/ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_NCURSES_H 1 EOF ;; (ncursesw/curses.h|ncursesw/ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_NCURSES_H 1 EOF ;; esac echo "$as_me:6693: checking for terminfo header" >&5 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6 if test "${cf_cv_term_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case ${cf_cv_ncurses_header} in (*/ncurses.h|*/ncursesw.h) cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'` ;; (*) cf_term_header=term.h ;; esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat >conftest.$ac_ext <<_ACEOF #line 6711 "configure" #include "confdefs.h" #include #include <${cf_cv_ncurses_header:-curses.h}> #include <$cf_test> int main () { int x = auto_left_margin ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:6726: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6729: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:6732: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6735: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_term_header="$cf_test" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_term_header=unknown fi rm -f conftest.$ac_objext conftest.$ac_ext test "$cf_cv_term_header" != unknown && break done fi echo "$as_me:6751: result: $cf_cv_term_header" >&5 echo "${ECHO_T}$cf_cv_term_header" >&6 # Set definitions to allow ifdef'ing to accommodate subdirectories case $cf_cv_term_header in (*term.h) cat >>confdefs.h <<\EOF #define HAVE_TERM_H 1 EOF ;; esac case $cf_cv_term_header in (ncurses/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_TERM_H 1 EOF ;; (ncursesw/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_TERM_H 1 EOF ;; esac # some applications need this, but should check for NCURSES_VERSION cat >>confdefs.h <<\EOF #define NCURSES 1 EOF echo "$as_me:6789: checking for ncurses version" >&5 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6 if test "${cf_cv_ncurses_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ncurses_version=no cf_tempfile=out$$ rm -f $cf_tempfile if test "$cross_compiling" = yes; then # This will not work if the preprocessor splits the line after the # Autoconf token. The 'unproto' program does that. cat > conftest.$ac_ext < #undef Autoconf #ifdef NCURSES_VERSION Autoconf NCURSES_VERSION #else #ifdef __NCURSES_H Autoconf "old" #endif ; #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" { (eval echo "$as_me:6815: \"$cf_try\"") >&5 (eval $cf_try) 2>&5 ac_status=$? echo "$as_me:6818: \$? = $ac_status" >&5 (exit $ac_status); } if test -f conftest.out ; then cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" rm -f conftest.out fi else cat >conftest.$ac_ext <<_ACEOF #line 6828 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> #include int main() { FILE *fp = fopen("$cf_tempfile", "w"); #ifdef NCURSES_VERSION # ifdef NCURSES_VERSION_PATCH fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); # else fprintf(fp, "%s\n", NCURSES_VERSION); # endif #else # ifdef __NCURSES_H fprintf(fp, "old\n"); # else make an error # endif #endif ${cf_cv_main_return:-return}(0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:6853: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:6856: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:6858: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6861: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_version=`cat $cf_tempfile` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f $cf_tempfile fi echo "$as_me:6875: result: $cf_cv_ncurses_version" >&5 echo "${ECHO_T}$cf_cv_ncurses_version" >&6 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF #define NCURSES 1 EOF cf_nculib_root=ncursesw # This works, except for the special case where we find gpm, but # ncurses is in a nonstandard location via $LIBS, and we really want # to link gpm. cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" echo "$as_me:6888: checking for Gpm_Open in -lgpm" >&5 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 6896 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char Gpm_Open (); int main () { Gpm_Open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:6915: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:6918: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:6921: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6924: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Open=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_gpm_Gpm_Open=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:6935: result: $ac_cv_lib_gpm_Gpm_Open" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6 if test $ac_cv_lib_gpm_Gpm_Open = yes; then echo "$as_me:6938: checking for initscr in -lgpm" >&5 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 6946 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char initscr (); int main () { initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:6965: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:6968: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:6971: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6974: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_initscr=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_gpm_initscr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:6985: result: $ac_cv_lib_gpm_initscr" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6 if test $ac_cv_lib_gpm_initscr = yes; then LIBS="$cf_ncurses_SAVE" else cf_ncurses_LIBS="-lgpm" fi fi case $host_os in (freebsd*) # This is only necessary if you are linking against an obsolete # version of ncurses (but it should do no harm, since it's static). if test "$cf_nculib_root" = ncurses ; then echo "$as_me:7000: checking for tgoto in -lmytinfo" >&5 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmytinfo $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 7008 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char tgoto (); int main () { tgoto (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:7027: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7030: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:7033: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7036: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_mytinfo_tgoto=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_mytinfo_tgoto=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:7047: result: $ac_cv_lib_mytinfo_tgoto" >&5 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6 if test $ac_cv_lib_mytinfo_tgoto = yes; then cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS" fi fi ;; esac cf_add_libs="$cf_ncurses_LIBS" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) then cf_add_libs="-l$cf_nculib_root" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" else eval 'cf_cv_have_lib_'$cf_nculib_root'=no' cf_libdir="" echo "$as_me:7096: checking for initscr" >&5 echo $ECHO_N "checking for initscr... $ECHO_C" >&6 if test "${ac_cv_func_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 7102 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char initscr (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char initscr (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_initscr) || defined (__stub___initscr) choke me #else f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:7133: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7136: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:7139: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7142: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_initscr=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_initscr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:7152: result: $ac_cv_func_initscr" >&5 echo "${ECHO_T}$ac_cv_func_initscr" >&6 if test $ac_cv_func_initscr = yes; then eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' else cf_save_LIBS="$LIBS" echo "$as_me:7159: checking for initscr in -l$cf_nculib_root" >&5 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6 LIBS="-l$cf_nculib_root $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 7163 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { initscr() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:7175: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7178: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:7181: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7184: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:7186: result: yes" >&5 echo "${ECHO_T}yes" >&6 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 echo "$as_me:7193: result: no" >&5 echo "${ECHO_T}no" >&6 cf_search= cf_library_path_list="" if test -n "${LDFLAGS}${LIBS}" ; then for cf_library_path in $LDFLAGS $LIBS do case $cf_library_path in (-L*) cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'` test "x$cf_library_path" != "xNONE" && \ test -d "$cf_library_path" && \ { test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path" test -d $cf_library_path/lib && cf_search="$cf_search $cf_library_path/lib" test -d $cf_library_path/lib/$cf_nculib_root && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root" test -d $cf_library_path/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib" test -d $cf_library_path/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib" test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" } cf_library_path_list="$cf_library_path_list $cf_search" ;; esac done fi cf_search= test "x$prefix" != "xNONE" && \ test -d "$prefix" && \ { test -n "$verbose" && echo " ... testing for lib-directories under $prefix" test -d $prefix/lib && cf_search="$cf_search $prefix/lib" test -d $prefix/lib/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root" test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" test -d $prefix/$cf_nculib_root/lib && cf_search="$cf_search $prefix/$cf_nculib_root/lib" test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" } for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ $HOME do test "x$cf_subdir_prefix" != "x$prefix" && \ test -d "$cf_subdir_prefix" && \ (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix" test -d $cf_subdir_prefix/lib && cf_search="$cf_search $cf_subdir_prefix/lib" test -d $cf_subdir_prefix/lib/$cf_nculib_root && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root" test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib" test -d $cf_subdir_prefix/$cf_nculib_root/lib && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib" test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root" } done cf_search="$cf_library_path_list $cf_search" for cf_libdir in $cf_search do echo "$as_me:7261: checking for -l$cf_nculib_root in $cf_libdir" >&5 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #line 7265 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { initscr() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:7277: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7280: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:7283: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7286: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:7288: result: yes" >&5 echo "${ECHO_T}yes" >&6 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 echo "$as_me:7295: result: no" >&5 echo "${ECHO_T}no" >&6 LIBS="$cf_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root if test $cf_found_library = no ; then { { echo "$as_me:7310: error: Cannot link $cf_nculib_root library" >&5 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} { (exit 1); exit 1; }; } fi fi if test -n "$cf_ncurses_LIBS" ; then echo "$as_me:7318: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6 cf_ncurses_SAVE="$LIBS" for p in $cf_ncurses_LIBS ; do q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` if test "$q" != "$LIBS" ; then LIBS="$q" fi done cat >conftest.$ac_ext <<_ACEOF #line 7328 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { initscr(); mousemask(0,0); tgoto((char *)0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:7340: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7343: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:7346: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7349: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:7351: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 echo "$as_me:7356: result: no" >&5 echo "${ECHO_T}no" >&6 LIBS="$cf_ncurses_SAVE" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6 if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then echo "$as_me:7383: result: yes" >&5 echo "${ECHO_T}yes" >&6 echo "$as_me:7386: checking if the $cf_ncuconfig_root package files work" >&5 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6 cf_have_ncuconfig=unknown cf_save_CPPFLAGS="$CPPFLAGS" cf_save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`" cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" cat >conftest.$ac_ext <<_ACEOF #line 7412 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { initscr(); mousemask(0,0); tgoto((char *)0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:7424: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7427: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:7430: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7433: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if test "$cross_compiling" = yes; then cf_have_ncuconfig=maybe else cat >conftest.$ac_ext <<_ACEOF #line 7439 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main(void) { char *xx = curses_version(); return (xx == 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:7446: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7449: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:7451: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7454: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_have_ncuconfig=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_ncuconfig=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_ncuconfig=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:7471: result: $cf_have_ncuconfig" >&5 echo "${ECHO_T}$cf_have_ncuconfig" >&6 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes if test "$cf_have_ncuconfig" != "yes" then CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" NCURSES_CONFIG_PKG=none else cat >>confdefs.h <<\EOF #define NCURSES 1 EOF NCURSES_CONFIG_PKG=$cf_ncuconfig_root fi else echo "$as_me:7489: result: no" >&5 echo "${ECHO_T}no" >&6 NCURSES_CONFIG_PKG=none fi else NCURSES_CONFIG_PKG=none fi if test "x$cf_have_ncuconfig" = "xno"; then echo "Looking for ${cf_ncuconfig_root}-config" if test -n "$ac_tool_prefix"; then for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:7505: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NCURSES_CONFIG"; then ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog" echo "$as_me:7520: found $ac_dir/$ac_word" >&5 break done fi fi NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG if test -n "$NCURSES_CONFIG"; then echo "$as_me:7528: result: $NCURSES_CONFIG" >&5 echo "${ECHO_T}$NCURSES_CONFIG" >&6 else echo "$as_me:7531: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$NCURSES_CONFIG" && break done fi if test -z "$NCURSES_CONFIG"; then ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:7544: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NCURSES_CONFIG"; then ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog" echo "$as_me:7559: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG if test -n "$ac_ct_NCURSES_CONFIG"; then echo "$as_me:7567: result: $ac_ct_NCURSES_CONFIG" >&5 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6 else echo "$as_me:7570: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_NCURSES_CONFIG" && break done test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none" NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG fi if test "$NCURSES_CONFIG" != none ; then CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`" cf_add_libs="`$NCURSES_CONFIG --libs`" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" # even with config script, some packages use no-override for curses.h echo "$as_me:7603: checking if we have identified curses headers" >&5 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6 if test "${cf_cv_ncurses_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ncurses_header=none for cf_header in \ ncurses.h ncurses/ncurses.h \ curses.h ncurses/curses.h do cat >conftest.$ac_ext <<_ACEOF #line 7615 "configure" #include "confdefs.h" #include <${cf_header}> int main () { initscr(); tgoto("?", 0,0) ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:7627: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:7630: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:7633: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7636: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_header=$cf_header; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:7647: result: $cf_cv_ncurses_header" >&5 echo "${ECHO_T}$cf_cv_ncurses_header" >&6 if test "$cf_cv_ncurses_header" = none ; then { { echo "$as_me:7651: error: No curses header-files found" >&5 echo "$as_me: error: No curses header-files found" >&2;} { (exit 1); exit 1; }; } fi # cheat, to get the right #define's for HAVE_NCURSES_H, etc. for ac_header in $cf_cv_ncurses_header do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:7661: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 7667 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:7671: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:7677: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:7696: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <>confdefs.h <<\EOF #define NCURSES 1 EOF cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <conftest.$ac_ext <<_ACEOF #line 7749 "configure" #include "confdefs.h" #include int main () { printf("Hello") ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:7761: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:7764: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:7767: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7770: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_incdir=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:7787: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi } echo "$as_me:7806: checking for $cf_ncuhdr_root header in include-path" >&5 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6 if test "${cf_cv_ncurses_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" for cf_header in $cf_header_list do cat >conftest.$ac_ext <<_ACEOF #line 7818 "configure" #include "confdefs.h" #include <$cf_header> int main () { #ifdef NCURSES_VERSION printf("%s\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\n"); #else make an error #endif #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:7842: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:7845: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:7848: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7851: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_h=$cf_header else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_ncurses_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext test "$cf_cv_ncurses_h" != no && break done fi echo "$as_me:7866: result: $cf_cv_ncurses_h" >&5 echo "${ECHO_T}$cf_cv_ncurses_h" >&6 if test "$cf_cv_ncurses_h" != no ; then cf_cv_ncurses_header=$cf_cv_ncurses_h else echo "$as_me:7873: checking for $cf_ncuhdr_root include-path" >&5 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6 if test "${cf_cv_ncurses_h2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else test -n "$verbose" && echo cf_search= # collect the current set of include-directories from compiler flags cf_header_path_list="" if test -n "${CFLAGS}${CPPFLAGS}" ; then for cf_header_path in $CPPFLAGS $CFLAGS do case $cf_header_path in (-I*) cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` test "x$cf_header_path" != "xNONE" && \ test -d "$cf_header_path" && \ { test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path" test -d $cf_header_path/include && cf_search="$cf_search $cf_header_path/include" test -d $cf_header_path/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root" test -d $cf_header_path/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include" test -d $cf_header_path/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include" test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } cf_header_path_list="$cf_header_path_list $cf_search" ;; esac done fi # add the variations for the package we are looking for cf_search= test "x$prefix" != "xNONE" && \ test -d "$prefix" && \ { test -n "$verbose" && echo " ... testing for include-directories under $prefix" test -d $prefix/include && cf_search="$cf_search $prefix/include" test -d $prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" test -d $prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include" test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ $HOME do test "x$cf_subdir_prefix" != "x$prefix" && \ test -d "$cf_subdir_prefix" && \ (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix" test -d $cf_subdir_prefix/include && cf_search="$cf_search $cf_subdir_prefix/include" test -d $cf_subdir_prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root" test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include" test -d $cf_subdir_prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include" test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } done test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { test -d $includedir && cf_search="$cf_search $includedir" test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root" } test "$oldincludedir" != NONE && \ test "$oldincludedir" != "/usr/include" && \ test -d "$oldincludedir" && { test -d $oldincludedir && cf_search="$cf_search $oldincludedir" test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root" } cf_search="$cf_search $cf_header_path_list" test -n "$verbose" && echo search path $cf_search cf_save2_CPPFLAGS="$CPPFLAGS" for cf_incdir in $cf_search do if test -n "$cf_incdir" ; then for cf_add_incdir in $cf_incdir do while test $cf_add_incdir != /usr/include do if test -d $cf_add_incdir then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF #line 7991 "configure" #include "confdefs.h" #include int main () { printf("Hello") ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:8003: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:8006: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:8009: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8012: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_incdir=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:8029: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi for cf_header in \ ncurses.h \ curses.h do cat >conftest.$ac_ext <<_ACEOF #line 8052 "configure" #include "confdefs.h" #include <$cf_header> int main () { #ifdef NCURSES_VERSION printf("%s\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\n"); #else make an error #endif #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:8076: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:8079: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:8082: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8085: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_h2=$cf_header else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_ncurses_h2=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test "$cf_cv_ncurses_h2" != no ; then cf_cv_ncurses_h2=$cf_incdir/$cf_header test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&6 break fi test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6 done CPPFLAGS="$cf_save2_CPPFLAGS" test "$cf_cv_ncurses_h2" != no && break done test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8106: error: not found" >&5 echo "$as_me: error: not found" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:8111: result: $cf_cv_ncurses_h2" >&5 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6 cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'` cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header fi if test -n "$cf_1st_incdir" ; then for cf_add_incdir in $cf_1st_incdir do while test $cf_add_incdir != /usr/include do if test -d $cf_add_incdir then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF #line 8144 "configure" #include "confdefs.h" #include int main () { printf("Hello") ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:8156: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:8159: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:8162: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8165: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_have_incdir=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:8182: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi fi # Set definitions to allow ifdef'ing for ncurses.h case $cf_cv_ncurses_header in (*ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_H 1 EOF ;; esac case $cf_cv_ncurses_header in (ncurses/curses.h|ncurses/ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_NCURSES_H 1 EOF ;; (ncursesw/curses.h|ncursesw/ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_NCURSES_H 1 EOF ;; esac echo "$as_me:8230: checking for terminfo header" >&5 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6 if test "${cf_cv_term_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case ${cf_cv_ncurses_header} in (*/ncurses.h|*/ncursesw.h) cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'` ;; (*) cf_term_header=term.h ;; esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat >conftest.$ac_ext <<_ACEOF #line 8248 "configure" #include "confdefs.h" #include #include <${cf_cv_ncurses_header:-curses.h}> #include <$cf_test> int main () { int x = auto_left_margin ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:8263: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:8266: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:8269: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8272: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_term_header="$cf_test" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_term_header=unknown fi rm -f conftest.$ac_objext conftest.$ac_ext test "$cf_cv_term_header" != unknown && break done fi echo "$as_me:8288: result: $cf_cv_term_header" >&5 echo "${ECHO_T}$cf_cv_term_header" >&6 # Set definitions to allow ifdef'ing to accommodate subdirectories case $cf_cv_term_header in (*term.h) cat >>confdefs.h <<\EOF #define HAVE_TERM_H 1 EOF ;; esac case $cf_cv_term_header in (ncurses/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_TERM_H 1 EOF ;; (ncursesw/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_TERM_H 1 EOF ;; esac # some applications need this, but should check for NCURSES_VERSION cat >>confdefs.h <<\EOF #define NCURSES 1 EOF echo "$as_me:8326: checking for ncurses version" >&5 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6 if test "${cf_cv_ncurses_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ncurses_version=no cf_tempfile=out$$ rm -f $cf_tempfile if test "$cross_compiling" = yes; then # This will not work if the preprocessor splits the line after the # Autoconf token. The 'unproto' program does that. cat > conftest.$ac_ext < #undef Autoconf #ifdef NCURSES_VERSION Autoconf NCURSES_VERSION #else #ifdef __NCURSES_H Autoconf "old" #endif ; #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" { (eval echo "$as_me:8352: \"$cf_try\"") >&5 (eval $cf_try) 2>&5 ac_status=$? echo "$as_me:8355: \$? = $ac_status" >&5 (exit $ac_status); } if test -f conftest.out ; then cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" rm -f conftest.out fi else cat >conftest.$ac_ext <<_ACEOF #line 8365 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> #include int main() { FILE *fp = fopen("$cf_tempfile", "w"); #ifdef NCURSES_VERSION # ifdef NCURSES_VERSION_PATCH fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); # else fprintf(fp, "%s\n", NCURSES_VERSION); # endif #else # ifdef __NCURSES_H fprintf(fp, "old\n"); # else make an error # endif #endif ${cf_cv_main_return:-return}(0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:8390: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8393: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:8395: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8398: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_version=`cat $cf_tempfile` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f $cf_tempfile fi echo "$as_me:8412: result: $cf_cv_ncurses_version" >&5 echo "${ECHO_T}$cf_cv_ncurses_version" >&6 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF #define NCURSES 1 EOF cf_nculib_root=ncurses # This works, except for the special case where we find gpm, but # ncurses is in a nonstandard location via $LIBS, and we really want # to link gpm. cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" echo "$as_me:8425: checking for Gpm_Open in -lgpm" >&5 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 8433 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char Gpm_Open (); int main () { Gpm_Open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8452: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8455: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8458: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8461: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Open=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_gpm_Gpm_Open=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:8472: result: $ac_cv_lib_gpm_Gpm_Open" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6 if test $ac_cv_lib_gpm_Gpm_Open = yes; then echo "$as_me:8475: checking for initscr in -lgpm" >&5 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 8483 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char initscr (); int main () { initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8502: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8505: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8508: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8511: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_initscr=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_gpm_initscr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:8522: result: $ac_cv_lib_gpm_initscr" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6 if test $ac_cv_lib_gpm_initscr = yes; then LIBS="$cf_ncurses_SAVE" else cf_ncurses_LIBS="-lgpm" fi fi case $host_os in (freebsd*) # This is only necessary if you are linking against an obsolete # version of ncurses (but it should do no harm, since it's static). if test "$cf_nculib_root" = ncurses ; then echo "$as_me:8537: checking for tgoto in -lmytinfo" >&5 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmytinfo $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 8545 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char tgoto (); int main () { tgoto (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8564: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8567: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8570: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8573: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_mytinfo_tgoto=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_mytinfo_tgoto=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:8584: result: $ac_cv_lib_mytinfo_tgoto" >&5 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6 if test $ac_cv_lib_mytinfo_tgoto = yes; then cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS" fi fi ;; esac cf_add_libs="$cf_ncurses_LIBS" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) then cf_add_libs="-l$cf_nculib_root" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" else eval 'cf_cv_have_lib_'$cf_nculib_root'=no' cf_libdir="" echo "$as_me:8633: checking for initscr" >&5 echo $ECHO_N "checking for initscr... $ECHO_C" >&6 if test "${ac_cv_func_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 8639 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char initscr (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char initscr (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_initscr) || defined (__stub___initscr) choke me #else f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8670: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8673: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8676: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8679: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_initscr=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_initscr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:8689: result: $ac_cv_func_initscr" >&5 echo "${ECHO_T}$ac_cv_func_initscr" >&6 if test $ac_cv_func_initscr = yes; then eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' else cf_save_LIBS="$LIBS" echo "$as_me:8696: checking for initscr in -l$cf_nculib_root" >&5 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6 LIBS="-l$cf_nculib_root $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 8700 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { initscr() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8712: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8715: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8718: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8721: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:8723: result: yes" >&5 echo "${ECHO_T}yes" >&6 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 echo "$as_me:8730: result: no" >&5 echo "${ECHO_T}no" >&6 cf_search= cf_library_path_list="" if test -n "${LDFLAGS}${LIBS}" ; then for cf_library_path in $LDFLAGS $LIBS do case $cf_library_path in (-L*) cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'` test "x$cf_library_path" != "xNONE" && \ test -d "$cf_library_path" && \ { test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path" test -d $cf_library_path/lib && cf_search="$cf_search $cf_library_path/lib" test -d $cf_library_path/lib/$cf_nculib_root && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root" test -d $cf_library_path/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib" test -d $cf_library_path/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib" test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" } cf_library_path_list="$cf_library_path_list $cf_search" ;; esac done fi cf_search= test "x$prefix" != "xNONE" && \ test -d "$prefix" && \ { test -n "$verbose" && echo " ... testing for lib-directories under $prefix" test -d $prefix/lib && cf_search="$cf_search $prefix/lib" test -d $prefix/lib/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root" test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" test -d $prefix/$cf_nculib_root/lib && cf_search="$cf_search $prefix/$cf_nculib_root/lib" test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" } for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ $HOME do test "x$cf_subdir_prefix" != "x$prefix" && \ test -d "$cf_subdir_prefix" && \ (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix" test -d $cf_subdir_prefix/lib && cf_search="$cf_search $cf_subdir_prefix/lib" test -d $cf_subdir_prefix/lib/$cf_nculib_root && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root" test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib" test -d $cf_subdir_prefix/$cf_nculib_root/lib && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib" test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root" } done cf_search="$cf_library_path_list $cf_search" for cf_libdir in $cf_search do echo "$as_me:8798: checking for -l$cf_nculib_root in $cf_libdir" >&5 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #line 8802 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { initscr() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8814: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8817: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8820: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8823: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:8825: result: yes" >&5 echo "${ECHO_T}yes" >&6 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes' break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 echo "$as_me:8832: result: no" >&5 echo "${ECHO_T}no" >&6 LIBS="$cf_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root if test $cf_found_library = no ; then { { echo "$as_me:8847: error: Cannot link $cf_nculib_root library" >&5 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} { (exit 1); exit 1; }; } fi fi if test -n "$cf_ncurses_LIBS" ; then echo "$as_me:8855: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6 cf_ncurses_SAVE="$LIBS" for p in $cf_ncurses_LIBS ; do q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` if test "$q" != "$LIBS" ; then LIBS="$q" fi done cat >conftest.$ac_ext <<_ACEOF #line 8865 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { initscr(); mousemask(0,0); tgoto((char *)0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:8877: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8880: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:8883: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8886: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:8888: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 echo "$as_me:8893: result: no" >&5 echo "${ECHO_T}no" >&6 LIBS="$cf_ncurses_SAVE" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h </dev/null` NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'` NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'` NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'` cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null` if test -z "$cf_cv_abi_version" then cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null` fi elif test "$NCURSES_CONFIG" != none ; then cf_version=`$NCURSES_CONFIG --version 2>/dev/null` NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'` NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'` NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'` # ABI version is not available from headers cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null` else for cf_name in MAJOR MINOR PATCH do cat >conftest.$ac_ext < AUTOCONF_$cf_name NCURSES_VERSION_$cf_name CF_EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out" { (eval echo "$as_me:8946: \"$cf_try\"") >&5 (eval $cf_try) 2>&5 ac_status=$? echo "$as_me:8949: \$? = $ac_status" >&5 (exit $ac_status); } if test -f conftest.out ; then cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[ ][ ]*//"` eval NCURSES_$cf_name=\"$cf_result\" # cat conftest.$ac_ext # cat conftest.out fi done cf_cv_abi_version=${NCURSES_MAJOR} fi cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} cf_cv_timestamp=`date` echo "$as_me:8967: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6 echo "$as_me:8970: checking if you want to have a library-prefix" >&5 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6 # Check whether --with-lib-prefix or --without-lib-prefix was given. if test "${with_lib_prefix+set}" = set; then withval="$with_lib_prefix" with_lib_prefix=$withval else with_lib_prefix=auto fi; echo "$as_me:8980: result: $with_lib_prefix" >&5 echo "${ECHO_T}$with_lib_prefix" >&6 if test $with_lib_prefix = auto then case $cf_cv_system_name in (OS/2*|os2*) if test "$DFT_LWR_MODEL" = libtool; then LIB_PREFIX='lib' else LIB_PREFIX='' fi ;; (*) LIB_PREFIX='lib' ;; esac cf_prefix=$LIB_PREFIX elif test $with_lib_prefix = no then LIB_PREFIX= else LIB_PREFIX=$with_lib_prefix fi LIB_SUFFIX= ############################################################################### if test X"$CC_G_OPT" = X"" ; then CC_G_OPT='-g' test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT='' fi echo "$as_me:9015: checking for default loader flags" >&5 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6 case $DFT_LWR_MODEL in (normal) LD_MODEL='' ;; (debug) LD_MODEL=$CC_G_OPT ;; (profile) LD_MODEL='-pg';; (shared) LD_MODEL='' ;; esac echo "$as_me:9023: result: $LD_MODEL" >&5 echo "${ECHO_T}$LD_MODEL" >&6 LD_RPATH_OPT= echo "$as_me:9027: checking for an rpath option" >&5 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6 case $cf_cv_system_name in (irix*) if test "$GCC" = yes; then LD_RPATH_OPT="-Wl,-rpath," else LD_RPATH_OPT="-rpath " fi ;; (linux*|gnu*|k*bsd*-gnu|freebsd*) LD_RPATH_OPT="-Wl,-rpath," ;; (openbsd[2-9].*|mirbsd*) LD_RPATH_OPT="-Wl,-rpath," ;; (dragonfly*) LD_RPATH_OPT="-rpath " ;; (netbsd*) LD_RPATH_OPT="-Wl,-rpath," ;; (osf*|mls+*) LD_RPATH_OPT="-rpath " ;; (solaris2*) LD_RPATH_OPT="-R" ;; (*) ;; esac echo "$as_me:9058: result: $LD_RPATH_OPT" >&5 echo "${ECHO_T}$LD_RPATH_OPT" >&6 case "x$LD_RPATH_OPT" in (x-R*) echo "$as_me:9063: checking if we need a space after rpath option" >&5 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6 cf_save_LIBS="$LIBS" cf_add_libs="${LD_RPATH_OPT}$libdir" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" cat >conftest.$ac_ext <<_ACEOF #line 9084 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:9096: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:9099: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:9102: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9105: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_rpath_space=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_rpath_space=yes fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" echo "$as_me:9115: result: $cf_rpath_space" >&5 echo "${ECHO_T}$cf_rpath_space" >&6 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " ;; esac RM_SHARED_OPTS= LOCAL_LDFLAGS= LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" : ${rel_builddir:=.} shlibdir=$libdir MAKE_DLLS="#" cf_cv_do_symlinks=no cf_ld_rpath_opt= test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" echo "$as_me:9136: checking if release/abi version should be used for shared libs" >&5 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6 # Check whether --with-shlib-version or --without-shlib-version was given. if test "${with_shlib_version+set}" = set; then withval="$with_shlib_version" test -z "$withval" && withval=auto case $withval in (yes) cf_cv_shlib_version=auto ;; (rel|abi|auto) cf_cv_shlib_version=$withval ;; (*) echo "$as_me:9151: result: $withval" >&5 echo "${ECHO_T}$withval" >&6 { { echo "$as_me:9153: error: option value must be one of: rel, abi, or auto" >&5 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;} { (exit 1); exit 1; }; } ;; esac else cf_cv_shlib_version=auto fi; echo "$as_me:9162: result: $cf_cv_shlib_version" >&5 echo "${ECHO_T}$cf_cv_shlib_version" >&6 cf_cv_rm_so_locs=no cf_try_cflags= # Some less-capable ports of gcc support only -fpic CC_SHARED_OPTS= cf_try_fPIC=no if test "$GCC" = yes then cf_try_fPIC=yes else case $cf_cv_system_name in (*linux*) # e.g., PGI compiler cf_try_fPIC=yes ;; esac fi if test "$cf_try_fPIC" = yes then echo "$as_me:9185: checking which $CC option to use" >&5 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" for CC_SHARED_OPTS in -fPIC -fpic '' do CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" cat >conftest.$ac_ext <<_ACEOF #line 9192 "configure" #include "confdefs.h" #include int main () { int x = 1 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:9204: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9207: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:9210: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9213: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done echo "$as_me:9222: result: $CC_SHARED_OPTS" >&5 echo "${ECHO_T}$CC_SHARED_OPTS" >&6 CFLAGS="$cf_save_CFLAGS" fi cf_cv_shlib_version_infix=no case $cf_cv_system_name in (aix4.3-9*|aix[5-7]*) if test "$GCC" = yes; then CC_SHARED_OPTS='-Wl,-brtl' MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@' else CC_SHARED_OPTS='-brtl' # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall" MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@' fi ;; (beos*) MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0' ;; (cygwin*) CC_SHARED_OPTS= MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}' RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a" cf_cv_shlib_version=cygdll cf_cv_shlib_version_infix=cygdll shlibdir=$bindir MAKE_DLLS= cat >mk_shared_lib.sh <<-CF_EOF #!$SHELL SHARED_LIB=\$1 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\` shift cat <<-EOF Linking shared library ** SHARED_LIB \$SHARED_LIB ** IMPORT_LIB \$IMPORT_LIB EOF exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB} CF_EOF chmod +x mk_shared_lib.sh ;; (msys*) CC_SHARED_OPTS= MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}' RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a" cf_cv_shlib_version=msysdll cf_cv_shlib_version_infix=msysdll shlibdir=$bindir MAKE_DLLS= cat >mk_shared_lib.sh <<-CF_EOF #!$SHELL SHARED_LIB=\$1 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\` shift cat <<-EOF Linking shared library ** SHARED_LIB \$SHARED_LIB ** IMPORT_LIB \$IMPORT_LIB EOF exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB} CF_EOF chmod +x mk_shared_lib.sh ;; (darwin*) cf_try_cflags="no-cpp-precomp" CC_SHARED_OPTS="-dynamic" MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi cf_cv_shlib_version_infix=yes echo "$as_me:9293: checking if ld -search_paths_first works" >&5 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF #line 9302 "configure" #include "confdefs.h" int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:9314: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:9317: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:9320: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9323: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ldflags_search_paths_first=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_ldflags_search_paths_first=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LDFLAGS=$cf_save_LDFLAGS fi echo "$as_me:9334: result: $cf_cv_ldflags_search_paths_first" >&5 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 if test $cf_cv_ldflags_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi ;; (hpux[7-8]*) # HP-UX 8.07 ld lacks "+b" option used for libdir search-list if test "$GCC" != yes; then CC_SHARED_OPTS='+Z' fi MK_SHARED_LIB='${LD} -b -o $@' INSTALL_LIB="-m 555" ;; (hpux*) # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}' else CC_SHARED_OPTS='+Z' LD_SHARED_OPTS='-Wl,+b,${libdir}' fi MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@' # HP-UX shared libraries must be executable, and should be # readonly to exploit a quirk in the memory manager. INSTALL_LIB="-m 555" ;; (interix*) test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel if test "$cf_cv_shlib_version" = rel; then cf_shared_soname='`basename .${REL_VERSION}`.${ABI_VERSION}' else cf_shared_soname='`basename `' fi CC_SHARED_OPTS= MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o ' ;; (irix*) if test "$cf_cv_enable_rpath" = yes ; then EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS" fi # tested with IRIX 5.2 and 'cc'. if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@' else MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@' fi cf_cv_rm_so_locs=yes ;; (linux*|gnu*|k*bsd*-gnu) if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_enable_rpath" = yes ; then EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel if test "$cf_cv_shlib_version" = rel; then cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}' else cf_cv_shared_soname='`basename $@`' fi MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' ;; (mingw*) cf_cv_shlib_version=mingw cf_cv_shlib_version_infix=mingw shlibdir=$bindir MAKE_DLLS= if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-Wl,--enable-auto-import" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS" fi CC_SHARED_OPTS= MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}' RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a" cat >mk_shared_lib.sh <<-CF_EOF #!$SHELL SHARED_LIB=\$1 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\` shift cat <<-EOF Linking shared library ** SHARED_LIB \$SHARED_LIB ** IMPORT_LIB \$IMPORT_LIB EOF exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB} CF_EOF chmod +x mk_shared_lib.sh ;; (openbsd[2-9].*|mirbsd*) if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_enable_rpath" = yes ; then EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS" fi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel if test "$cf_cv_shlib_version" = rel; then cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}' else cf_cv_shared_soname='`basename $@`' fi MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' ;; (nto-qnx*|openbsd*|freebsd[12].*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='${LD} -Bshareable -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; (dragonfly*|freebsd*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS" EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel if test "$cf_cv_shlib_version" = rel; then cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}' else cf_cv_shared_soname='`basename $@`' fi MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' ;; (netbsd*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS" if test "$cf_cv_shlib_version" = auto; then if test -f /usr/libexec/ld.elf_so; then cf_cv_shlib_version=abi else cf_cv_shlib_version=rel fi fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel if test "$cf_cv_shlib_version" = rel; then cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}' else cf_cv_shared_soname='`basename $@`' fi MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@' else MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@' fi ;; (osf*|mls+*) # tested with OSF/1 V3.2 and 'cc' # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`' case $host_os in (osf4*) MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@' if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi cf_cv_rm_so_locs=yes ;; (sco3.2v5*) # also uw2* and UW7: hops 13-Apr-98 # tested with osr5.0.5 if test "$GCC" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@' if test "$cf_cv_enable_rpath" = yes ; then # only way is to set LD_RUN_PATH but no switch for it RUN_PATH=$libdir fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel LINK_PROGS='LD_RUN_PATH=${libdir}' LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' ;; (sunos4*) # tested with SunOS 4.1.1 and gcc 2.7.0 if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='${LD} -assert pure-text -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; (solaris2*) # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_enable_rpath" = yes ; then EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel if test "$cf_cv_shlib_version" = rel; then cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}' else cf_cv_shared_soname='`basename $@`' fi if test "$GCC" != yes; then cf_save_CFLAGS="$CFLAGS" for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O do CFLAGS="$cf_shared_opts $cf_save_CFLAGS" cat >conftest.$ac_ext <<_ACEOF #line 9559 "configure" #include "confdefs.h" #include int main () { printf("Hello\n"); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:9571: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9574: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:9577: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9580: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done CFLAGS="$cf_save_CFLAGS" CC_SHARED_OPTS=$cf_shared_opts MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@' else MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@' fi ;; (sysv5uw7*|unix_sv*) # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='${LD} -d y -G -o $@' ;; (*) CC_SHARED_OPTS='unknown' MK_SHARED_LIB='echo unknown' ;; esac # This works if the last tokens in $MK_SHARED_LIB are the -o target. case "$cf_cv_shlib_version" in (rel|abi) case "$MK_SHARED_LIB" in (*'-o $@') test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes ;; (*) { echo "$as_me:9617: WARNING: ignored --with-shlib-version" >&5 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} ;; esac ;; esac if test -n "$cf_try_cflags" then cat > conftest.$ac_ext < int main(int argc, char *argv[]) { printf("hello\n"); return (argv[argc-1] == 0) ; } EOF cf_save_CFLAGS="$CFLAGS" for cf_opt in $cf_try_cflags do CFLAGS="$cf_save_CFLAGS -$cf_opt" echo "$as_me:9639: checking if CFLAGS option -$cf_opt works" >&5 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6 if { (eval echo "$as_me:9641: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9644: \$? = $ac_status" >&5 (exit $ac_status); }; then echo "$as_me:9646: result: yes" >&5 echo "${ECHO_T}yes" >&6 cf_save_CFLAGS="$CFLAGS" else echo "$as_me:9650: result: no" >&5 echo "${ECHO_T}no" >&6 fi done CFLAGS="$cf_save_CFLAGS" fi # RPATH_LIST is a colon-separated list of directories test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}" test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}" test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations" test -n "$verbose" && echo " CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6 echo "${as_me:-configure}:9665: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5 test -n "$verbose" && echo " MK_SHARED_LIB: $MK_SHARED_LIB" 1>&6 echo "${as_me:-configure}:9669: testing MK_SHARED_LIB: $MK_SHARED_LIB ..." 1>&5 # The test/sample programs in the original tree link using rpath option. # Make it optional for packagers. if test -n "$LOCAL_LDFLAGS" then echo "$as_me:9675: checking if you want to link sample programs with rpath option" >&5 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6 # Check whether --enable-rpath-link or --disable-rpath-link was given. if test "${enable_rpath_link+set}" = set; then enableval="$enable_rpath_link" with_rpath_link=$enableval else with_rpath_link=yes fi; echo "$as_me:9685: result: $with_rpath_link" >&5 echo "${ECHO_T}$with_rpath_link" >&6 if test "$with_rpath_link" = no then LOCAL_LDFLAGS= LOCAL_LDFLAGS2= fi fi ############################################################################### ### use option --enable-broken-linker to force on use of broken-linker support echo "$as_me:9697: checking if you want broken-linker support code" >&5 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6 # Check whether --enable-broken_linker or --disable-broken_linker was given. if test "${enable_broken_linker+set}" = set; then enableval="$enable_broken_linker" with_broken_linker=$enableval else with_broken_linker=${BROKEN_LINKER:-no} fi; echo "$as_me:9707: result: $with_broken_linker" >&5 echo "${ECHO_T}$with_broken_linker" >&6 BROKEN_LINKER=0 if test "$with_broken_linker" = yes ; then cat >>confdefs.h <<\EOF #define BROKEN_LINKER 1 EOF BROKEN_LINKER=1 elif test "$DFT_LWR_MODEL" = shared ; then case $cf_cv_system_name in (cygwin*) cat >>confdefs.h <<\EOF #define BROKEN_LINKER 1 EOF BROKEN_LINKER=1 test -n "$verbose" && echo " cygwin linker is broken anyway" 1>&6 echo "${as_me:-configure}:9727: testing cygwin linker is broken anyway ..." 1>&5 ;; esac fi # Check to define _XOPEN_SOURCE "automatically" cf_XOPEN_SOURCE=500 cf_POSIX_C_SOURCE=199506L cf_xopen_source= case $host_os in (aix[4-7]*) cf_xopen_source="-D_ALL_SOURCE" ;; (msys) cf_XOPEN_SOURCE=600 ;; (darwin[0-8].*) cf_xopen_source="-D_APPLE_C_SOURCE" ;; (darwin*) cf_xopen_source="-D_DARWIN_C_SOURCE" cf_XOPEN_SOURCE= ;; (freebsd*|dragonfly*) # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;; (hpux11*) cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; (hpux*) cf_xopen_source="-D_HPUX_SOURCE" ;; (irix[56].*) cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) echo "$as_me:9773: checking if we must define _GNU_SOURCE" >&5 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6 if test "${cf_cv_gnu_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 9780 "configure" #include "confdefs.h" #include int main () { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:9795: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9798: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:9801: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9804: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" cat >conftest.$ac_ext <<_ACEOF #line 9813 "configure" #include "confdefs.h" #include int main () { #ifdef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:9828: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9831: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:9834: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9837: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_gnu_source=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$cf_save" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:9852: result: $cf_cv_gnu_source" >&5 echo "${ECHO_T}$cf_cv_gnu_source" >&6 if test "$cf_cv_gnu_source" = yes then echo "$as_me:9857: checking if we should also define _DEFAULT_SOURCE" >&5 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6 if test "${cf_cv_default_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" cat >conftest.$ac_ext <<_ACEOF #line 9865 "configure" #include "confdefs.h" #include int main () { #ifdef _DEFAULT_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:9880: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9883: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:9886: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9889: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_default_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_default_source=yes fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:9900: result: $cf_cv_default_source" >&5 echo "${ECHO_T}$cf_cv_default_source" >&6 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE" fi ;; (minix*) cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this... ;; (mirbsd*) # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks and other headers which use u_int / u_short types cf_XOPEN_SOURCE= cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` echo "$as_me:9926: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else echo "${as_me:-configure}:9932: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF #line 9935 "configure" #include "confdefs.h" #include int main () { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:9950: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9953: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:9956: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9959: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[12]??*) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; (.2) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; (.*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF #line 9980 "configure" #include "confdefs.h" #include int main () { #ifdef _POSIX_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:9995: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9998: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:10001: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10004: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "${as_me:-configure}:10015: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" echo "${as_me:-configure}:10020: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF #line 10023 "configure" #include "confdefs.h" #include int main () { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:10038: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10041: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:10044: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10047: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_c_source=no fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:10063: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_posix_c_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi fi ;; (netbsd*) cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; (openbsd[4-9]*) # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=600 ;; (openbsd*) # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; (osf[45]*) cf_xopen_source="-D_OSF_SOURCE" ;; (nto-qnx*) cf_xopen_source="-D_QNX_SOURCE" ;; (sco*) # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; (solaris2.*) cf_xopen_source="-D__EXTENSIONS__" cf_cv_xopen_source=broken ;; (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2) cf_XOPEN_SOURCE= cf_POSIX_C_SOURCE= ;; (*) echo "$as_me:10201: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 10208 "configure" #include "confdefs.h" #include #include #include int main () { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:10227: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10230: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:10233: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10236: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >conftest.$ac_ext <<_ACEOF #line 10245 "configure" #include "confdefs.h" #include #include #include int main () { #ifdef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:10264: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10267: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:10270: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10273: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_xopen_source=$cf_XOPEN_SOURCE fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$cf_save" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:10288: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then CFLAGS=`echo "$CFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_temp_xopen_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi fi cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` echo "$as_me:10416: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else echo "${as_me:-configure}:10422: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF #line 10425 "configure" #include "confdefs.h" #include int main () { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:10440: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10443: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:10446: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10449: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[12]??*) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; (.2) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; (.*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF #line 10470 "configure" #include "confdefs.h" #include int main () { #ifdef _POSIX_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:10485: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10488: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:10491: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10494: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "${as_me:-configure}:10505: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" echo "${as_me:-configure}:10510: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF #line 10513 "configure" #include "confdefs.h" #include int main () { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:10528: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10531: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:10534: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10537: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_c_source=no fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:10553: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_posix_c_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi fi ;; esac if test -n "$cf_xopen_source" ; then cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_xopen_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 echo "${as_me:-configure}:10745: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6 echo "${as_me:-configure}:10755: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6 echo "${as_me:-configure}:10765: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi fi if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then echo "$as_me:10775: checking if _XOPEN_SOURCE really is set" >&5 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line 10778 "configure" #include "confdefs.h" #include int main () { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:10793: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10796: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:10799: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10802: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_XOPEN_SOURCE_set=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_XOPEN_SOURCE_set=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:10811: result: $cf_XOPEN_SOURCE_set" >&5 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6 if test $cf_XOPEN_SOURCE_set = yes then cat >conftest.$ac_ext <<_ACEOF #line 10816 "configure" #include "confdefs.h" #include int main () { #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:10831: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10834: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:10837: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10840: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_XOPEN_SOURCE_set_ok=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_XOPEN_SOURCE_set_ok=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test $cf_XOPEN_SOURCE_set_ok = no then { echo "$as_me:10851: WARNING: _XOPEN_SOURCE is lower than requested" >&5 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;} fi else echo "$as_me:10856: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 10863 "configure" #include "confdefs.h" #include #include #include int main () { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:10882: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10885: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:10888: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10891: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >conftest.$ac_ext <<_ACEOF #line 10900 "configure" #include "confdefs.h" #include #include #include int main () { #ifdef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:10919: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10922: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:10925: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10928: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_xopen_source=$cf_XOPEN_SOURCE fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$cf_save" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:10943: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then CFLAGS=`echo "$CFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_temp_xopen_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi fi fi fi # Check whether --enable-largefile or --disable-largefile was given. if test "${enable_largefile+set}" = set; then enableval="$enable_largefile" fi; if test "$enable_largefile" != no; then echo "$as_me:11068: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF #line 11080 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:11100: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11103: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:11106: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11109: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext if { (eval echo "$as_me:11119: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11122: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:11125: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11128: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi echo "$as_me:11142: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi echo "$as_me:11148: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF #line 11156 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:11176: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11179: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:11182: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11185: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 11194 "configure" #include "confdefs.h" #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:11215: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11218: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:11221: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11224: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext break done fi echo "$as_me:11235: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 if test "$ac_cv_sys_file_offset_bits" != no; then cat >>confdefs.h <&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF #line 11253 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:11273: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11276: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:11279: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11282: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 11291 "configure" #include "confdefs.h" #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:11312: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11315: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:11318: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11321: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext break done fi echo "$as_me:11332: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6 if test "$ac_cv_sys_large_files" != no; then cat >>confdefs.h <&5 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do ac_cv_sys_largefile_source=no cat >conftest.$ac_ext <<_ACEOF #line 11353 "configure" #include "confdefs.h" #include int main () { return !fseeko; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:11365: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11368: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:11371: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11374: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 11383 "configure" #include "confdefs.h" #define _LARGEFILE_SOURCE 1 #include int main () { return !fseeko; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:11396: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11399: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:11402: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11405: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_source=1; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext break done fi echo "$as_me:11416: result: $ac_cv_sys_largefile_source" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 if test "$ac_cv_sys_largefile_source" != no; then cat >>confdefs.h <&5 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6 if test "${ac_cv_func_fseeko+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 11436 "configure" #include "confdefs.h" #include int main () { return fseeko && fseeko (stdin, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:11448: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:11451: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:11454: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11457: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fseeko=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_fseeko=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:11467: result: $ac_cv_func_fseeko" >&5 echo "${ECHO_T}$ac_cv_func_fseeko" >&6 if test $ac_cv_func_fseeko = yes; then cat >>confdefs.h <<\EOF #define HAVE_FSEEKO 1 EOF fi # Normally we would collect these definitions in the config.h, # but (like _XOPEN_SOURCE), some environments rely on having these # defined before any of the system headers are included. Another # case comes up with C++, e.g., on AIX the compiler compiles the # header files by themselves before looking at the body files it is # told to compile. For ncurses, those header files do not include # the config.h test "$ac_cv_sys_large_files" != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES " test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE " test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits " echo "$as_me:11488: checking whether to use struct dirent64" >&5 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6 if test "${cf_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 11495 "configure" #include "confdefs.h" #pragma GCC diagnostic error "-Wincompatible-pointer-types" #include #include int main () { /* if transitional largefile support is setup, this is true */ extern struct dirent64 * readdir(DIR *); struct dirent64 *x = readdir((DIR *)0); struct dirent *y = readdir((DIR *)0); int z = x - y; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:11517: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11520: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:11523: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11526: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_struct_dirent64=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_struct_dirent64=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:11537: result: $cf_cv_struct_dirent64" >&5 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6 test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF #define HAVE_STRUCT_DIRENT64 1 EOF fi ### Enable compiling-in rcs id's echo "$as_me:11547: checking if RCS identifiers should be compiled-in" >&5 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6 # Check whether --with-rcs-ids or --without-rcs-ids was given. if test "${with_rcs_ids+set}" = set; then withval="$with_rcs_ids" with_rcs_ids=$withval else with_rcs_ids=no fi; echo "$as_me:11557: result: $with_rcs_ids" >&5 echo "${ECHO_T}$with_rcs_ids" >&6 test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF #define USE_RCS_IDS 1 EOF ############################################################################### ### Note that some functions (such as const) are normally disabled anyway. echo "$as_me:11567: checking if you want to build with function extensions" >&5 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6 # Check whether --enable-ext-funcs or --disable-ext-funcs was given. if test "${enable_ext_funcs+set}" = set; then enableval="$enable_ext_funcs" with_ext_funcs=$enableval else with_ext_funcs=yes fi; echo "$as_me:11577: result: $with_ext_funcs" >&5 echo "${ECHO_T}$with_ext_funcs" >&6 if test "$with_ext_funcs" = yes ; then NCURSES_EXT_FUNCS=1 cat >>confdefs.h <<\EOF #define HAVE_USE_DEFAULT_COLORS 1 EOF cat >>confdefs.h <<\EOF #define NCURSES_EXT_FUNCS 1 EOF else NCURSES_EXT_FUNCS=0 fi ### use option --enable-const to turn on use of const beyond that in XSI. echo "$as_me:11595: checking for extended use of const keyword" >&5 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6 # Check whether --enable-const or --disable-const was given. if test "${enable_const+set}" = set; then enableval="$enable_const" with_ext_const=$enableval else with_ext_const=no fi; echo "$as_me:11605: result: $with_ext_const" >&5 echo "${ECHO_T}$with_ext_const" >&6 NCURSES_CONST='/*nothing*/' if test "$with_ext_const" = yes ; then NCURSES_CONST=const fi ############################################################################### # These options are relatively safe to experiment with. echo "$as_me:11615: checking if you want all development code" >&5 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6 # Check whether --with-develop or --without-develop was given. if test "${with_develop+set}" = set; then withval="$with_develop" with_develop=$withval else with_develop=no fi; echo "$as_me:11625: result: $with_develop" >&5 echo "${ECHO_T}$with_develop" >&6 ############################################################################### # These are just experimental, probably should not be in a package: # This is still experimental (20080329), but should ultimately be moved to # the script-block --with-normal, etc. echo "$as_me:11634: checking if you want to link with the pthread library" >&5 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6 # Check whether --with-pthread or --without-pthread was given. if test "${with_pthread+set}" = set; then withval="$with_pthread" with_pthread=$withval else with_pthread=no fi; echo "$as_me:11644: result: $with_pthread" >&5 echo "${ECHO_T}$with_pthread" >&6 if test "$with_pthread" != no ; then echo "$as_me:11648: checking for pthread.h" >&5 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 11654 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:11658: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:11664: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_pthread_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_pthread_h=no fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:11683: result: $ac_cv_header_pthread_h" >&5 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 if test $ac_cv_header_pthread_h = yes; then cat >>confdefs.h <<\EOF #define HAVE_PTHREADS_H 1 EOF for cf_lib_pthread in pthread c_r do echo "$as_me:11693: checking if we can link with the $cf_lib_pthread library" >&5 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6 cf_save_LIBS="$LIBS" cf_add_libs="-l$cf_lib_pthread" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" cat >conftest.$ac_ext <<_ACEOF #line 11714 "configure" #include "confdefs.h" #include int main () { int rc = pthread_create(0,0,0,0); int r2 = pthread_mutexattr_settype(0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:11731: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:11734: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:11737: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11740: \$? = $ac_status" >&5 (exit $ac_status); }; }; then with_pthread=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 with_pthread=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" echo "$as_me:11750: result: $with_pthread" >&5 echo "${ECHO_T}$with_pthread" >&6 test "$with_pthread" = yes && break done if test "$with_pthread" = yes ; then cf_add_libs="-l$cf_lib_pthread" # Filter out duplicates - this happens with badly-designed ".pc" files... for cf_add_1lib in $LIBS do for cf_add_2lib in $cf_add_libs do if test "x$cf_add_1lib" = "x$cf_add_2lib" then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" done LIBS="$cf_add_libs" cat >>confdefs.h <<\EOF #define HAVE_LIBPTHREADS 1 EOF else { { echo "$as_me:11778: error: Cannot link with pthread library" >&5 echo "$as_me: error: Cannot link with pthread library" >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:11787: checking if you want to use weak-symbols for pthreads" >&5 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6 # Check whether --enable-weak-symbols or --disable-weak-symbols was given. if test "${enable_weak_symbols+set}" = set; then enableval="$enable_weak_symbols" use_weak_symbols=$withval else use_weak_symbols=no fi; echo "$as_me:11797: result: $use_weak_symbols" >&5 echo "${ECHO_T}$use_weak_symbols" >&6 if test "$use_weak_symbols" = yes ; then echo "$as_me:11801: checking if $CC supports weak symbols" >&5 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6 if test "${cf_cv_weak_symbols+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 11808 "configure" #include "confdefs.h" #include int main () { #if defined(__GNUC__) # if defined __USE_ISOC99 # define _cat_pragma(exp) _Pragma(#exp) # define _weak_pragma(exp) _cat_pragma(weak name) # else # define _weak_pragma(exp) # endif # define _declare(name) __extension__ extern __typeof__(name) name # define weak_symbol(name) _weak_pragma(name) _declare(name) __attribute__((weak)) #endif weak_symbol(fopen); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:11834: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11837: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:11840: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11843: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_weak_symbols=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_weak_symbols=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:11854: result: $cf_cv_weak_symbols" >&5 echo "${ECHO_T}$cf_cv_weak_symbols" >&6 else cf_cv_weak_symbols=no fi if test $cf_cv_weak_symbols = yes ; then cat >>confdefs.h <<\EOF #define USE_WEAK_SYMBOLS 1 EOF fi PTHREAD= if test "$with_pthread" = "yes" ; then cat >>confdefs.h <<\EOF #define USE_PTHREADS 1 EOF enable_reentrant=yes if test $cf_cv_weak_symbols = yes ; then PTHREAD=-lpthread fi fi # OpenSUSE is installing ncurses6, using reentrant option. echo "$as_me:11883: checking for _nc_TABSIZE" >&5 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 11889 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _nc_TABSIZE (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _nc_TABSIZE (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE) choke me #else f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:11920: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:11923: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:11926: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11929: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__nc_TABSIZE=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func__nc_TABSIZE=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:11939: result: $ac_cv_func__nc_TABSIZE" >&5 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6 if test $ac_cv_func__nc_TABSIZE = yes; then assume_reentrant=yes else assume_reentrant=no fi # Reentrant code has to be opaque; there's little advantage to making ncurses # opaque outside of that, so there is no --enable-opaque option. We can use # this option without --with-pthreads, but this will be always set for # pthreads. echo "$as_me:11951: checking if you want experimental reentrant code" >&5 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6 # Check whether --enable-reentrant or --disable-reentrant was given. if test "${enable_reentrant+set}" = set; then enableval="$enable_reentrant" with_reentrant=$enableval else with_reentrant=$assume_reentrant fi; echo "$as_me:11961: result: $with_reentrant" >&5 echo "${ECHO_T}$with_reentrant" >&6 if test "$with_reentrant" = yes ; then cf_cv_enable_reentrant=1 if test $cf_cv_weak_symbols = yes ; then # remove pthread library from $LIBS LIBS=`echo "$LIBS" | sed -e 's/-lpthread[ ]//g' -e 's/-lpthread$//'` elif test "$assume_reentrant" = no ; then LIB_SUFFIX="t${LIB_SUFFIX}" fi cat >>confdefs.h <<\EOF #define USE_REENTRANT 1 EOF else cf_cv_enable_reentrant=0 fi ### Allow using a different wrap-prefix if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then echo "$as_me:11984: checking for prefix used to wrap public variables" >&5 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6 # Check whether --with-wrap-prefix or --without-wrap-prefix was given. if test "${with_wrap_prefix+set}" = set; then withval="$with_wrap_prefix" NCURSES_WRAP_PREFIX=$withval else NCURSES_WRAP_PREFIX=_nc_ fi; echo "$as_me:11994: result: $NCURSES_WRAP_PREFIX" >&5 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6 else NCURSES_WRAP_PREFIX=_nc_ fi cat >>confdefs.h <&5 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. if test "${enable_echo+set}" = set; then enableval="$enable_echo" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then ECHO_LT='--silent' ECHO_LD='@echo linking $@;' RULE_CC='@echo compiling $<' SHOW_CC='@echo compiling $@' ECHO_CC='@' else ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' fi else enableval=yes ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' fi; echo "$as_me:12042: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 ### use option --enable-warnings to turn on all gcc warnings echo "$as_me:12046: checking if you want to see compiler warnings" >&5 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6 # Check whether --enable-warnings or --disable-warnings was given. if test "${enable_warnings+set}" = set; then enableval="$enable_warnings" with_warnings=$enableval fi; echo "$as_me:12054: result: $with_warnings" >&5 echo "${ECHO_T}$with_warnings" >&6 if test "x$with_warnings" = "xyes"; then ADAFLAGS="$ADAFLAGS -gnatg" INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in (linux*|gnu*) echo "$as_me:12066: checking if this is really Intel C compiler" >&5 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -no-gcc" cat >conftest.$ac_ext <<_ACEOF #line 12071 "configure" #include "confdefs.h" int main () { #ifdef __INTEL_COMPILER #else make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:12088: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:12091: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:12094: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12097: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" echo "$as_me:12108: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac fi CLANG_COMPILER=no if test "$GCC" = yes ; then echo "$as_me:12117: checking if this is really Clang C compiler" >&5 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Qunused-arguments" cat >conftest.$ac_ext <<_ACEOF #line 12122 "configure" #include "confdefs.h" int main () { #ifdef __clang__ #else make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:12139: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:12142: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:12145: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12148: \$? = $ac_status" >&5 (exit $ac_status); }; }; then CLANG_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" echo "$as_me:12159: result: $CLANG_COMPILER" >&5 echo "${ECHO_T}$CLANG_COMPILER" >&6 fi cat > conftest.$ac_ext <&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" for cf_opt in \ wd1419 \ wd1683 \ wd1684 \ wd193 \ wd593 \ wd279 \ wd810 \ wd869 \ wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" if { (eval echo "$as_me:12197: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:12200: \$? = $ac_status" >&5 (exit $ac_status); }; then test -n "$verbose" && echo "$as_me:12202: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done CFLAGS="$cf_save_CFLAGS" elif test "$GCC" = yes then { echo "$as_me:12211: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS= cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs" test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings= for cf_opt in W Wall \ Wbad-function-cast \ Wcast-align \ Wcast-qual \ Wdeclaration-after-statement \ Wextra \ Winline \ Wmissing-declarations \ Wmissing-prototypes \ Wnested-externs \ Wpointer-arith \ Wshadow \ Wstrict-prototypes \ Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" if { (eval echo "$as_me:12235: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:12238: \$? = $ac_status" >&5 (exit $ac_status); }; then test -n "$verbose" && echo "$as_me:12240: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in (Wcast-qual) CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES" ;; (Winline) case $GCC_VERSION in ([34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 echo "${as_me:-configure}:12251: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac ;; (Wpointer-arith) case $GCC_VERSION in ([12].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 echo "${as_me:-configure}:12261: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac ;; esac EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done CFLAGS="$cf_save_CFLAGS" fi rm -rf conftest* fi if test "$GCC" = yes then cat > conftest.i <&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <&5 case $cf_attribute in (printf) cf_printf_attribute=yes cat >conftest.h <conftest.h <conftest.h <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:12349: \$? = $ac_status" >&5 (exit $ac_status); }; then test -n "$verbose" && echo "$as_me:12351: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h case $cf_attribute in (noreturn) cat >>confdefs.h <>confdefs.h <<\EOF #define GCC_PRINTF 1 EOF fi cat >>confdefs.h <>confdefs.h <<\EOF #define GCC_SCANF 1 EOF fi cat >>confdefs.h <>confdefs.h <>confdefs.h fi rm -rf conftest* fi ### use option --enable-assertions to turn on generation of assertion code echo "$as_me:12411: checking if you want to enable runtime assertions" >&5 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6 # Check whether --enable-assertions or --disable-assertions was given. if test "${enable_assertions+set}" = set; then enableval="$enable_assertions" with_assertions=$enableval else with_assertions=no fi; echo "$as_me:12421: result: $with_assertions" >&5 echo "${ECHO_T}$with_assertions" >&6 if test -n "$GCC" then if test "$with_assertions" = no then CPPFLAGS="$CPPFLAGS -DNDEBUG" else ADAFLAGS="$ADAFLAGS -gnata" fi fi ### use option --disable-leaks to suppress "permanent" leaks, for testing cat >>confdefs.h <<\EOF #define HAVE_NC_ALLOC_H 1 EOF ### use option --enable-expanded to generate certain macros as functions # Check whether --enable-expanded or --disable-expanded was given. if test "${enable_expanded+set}" = set; then enableval="$enable_expanded" test "$enableval" = yes && cat >>confdefs.h <<\EOF #define NCURSES_EXPANDED 1 EOF fi; ### use option --disable-macros to suppress macros in favor of functions # Check whether --enable-macros or --disable-macros was given. if test "${enable_macros+set}" = set; then enableval="$enable_macros" test "$enableval" = no && cat >>confdefs.h <<\EOF #define NCURSES_NOMACROS 1 EOF fi; # Normally we only add trace() to the debug-library. Allow this to be # extended to all models of the ncurses library: cf_all_traces=no case "$CFLAGS $CPPFLAGS" in (*-DTRACE*) cf_all_traces=yes ;; esac echo "$as_me:12474: checking whether to add trace feature to all models" >&5 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6 # Check whether --with-trace or --without-trace was given. if test "${with_trace+set}" = set; then withval="$with_trace" cf_with_trace=$withval else cf_with_trace=$cf_all_traces fi; echo "$as_me:12484: result: $cf_with_trace" >&5 echo "${ECHO_T}$cf_with_trace" >&6 if test "$cf_with_trace" = yes ; then ADA_TRACE=TRUE cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -DTRACE do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi else ADA_TRACE=FALSE fi echo "$as_me:12592: checking if we want to use GNAT projects" >&5 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6 # Check whether --enable-gnat-projects or --disable-gnat-projects was given. if test "${enable_gnat_projects+set}" = set; then enableval="$enable_gnat_projects" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_gnat_projects=no else enable_gnat_projects=yes fi else enableval=yes enable_gnat_projects=yes fi; echo "$as_me:12609: result: $enable_gnat_projects" >&5 echo "${ECHO_T}$enable_gnat_projects" >&6 ### Checks for libraries. case $cf_cv_system_name in (*mingw32*) ;; (*) echo "$as_me:12617: checking for gettimeofday" >&5 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6 if test "${ac_cv_func_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 12623 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gettimeofday (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gettimeofday (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday) choke me #else f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:12654: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:12657: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:12660: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12663: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gettimeofday=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_gettimeofday=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:12673: result: $ac_cv_func_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6 if test $ac_cv_func_gettimeofday = yes; then cat >>confdefs.h <<\EOF #define HAVE_GETTIMEOFDAY 1 EOF else echo "$as_me:12682: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 12690 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gettimeofday (); int main () { gettimeofday (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:12709: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:12712: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:12715: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12718: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gettimeofday=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_bsd_gettimeofday=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:12729: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 if test $ac_cv_lib_bsd_gettimeofday = yes; then cat >>confdefs.h <<\EOF #define HAVE_GETTIMEOFDAY 1 EOF LIBS="$LIBS -lbsd" fi fi ;; esac ### Checks for header files. echo "$as_me:12745: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 12751 "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:12759: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:12765: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line 12787 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -rf conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line 12805 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -rf conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line 12826 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) $ac_main_return(2); $ac_main_return (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:12852: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:12855: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:12857: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12860: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:12873: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:12889: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 12895 "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:12901: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:12904: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:12907: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12910: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:12920: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for signed char... $ECHO_C" >&6 if test "${ac_cv_type_signed_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 12936 "configure" #include "confdefs.h" $ac_includes_default int main () { if ((signed char *) 0) return 0; if (sizeof (signed char)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:12951: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:12954: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:12957: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12960: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signed_char=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_type_signed_char=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:12970: result: $ac_cv_type_signed_char" >&5 echo "${ECHO_T}$ac_cv_type_signed_char" >&6 echo "$as_me:12973: checking size of signed char" >&5 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6 if test "${ac_cv_sizeof_signed_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_signed_char" = yes; then if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF #line 12982 "configure" #include "confdefs.h" $ac_includes_default int main () { int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)] ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:12994: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:12997: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:13000: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13003: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF #line 13008 "configure" #include "confdefs.h" $ac_includes_default int main () { int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)] ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:13020: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:13023: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:13026: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13029: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF #line 13045 "configure" #include "confdefs.h" $ac_includes_default int main () { int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)] ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:13057: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:13060: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:13063: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13066: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.$ac_objext conftest.$ac_ext done fi rm -f conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF #line 13082 "configure" #include "confdefs.h" $ac_includes_default int main () { int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)] ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:13094: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:13097: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:13100: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13103: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done ac_cv_sizeof_signed_char=$ac_lo else if test "$cross_compiling" = yes; then { { echo "$as_me:13116: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line 13121 "configure" #include "confdefs.h" $ac_includes_default int main () { FILE *f = fopen ("conftest.val", "w"); if (!f) $ac_main_return (1); fprintf (f, "%d", (sizeof (signed char))); fclose (f); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:13137: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13140: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:13142: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13145: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_signed_char=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_signed_char=0 fi fi echo "$as_me:13161: result: $ac_cv_sizeof_signed_char" >&5 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6 cat >>confdefs.h <&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 13173 "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:13181: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:13187: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line 13209 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -rf conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line 13227 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -rf conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line 13248 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) $ac_main_return(2); $ac_main_return (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:13274: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13277: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:13279: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13282: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:13295: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` echo "$as_me:13308: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 13314 "configure" #include "confdefs.h" #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:13329: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:13332: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:13335: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13338: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:13348: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6 if test "${ac_cv_lib_dir_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldir $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 13369 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:13388: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13391: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:13394: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13397: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dir_opendir=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dir_opendir=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:13408: result: $ac_cv_lib_dir_opendir" >&5 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6 if test $ac_cv_lib_dir_opendir = yes; then LIBS="$LIBS -ldir" fi else echo "$as_me:13415: checking for opendir in -lx" >&5 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6 if test "${ac_cv_lib_x_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lx $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 13423 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:13442: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13445: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:13448: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13451: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_x_opendir=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_x_opendir=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:13462: result: $ac_cv_lib_x_opendir" >&5 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6 if test $ac_cv_lib_x_opendir = yes; then LIBS="$LIBS -lx" fi fi echo "$as_me:13470: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 13476 "configure" #include "confdefs.h" #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:13492: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:13495: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:13498: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13501: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:13511: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\EOF #define TIME_WITH_SYS_TIME 1 EOF fi ### checks for compiler characteristics ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return echo "$as_me:13529: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 13535 "configure" #include "confdefs.h" int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:13593: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:13596: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:13599: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13602: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:13612: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\EOF #define const EOF fi ### Checks for external-data echo "$as_me:13624: checking if data-only library module links" >&5 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6 if test "${cf_cv_link_dataonly+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f conftest.a cat >conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:13638: \$? = $ac_status" >&5 (exit $ac_status); } ; then mv conftest.o data.o && \ ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:13661: \$? = $ac_status" >&5 (exit $ac_status); }; then mv conftest.o func.o && \ ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext func.o ( eval $RANLIB conftest.a ) 2>&5 >/dev/null cf_saveLIBS="$LIBS" LIBS="conftest.a $LIBS" if test "$cross_compiling" = yes; then cf_cv_link_dataonly=unknown else cat >conftest.$ac_ext <<_ACEOF #line 13674 "configure" #include "confdefs.h" int main(void) { extern int testfunc(); ${cf_cv_main_return:-return} (!testfunc()); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:13685: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13688: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:13690: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13693: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_link_dataonly=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_link_dataonly=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi LIBS="$cf_saveLIBS" fi echo "$as_me:13708: result: $cf_cv_link_dataonly" >&5 echo "${ECHO_T}$cf_cv_link_dataonly" >&6 if test "$cf_cv_link_dataonly" = no ; then cat >>confdefs.h <<\EOF #define BROKEN_LINKER 1 EOF BROKEN_LINKER=1 fi ### Checks for library functions. for ac_header in \ unistd.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:13727: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 13733 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:13737: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:13743: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:13762: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6 if test "${cf_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -rf conftest* if test "$cross_compiling" = yes; then cf_cv_func_mkstemp=maybe else cat >conftest.$ac_ext <<_ACEOF #line 13783 "configure" #include "confdefs.h" #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include int main(void) { char *tmpl = "conftestXXXXXX"; char name[2][80]; int n; int result = 0; int fd; struct stat sb; umask(077); for (n = 0; n < 2; ++n) { strcpy(name[n], tmpl); if ((fd = mkstemp(name[n])) >= 0) { if (!strcmp(name[n], tmpl) || stat(name[n], &sb) != 0 || (sb.st_mode & S_IFMT) != S_IFREG || (sb.st_mode & 077) != 0) { result = 1; } close(fd); } } if (result == 0 && !strcmp(name[0], name[1])) result = 1; ${cf_cv_main_return:-return}(result); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:13824: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13827: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:13829: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13832: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_mkstemp=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_func_mkstemp=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:13847: result: $cf_cv_func_mkstemp" >&5 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 if test "x$cf_cv_func_mkstemp" = xmaybe ; then echo "$as_me:13850: checking for mkstemp" >&5 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 if test "${ac_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 13856 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char mkstemp (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char mkstemp (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_mkstemp) || defined (__stub___mkstemp) choke me #else f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:13887: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13890: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:13893: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13896: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mkstemp=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_mkstemp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:13906: result: $ac_cv_func_mkstemp" >&5 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 fi if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then cat >>confdefs.h <<\EOF #define HAVE_MKSTEMP 1 EOF fi if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'` CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'` fi cf_with_ada=yes if test "$cf_with_ada" != "no" ; then cf_ada_make=gnatmake # Extract the first word of "$cf_ada_make", so it can be a program name with args. set dummy $cf_ada_make; ac_word=$2 echo "$as_me:13929: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_gnat_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$gnat_exists"; then ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_gnat_exists="yes" echo "$as_me:13944: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no" fi fi gnat_exists=$ac_cv_prog_gnat_exists if test -n "$gnat_exists"; then echo "$as_me:13953: result: $gnat_exists" >&5 echo "${ECHO_T}$gnat_exists" >&6 else echo "$as_me:13956: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= cf_cv_prog_gnat_correct=no else echo "$as_me:13965: checking for gnat version" >&5 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ grep '[0-9].[0-9][0-9]*' |\ sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` echo "$as_me:13970: result: $cf_gnat_version" >&5 echo "${ECHO_T}$cf_gnat_version" >&6 case $cf_gnat_version in (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9]) cf_cv_prog_gnat_correct=yes ;; (*) { echo "$as_me:13978: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;} cf_cv_prog_gnat_correct=no ;; esac # Extract the first word of "m4", so it can be a program name with args. set dummy m4; ac_word=$2 echo "$as_me:13986: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_M4_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$M4_exists"; then ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_M4_exists="yes" echo "$as_me:14001: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no" fi fi M4_exists=$ac_cv_prog_M4_exists if test -n "$M4_exists"; then echo "$as_me:14010: result: $M4_exists" >&5 echo "${ECHO_T}$M4_exists" >&6 else echo "$as_me:14013: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$ac_cv_prog_M4_exists" = no; then cf_cv_prog_gnat_correct=no echo Ada95 binding required program m4 not found. Ada95 binding disabled. fi if test "$cf_cv_prog_gnat_correct" = yes; then echo "$as_me:14022: checking if GNAT works" >&5 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6 rm -rf conftest* *~conftest* cat >>conftest.ads <>conftest.adb <&5 2>&1 ) ; then if ( ./conftest 1>&5 2>&1 ) ; then cf_cv_prog_gnat_correct=yes else cf_cv_prog_gnat_correct=no fi else cf_cv_prog_gnat_correct=no fi rm -rf conftest* *~conftest* echo "$as_me:14050: result: $cf_cv_prog_gnat_correct" >&5 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6 fi fi if test "$cf_cv_prog_gnat_correct" = yes; then echo "$as_me:14057: checking optimization options for ADAFLAGS" >&5 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6 case "$CFLAGS" in (*-g*) ADAFLAGS="$ADAFLAGS -g" ;; esac case "$CFLAGS" in (*-O*) cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[ ].*//'` ADAFLAGS="$ADAFLAGS $cf_O_flag" ;; esac echo "$as_me:14074: result: $ADAFLAGS" >&5 echo "${ECHO_T}$ADAFLAGS" >&6 echo "$as_me:14077: checking if GNATPREP supports -T option" >&5 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6 if test "${cf_cv_gnatprep_opt_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_gnatprep_opt_t=no gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes fi echo "$as_me:14087: result: $cf_cv_gnatprep_opt_t" >&5 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS" echo "$as_me:14091: checking if GNAT supports generics" >&5 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6 case $cf_gnat_version in (3.[1-9]*|[4-9].*) cf_gnat_generics=yes ;; (*) cf_gnat_generics=no ;; esac echo "$as_me:14101: result: $cf_gnat_generics" >&5 echo "${ECHO_T}$cf_gnat_generics" >&6 if test "$cf_gnat_generics" = yes then cf_compile_generics=generics cf_generic_objects="\${GENOBJS}" else cf_compile_generics= cf_generic_objects= fi echo "$as_me:14113: checking if GNAT supports SIGINT" >&5 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6 if test "${cf_cv_gnat_sigint+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -rf conftest* *~conftest* cat >>conftest.ads <>conftest.adb <&5 2>&1 ) ; then cf_cv_gnat_sigint=yes else cf_cv_gnat_sigint=no fi rm -rf conftest* *~conftest* fi echo "$as_me:14161: result: $cf_cv_gnat_sigint" >&5 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6 if test $cf_cv_gnat_sigint = yes ; then USE_GNAT_SIGINT="" else USE_GNAT_SIGINT="#" fi cf_gnat_libraries=no cf_gnat_projects=no if test "$enable_gnat_projects" != no ; then echo "$as_me:14174: checking if GNAT supports project files" >&5 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6 case $cf_gnat_version in (3.[0-9]*) ;; (*) case $cf_cv_system_name in (cygwin*|msys*) ;; (*) mkdir conftest.src conftest.bin conftest.lib cd conftest.src rm -rf conftest* *~conftest* cat >>library.gpr <>confpackage.ads <>confpackage.adb <&5 2>&1 ) ; then cf_gnat_projects=yes fi cd .. if test -f conftest.lib/confpackage.ali then cf_gnat_libraries=yes fi rm -rf conftest* *~conftest* ;; esac ;; esac echo "$as_me:14234: result: $cf_gnat_projects" >&5 echo "${ECHO_T}$cf_gnat_projects" >&6 fi # enable_gnat_projects if test $cf_gnat_projects = yes then echo "$as_me:14240: checking if GNAT supports libraries" >&5 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6 echo "$as_me:14242: result: $cf_gnat_libraries" >&5 echo "${ECHO_T}$cf_gnat_libraries" >&6 fi if test "$cf_gnat_projects" = yes then USE_OLD_MAKERULES="#" USE_GNAT_PROJECTS="" else USE_OLD_MAKERULES="" USE_GNAT_PROJECTS="#" fi if test "$cf_gnat_libraries" = yes then USE_GNAT_LIBRARIES="" else USE_GNAT_LIBRARIES="#" fi echo "$as_me:14262: checking for ada-compiler" >&5 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6 # Check whether --with-ada-compiler or --without-ada-compiler was given. if test "${with_ada_compiler+set}" = set; then withval="$with_ada_compiler" cf_ada_compiler=$withval else cf_ada_compiler=gnatmake fi; echo "$as_me:14273: result: $cf_ada_compiler" >&5 echo "${ECHO_T}$cf_ada_compiler" >&6 cf_ada_package=terminal_interface echo "$as_me:14278: checking for ada-include" >&5 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6 # Check whether --with-ada-include or --without-ada-include was given. if test "${with_ada_include+set}" = set; then withval="$with_ada_include" else withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}" fi; if test -n "$prefix/share/ada/adainclude" ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".$withval" in (.\$\(*\)*|.\'*\'*) ;; (..|./*|.\\*) ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX ;; (.\${*prefix}*|.\${*dir}*) eval withval="$withval" case ".$withval" in (.NONE/*) withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (.no|.NONE/*) withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; (*) { { echo "$as_me:14314: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; esac fi eval ADA_INCLUDE="$withval" echo "$as_me:14323: result: $ADA_INCLUDE" >&5 echo "${ECHO_T}$ADA_INCLUDE" >&6 echo "$as_me:14326: checking for ada-objects" >&5 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6 # Check whether --with-ada-objects or --without-ada-objects was given. if test "${with_ada_objects+set}" = set; then withval="$with_ada_objects" else withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}" fi; if test -n "$prefix/lib/ada/adalib" ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".$withval" in (.\$\(*\)*|.\'*\'*) ;; (..|./*|.\\*) ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX ;; (.\${*prefix}*|.\${*dir}*) eval withval="$withval" case ".$withval" in (.NONE/*) withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (.no|.NONE/*) withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; (*) { { echo "$as_me:14362: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; esac fi eval ADA_OBJECTS="$withval" echo "$as_me:14371: result: $ADA_OBJECTS" >&5 echo "${ECHO_T}$ADA_OBJECTS" >&6 echo "$as_me:14374: checking if an Ada95 shared-library should be built" >&5 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given. if test "${with_ada_sharedlib+set}" = set; then withval="$with_ada_sharedlib" with_ada_sharedlib=$withval else with_ada_sharedlib=no fi; echo "$as_me:14384: result: $with_ada_sharedlib" >&5 echo "${ECHO_T}$with_ada_sharedlib" >&6 ADA_SHAREDLIB='lib$(LIB_NAME).so.1' MAKE_ADA_SHAREDLIB="#" if test "x$with_ada_sharedlib" != xno then MAKE_ADA_SHAREDLIB= if test "x$with_ada_sharedlib" != xyes then ADA_SHAREDLIB="$with_ada_sharedlib" fi fi else { { echo "$as_me:14400: error: No usable Ada compiler found" >&5 echo "$as_me: error: No usable Ada compiler found" >&2;} { (exit 1); exit 1; }; } fi else { { echo "$as_me:14405: error: The Ada compiler is needed for this package" >&5 echo "$as_me: error: The Ada compiler is needed for this package" >&2;} { (exit 1); exit 1; }; } fi ################################################################################ # not needed TINFO_LDFLAGS2= TINFO_LIBS= ### Construct the list of include-directories to be generated if test "$srcdir" != "."; then CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS" fi CPPFLAGS="-I../include $CPPFLAGS" if test "$srcdir" != "."; then CPPFLAGS="-I\${srcdir} $CPPFLAGS" fi CPPFLAGS="-I. $CPPFLAGS" ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" if test "$srcdir" != "."; then ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" fi if test "$GCC" != yes; then ACPPFLAGS="$ACPPFLAGS -I\${includedir}" elif test "$includedir" != "/usr/include"; then if test "$includedir" = '${prefix}/include' ; then if test x$prefix != x/usr ; then ACPPFLAGS="$ACPPFLAGS -I\${includedir}" fi else ACPPFLAGS="$ACPPFLAGS -I\${includedir}" fi fi ### Build up pieces for makefile rules echo "$as_me:14445: checking default library suffix" >&5 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 case $DFT_LWR_MODEL in (libtool) DFT_ARG_SUFFIX='' ;; (normal) DFT_ARG_SUFFIX='' ;; (debug) DFT_ARG_SUFFIX='_g' ;; (profile) DFT_ARG_SUFFIX='_p' ;; (shared) DFT_ARG_SUFFIX='' ;; esac test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}" echo "$as_me:14456: result: $DFT_ARG_SUFFIX" >&5 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6 echo "$as_me:14459: checking default library-dependency suffix" >&5 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 case X$DFT_LWR_MODEL in (Xlibtool) DFT_LIB_SUFFIX='.la' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; (Xdebug) DFT_LIB_SUFFIX='_g.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; (Xprofile) DFT_LIB_SUFFIX='_p.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; (Xshared) case $cf_cv_system_name in (aix[5-7]*) DFT_LIB_SUFFIX='.so' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; (cygwin*|msys*|mingw*) DFT_LIB_SUFFIX='.dll' DFT_DEP_SUFFIX='.dll.a' ;; (darwin*) DFT_LIB_SUFFIX='.dylib' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; (hpux*) case $target in (ia64*) DFT_LIB_SUFFIX='.so' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; (*) DFT_LIB_SUFFIX='.sl' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; esac ;; (*) DFT_LIB_SUFFIX='.so' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; esac ;; (*) DFT_LIB_SUFFIX='.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; esac if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}" then DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}" DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}" fi echo "$as_me:14517: result: $DFT_DEP_SUFFIX" >&5 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6 echo "$as_me:14520: checking default object directory" >&5 echo $ECHO_N "checking default object directory... $ECHO_C" >&6 case $DFT_LWR_MODEL in (libtool) DFT_OBJ_SUBDIR='obj_lo' ;; (normal) DFT_OBJ_SUBDIR='objects' ;; (debug) DFT_OBJ_SUBDIR='obj_g' ;; (profile) DFT_OBJ_SUBDIR='obj_p' ;; (shared) case $cf_cv_system_name in (cygwin|msys) DFT_OBJ_SUBDIR='objects' ;; (*) DFT_OBJ_SUBDIR='obj_s' ;; esac esac echo "$as_me:14536: result: $DFT_OBJ_SUBDIR" >&5 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6 ### Set up low-level terminfo dependencies for makefiles. if test "$DFT_LWR_MODEL" = shared ; then case $cf_cv_system_name in (cygwin*) # "lib" files have ".dll.a" suffix, "cyg" files have ".dll" ;; (msys*) # "lib" files have ".dll.a" suffix, "msys-" files have ".dll" ;; esac fi USE_CFG_SUFFIX=${DFT_ARG_SUFFIX} ### Construct the list of subdirectories for which we'll customize makefiles ### with the appropriate compile-rules. SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in" cat >>confdefs.h <confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overriden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:14774: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated automatically by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false SHELL=\${CONFIG_SHELL-$SHELL} ac_cs_invocation="\$0 \$@" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } exec 6>&1 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\EOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:14950: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. -*) { { echo "$as_me:14969: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done exec 5>>config.log cat >&5 << _ACEOF ## ----------------------- ## ## Running config.status. ## ## ----------------------- ## This file was extended by $as_me 2.52.20150926, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS > $ac_cs_invocation on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;; "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; *) { { echo "$as_me:15040: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } EOF cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datarootdir@,$datarootdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@DEFS@,$DEFS,;t t s,@LIBS@,$LIBS,;t t s,@top_builddir@,$top_builddir,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@target@,$target,;t t s,@target_cpu@,$target_cpu,;t t s,@target_vendor@,$target_vendor,;t t s,@target_os@,$target_os,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t s,@CPP@,$CPP,;t t s,@AWK@,$AWK,;t t s,@EGREP@,$EGREP,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@LN_S@,$LN_S,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@CTAGS@,$CTAGS,;t t s,@ETAGS@,$ETAGS,;t t s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@LD@,$LD,;t t s,@ac_ct_LD@,$ac_ct_LD,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@ARFLAGS@,$ARFLAGS,;t t s,@DESTDIR@,$DESTDIR,;t t s,@BUILD_CC@,$BUILD_CC,;t t s,@BUILD_CPP@,$BUILD_CPP,;t t s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t s,@BUILD_LIBS@,$BUILD_LIBS,;t t s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t s,@LIB_PREFIX@,$LIB_PREFIX,;t t s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t s,@CC_G_OPT@,$CC_G_OPT,;t t s,@LD_MODEL@,$LD_MODEL,;t t s,@shlibdir@,$shlibdir,;t t s,@MAKE_DLLS@,$MAKE_DLLS,;t t s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t s,@LINK_PROGS@,$LINK_PROGS,;t t s,@LINK_TESTS@,$LINK_TESTS,;t t s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t s,@INSTALL_LIB@,$INSTALL_LIB,;t t s,@RPATH_LIST@,$RPATH_LIST,;t t s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t s,@NCURSES_CONST@,$NCURSES_CONST,;t t s,@PTHREAD@,$PTHREAD,;t t s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t s,@ECHO_LT@,$ECHO_LT,;t t s,@ECHO_LD@,$ECHO_LD,;t t s,@RULE_CC@,$RULE_CC,;t t s,@SHOW_CC@,$SHOW_CC,;t t s,@ECHO_CC@,$ECHO_CC,;t t s,@ADAFLAGS@,$ADAFLAGS,;t t s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t s,@ADA_TRACE@,$ADA_TRACE,;t t s,@gnat_exists@,$gnat_exists,;t t s,@M4_exists@,$M4_exists,;t t s,@cf_ada_make@,$cf_ada_make,;t t s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t s,@cf_compile_generics@,$cf_compile_generics,;t t s,@cf_generic_objects@,$cf_generic_objects,;t t s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t s,@cf_ada_compiler@,$cf_ada_compiler,;t t s,@cf_ada_package@,$cf_ada_package,;t t s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t s,@TINFO_LIBS@,$TINFO_LIBS,;t t s,@ACPPFLAGS@,$ACPPFLAGS,;t t s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t s,@TEST_ARG2@,$TEST_ARG2,;t t s,@TEST_LIBS2@,$TEST_LIBS2,;t t s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t s,@NCURSES_TREE@,$NCURSES_TREE,;t t s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t CEOF EOF cat >>$CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed # It is possible to make a multiline substitution using escaped newlines. # Ensure that we do not split the substitution between script fragments. ac_BEG=$ac_end ac_END=`expr $ac_end + $ac_max_sed_lines` sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next if test -s $tmp/subs.next; then grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit if test ! -s $tmp/subs.edit; then grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit if test ! -s $tmp/subs.edit; then if test $ac_beg -gt 1; then ac_end=`expr $ac_end - 1` continue fi fi fi fi if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" EOF cat >>$CONFIG_STATUS <<\EOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` else ac_dir_suffix= ac_dots= fi case $srcdir in .) ac_srcdir=. if test -z "$ac_dots"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_dots$srcdir$ac_dir_suffix ac_top_srcdir=$ac_dots$srcdir ;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_dots$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:15383: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ configure_input="Generated automatically from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:15401: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:15414: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } EOF cat >>$CONFIG_STATUS <<\EOF ac_warn_datarootdir=no if test x"$ac_file" != x-; then for ac_item in $ac_file_inputs do ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item` if test -n "$ac_seen"; then ac_used=`grep '@datarootdir@' $ac_item` if test -z "$ac_used"; then { echo "$as_me:15430: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&2;} ac_warn_datarootdir=yes fi fi ac_seen=`grep '${datarootdir}' $ac_item` if test -n "$ac_seen"; then { echo "$as_me:15439: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&2;} ac_warn_datarootdir=yes fi done fi if test "x$ac_warn_datarootdir" = xyes; then ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'" fi EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then cp $tmp/out $ac_file for ac_name in prefix exec_prefix datarootdir do ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file` if test -n "$ac_seen"; then ac_init=`egrep '[ ]*'$ac_name'[ ]*=' $ac_file` if test -z "$ac_init"; then ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'` { echo "$as_me:15476: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&5 echo "$as_me: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&2;} fi fi done egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out if test -s $tmp/out; then ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out` { echo "$as_me:15487: WARNING: Some variables may not be substituted: $ac_seen" >&5 echo "$as_me: WARNING: Some variables may not be substituted: $ac_seen" >&2;} fi else cat $tmp/out fi rm -f $tmp/out done EOF cat >>$CONFIG_STATUS <<\EOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_iA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_iB='\([ ]\),\1#\2define\3' ac_iC=' ' ac_iD='\4,;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:15536: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:15547: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:15560: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in EOF # Transform confdefs.h into a list of #define's. We won't use it as a sed # script, but as data to insert where we see @DEFS@. We expect AC_SAVE_DEFS to # be either 'cat' or 'sort'. cat confdefs.h | uniq >conftest.vals # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail echo ' rm -f conftest.frag' >> $CONFIG_STATUS while grep . conftest.vals >/dev/null do # Write chunks of a limited-size here document to conftest.frag. echo ' cat >> conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS echo 'CEOF' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals # Run sed to substitute the contents of conftest.frag into $tmp/in at the # marker @DEFS@. echo ' cat >> conftest.edit < $tmp/out rm -f $tmp/in mv $tmp/out $tmp/in rm -f conftest.edit conftest.frag ' >> $CONFIG_STATUS cat >>$CONFIG_STATUS <<\EOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated automatically by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then { echo "$as_me:15618: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } fi rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done EOF cat >>$CONFIG_STATUS <<\EOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` case $ac_dest in default ) if test -z "$USE_OLD_MAKERULES" ; then $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile fi ;; esac done EOF cat >>$CONFIG_STATUS <<\EOF { (exit 0); exit 0; } EOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi ${MAKE:-make} preinstall AdaCurses-20170708/include/0000755000175100001440000000000013130303161013767 5ustar tomusersAdaCurses-20170708/include/ncurses_defs0000644000175100001440000001137212137025771016417 0ustar tomusers# $Id: ncurses_defs,v 1.44 2013/04/27 19:50:17 tom Exp $ ############################################################################## # Copyright (c) 2000-2012,2013 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. # ############################################################################## # # See "MKncurses_def.sh" for an explanation. # # (hint: don't try to define NDEBUG ;-) BROKEN_LINKER BSD_TPUTS CPP_HAS_PARAM_INIT CURSES_ACS_ARRAY acs_map CURSES_WACS_ARRAY _nc_wacs DECL_ERRNO ETIP_NEEDS_MATH_H GCC_NORETURN /* nothing */ GCC_UNUSED /* nothing */ HAVE_BIG_CORE HAVE_BSD_CGETENT HAVE_BSD_SIGNAL_H HAVE_BTOWC HAVE_BUILTIN_H HAVE_CHGAT 1 HAVE_COLOR_SET 1 HAVE_DIRENT_H HAVE_ERRNO HAVE_FCNTL_H HAVE_FILTER 1 HAVE_FORM_H HAVE_GETBEGX 1 HAVE_GETCURX 1 HAVE_GETCWD HAVE_GETEGID HAVE_GETEUID HAVE_GETMAXX 1 HAVE_GETNSTR HAVE_GETOPT_H HAVE_GETPARX 1 HAVE_GETTIMEOFDAY HAVE_GETTTYNAM HAVE_GETWIN 1 HAVE_GPM_H HAVE_GPP_BUILTIN_H HAVE_GXX_BUILTIN_H HAVE_HAS_KEY HAVE_IOSTREAM HAVE_ISASCII HAVE_ISSETUGID HAVE_LANGINFO_CODESET HAVE_LIBC_H HAVE_LIBDBMALLOC HAVE_LIBDMALLOC HAVE_LIBFORM HAVE_LIBGPM HAVE_LIBMENU HAVE_LIBMPATROL HAVE_LIBPANEL HAVE_LIMITS_H HAVE_LINK HAVE_LOCALE_H HAVE_LONG_FILE_NAMES HAVE_MBLEN HAVE_MBRLEN HAVE_MBRTOWC HAVE_MBSRTOWCS HAVE_MBSTOWCS HAVE_MBTOWC HAVE_MENU_H HAVE_MKSTEMP HAVE_MVVLINE 1 HAVE_MVWVLINE 1 HAVE_NANOSLEEP HAVE_NC_ALLOC_H HAVE_PANEL_H HAVE_POLL HAVE_POLL_H HAVE_PURIFY HAVE_PUTWC HAVE_PUTWIN 1 HAVE_REGEXPR_H_FUNCS HAVE_REGEXP_H_FUNCS HAVE_REGEX_H_FUNCS HAVE_REMOVE HAVE_RESIZETERM HAVE_RESIZE_TERM HAVE_RIPOFFLINE 1 HAVE_SELECT HAVE_SETBUF HAVE_SETBUFFER HAVE_SETUPTERM 1 HAVE_SETVBUF HAVE_SIGACTION HAVE_SIGVEC HAVE_SIZECHANGE HAVE_SLK_COLOR HAVE_SLK_INIT 1 HAVE_STRSTR HAVE_SYMLINK HAVE_SYS_BSDTYPES_H HAVE_SYS_IOCTL_H HAVE_SYS_PARAM_H HAVE_SYS_POLL_H HAVE_SYS_SELECT_H HAVE_SYS_TERMIO_H HAVE_SYS_TIMES_H HAVE_SYS_TIME_H HAVE_SYS_TIME_SELECT HAVE_TCGETATTR HAVE_TCGETPGRP HAVE_TELL HAVE_TERMATTRS 1 HAVE_TERMIOS_H HAVE_TERMIO_H HAVE_TERMNAME 1 HAVE_TERM_H 1 HAVE_TGETENT 1 HAVE_TIGETNUM 1 HAVE_TIGETSTR 1 HAVE_TIMES HAVE_TTYENT_H HAVE_TYPEAHEAD 1 HAVE_TYPEINFO HAVE_TYPE_ATTR_T HAVE_TYPE_SIGACTION HAVE_UNISTD_H HAVE_UNLINK HAVE_USE_DEFAULT_COLORS HAVE_VFSCANF HAVE_VSNPRINTF HAVE_VSSCANF HAVE_WCSRTOMBS HAVE_WCSTOMBS HAVE_WCTOB HAVE_WCTOMB HAVE_WCTYPE_H HAVE_WINSSTR 1 HAVE_WORKING_POLL HAVE_WRESIZE HAVE__DOSCAN MIXEDCASE_FILENAMES NCURSES_CHAR_EQ NCURSES_EXPANDED NCURSES_EXT_COLORS NCURSES_EXT_FUNCS NCURSES_NO_PADDING NCURSES_PATHSEP ':' NEED_PTEM_H NO_LEAKS PURE_TERMINFO STDC_HEADERS SVR4_ACTION SVR4_TERMIO SYSTEM_NAME "unknown" TERMINFO "none" TERMPATH "none" TIME_WITH_SYS_TIME TYPEOF_CHTYPE USE_COLORFGBG USE_DATABASE USE_GETCAP USE_GETCAP_CACHE USE_HARD_TABS USE_HASHED_DB USE_HASHMAP USE_HOME_TERMINFO USE_LINKS USE_MY_MEMMOVE USE_OK_BCOPY USE_RCS_IDS USE_REENTRANT USE_SAFE_SPRINTF USE_SCROLL_HINTS USE_SIGWINCH USE_SYMLINKS USE_SYSMOUSE USE_TERMCAP USE_WEAK_SYMBOLS USE_WIDEC_SUPPORT USE_XMC_SUPPORT AdaCurses-20170708/include/ncurses_cfg.hin0000644000175100001440000000650010165646742017015 0ustar tomusers/**************************************************************************** * Copyright (c) 1998-2004,2005 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 E. Dickey 1997 * ****************************************************************************/ /* * $Id: ncurses_cfg.hin,v 1.7 2005/01/02 01:26:58 tom Exp $ * * This is a template-file used to generate the "ncurses_cfg.h" file. * * Rather than list every definition, the configuration script substitutes the * definitions that it finds using 'sed'. You need a patch (original date * 971222) to autoconf 2.12 or 2.13 to do this. * * See: * http://invisible-island.net/autoconf/ * ftp://invisible-island.net/autoconf/ */ #ifndef NC_CONFIG_H #define NC_CONFIG_H @DEFS@ #include /* The C compiler may not treat these properly but C++ has to */ #ifdef __cplusplus #undef const #undef inline #else #if defined(lint) || defined(TRACE) #undef inline #define inline /* nothing */ #endif #endif /* On HP-UX, the C compiler doesn't grok mbstate_t without -D_XOPEN_SOURCE=500. However, this causes problems on IRIX. So, we #define mbstate_t to int in configure.in only for the C compiler if needed. */ #ifndef __cplusplus #ifdef NEED_MBSTATE_T_DEF #define mbstate_t int #endif #endif #endif /* NC_CONFIG_H */ AdaCurses-20170708/include/Makefile.in0000644000175100001440000000702312560514435016054 0ustar tomusers# $Id: Makefile.in,v 1.4 2015/08/05 23:15:41 tom Exp $ ############################################################################## # Copyright (c) 2010-2011,2015 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 E. Dickey # # Makefile for ncurses source code. # # This makes header files used when building Ada95 as a separate tree. # # The variable 'srcdir' refers to the source-distribution, and can be set with # the configure script by "--srcdir=DIR". # turn off _all_ suffix rules; we'll generate our own .SUFFIXES: SHELL = @SHELL@ VPATH = @srcdir@ THIS = Makefile DESTDIR = @DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ includedir = @includedir@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ AWK = @AWK@ # These files are generated by this makefile AUTO_SRC = \ ncurses_def.h ################################################################################ all \ libs \ depend \ sources \ install :: $(AUTO_SRC) uninstall :: ncurses_def.h: $(srcdir)/ncurses_defs $(srcdir)/MKncurses_def.sh AWK=$(AWK) $(SHELL) $(srcdir)/MKncurses_def.sh $(srcdir)/ncurses_defs >$@ tags: ctags *.[ch] @MAKE_UPPER_TAGS@TAGS: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace clean :: mostlyclean -rm -f $(AUTO_SRC) distclean :: clean -rm -f Makefile realclean :: distclean ############################################################################### # The remainder of this file is automatically generated during configuration ############################################################################### AdaCurses-20170708/include/MKncurses_def.sh0000755000175100001440000000627007746521242017105 0ustar tomusers#! /bin/sh # $Id: MKncurses_def.sh,v 1.3 2003/10/25 16:19:46 tom Exp $ ############################################################################## # Copyright (c) 2000,2003 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. # ############################################################################## # # MKncurses_def.sh -- generate fallback definitions for ncurses_cfg.h # # Author: Thomas E. Dickey 2000 # # Given the choice between constructs such as # # #if defined(foo) && foo # #if foo # # we chose the latter. It is guaranteed by the language standard, and there # appear to be no broken compilers that do not honor that detail. But some # people want to use gcc's -Wundef option (corresponding to one of the less # useful features in Watcom's compiler) to check for misspellings. So we # generate a set of fallback definitions to quiet the warnings without making # the code ugly. # DEFS="${1-ncurses_defs}" cat < Section: misc Priority: optional Standards-Version: 3.8.4 Build-Depends: debhelper (>= 5) Homepage: http://invisible-island.net/adacurses/ Package: adacurses Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: AdaCurses - Ada95 binding for ncurses This package installs as "adacurses" to avoid conflict with other packages. This is the Ada95 binding from the ncurses distribution. . In addition to a library, this package installs sample programs in "bin/AdaCurses" to avoid conflict with other packages. AdaCurses-20170708/package/debian/source/0000755000175100001440000000000013130303161016461 5ustar tomusersAdaCurses-20170708/package/debian/source/format0000644000175100001440000000001512525715155017711 0ustar tomusers3.0 (native) AdaCurses-20170708/package/debian/changelog0000644000175100001440000000026713130303161017040 0ustar tomusersadacurses (6.0+20170708) unstable; urgency=low * snapshot of ncurses subpackage for AdaCurses. -- Thomas E. Dickey Sat, 08 Jul 2017 21:27:13 -0400 AdaCurses-20170708/package/debian/compat0000644000175100001440000000000211363402276016374 0ustar tomusers5 AdaCurses-20170708/package/debian/docs0000644000175100001440000000000711411671635016047 0ustar tomusersREADME AdaCurses-20170708/package/debian/watch0000644000175100001440000000015011543160762016224 0ustar tomusersversion=3 opts=passive ftp://invisible-island.net/AdaCurses/AdaCurses-([\d.]+)\.tgz \ debian uupdate AdaCurses-20170708/package/debian/copyright0000644000175100001440000000732213034304503017124 0ustar tomusersUpstream source http://invisible-island.net/ncurses/ncurses-examples.html Current ncurses maintainer: Thomas Dickey ------------------------------------------------------------------------------- Files: * Copyright: 1998-2016,2017 Free Software Foundation, Inc. Licence: X11 Files: aclocal.m4 package Copyright: 2010-2016,2017 by Thomas E. Dickey Licence: X11 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. ------------------------------------------------------------------------------- Files: install-sh Copyright: 1994 X Consortium Licence: X11 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, 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 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other deal- ings in this Software without prior written authorization from the X Consor- tium. FSF changes to this file are in the public domain. Calling this script install-sh is preferred over install.sh, to prevent `make' implicit rules from creating a file called install from it when there is no Makefile. This script is compatible with the BSD install script, but was written from scratch. It can only install one file at a time, a restriction shared with many OS's install programs. On Debian systems, the complete text of the GNU General Public License can be found in '/usr/share/common-licenses/GPL-2' -- vile: txtmode file-encoding=utf-8 AdaCurses-20170708/package/AdaCurses-doc.spec0000644000175100001440000000225713130303161017236 0ustar tomusersSummary: AdaCurses - Ada95 binding documentation for ncurses %define AppProgram AdaCurses %define AppVersion 6.0 %define AppRelease 20170708 %define AppPackage %{AppProgram}-doc # $Id: AdaCurses-doc.spec,v 1.3 2015/04/26 23:39:31 tom Exp $ Name: %{AppPackage} Version: %{AppVersion} Release: %{AppRelease} License: MIT Group: Applications/Development URL: ftp://invisible-island.net/%{AppProgram} Source0: %{AppProgram}-%{AppRelease}.tgz Packager: Thomas Dickey %description This is the Ada95 binding documentation from the ncurses 6.0 distribution, for patch-date 20170708. %prep %define debug_package %{nil} %setup -q -n %{AppProgram}-%{AppRelease} %build INSTALL_PROGRAM='${INSTALL}' \ ./configure \ --target %{_target_platform} \ --prefix=%{_prefix} \ --datadir=%{_datadir} \ --with-ada-sharedlib %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT (cd doc && make install.html DESTDIR=$RPM_BUILD_ROOT ) %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_datadir}/doc/AdaCurses %changelog # each patch should add its ChangeLog entries here * Sat Mar 26 2011 Thomas Dickey - initial version AdaCurses-20170708/package/AdaCurses.spec0000644000175100001440000000424013130303161016465 0ustar tomusersSummary: AdaCurses - Ada95 binding for ncurses %define AppProgram AdaCurses %define AppVersion 6.0 %define AppRelease 20170708 # $Id: AdaCurses.spec,v 1.15 2015/04/26 23:55:55 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: %{AppRelease} License: MIT Group: Applications/Development URL: ftp://invisible-island.net/%{AppProgram} Source0: %{AppProgram}-%{AppRelease}.tgz Packager: Thomas Dickey %description This is the Ada95 binding from the ncurses 6.0 distribution, for patch-date 20170708. In addition to a library, this package installs sample programs in "bin/AdaCurses" to avoid conflict with other packages. %prep %define debug_package %{nil} # http://fedoraproject.org/wiki/EPEL:Packaging_Autoprovides_and_Requires_Filtering %filter_from_requires /libAdaCurses.so.1/d %filter_setup %setup -q -n %{AppProgram}-%{AppRelease} %build %define ada_libdir %{_prefix}/lib/ada/adalib INSTALL_PROGRAM='${INSTALL}' \ ./configure \ --target %{_target_platform} \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --libdir=%{_libdir} \ --mandir=%{_mandir} \ --datadir=%{_datadir} \ --disable-rpath-link \ --with-shared \ --with-ada-sharedlib make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT ( cd samples && make install.examples \ DESTDIR=$RPM_BUILD_ROOT \ BINDIR=$RPM_BUILD_ROOT%{_bindir}/%{AppProgram} ) %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_bindir}/adacurses*-config %{_bindir}/%{AppProgram}/* %{_libdir}/libAdaCurses.* %{ada_libdir}/libAdaCurses.* %{ada_libdir}/terminal_interface* %{_mandir}/man1/adacurses*-config.1* %{_datadir}/%{AppProgram}/* %{_datadir}/ada/adainclude/terminal_interface* %changelog # each patch should add its ChangeLog entries here * Thu Mar 31 2011 Thomas Dickey - use --with-shared option for consistency with --with-ada-sharelib - ensure that MY_DATADIR is set when installing examples - add ada_libdir symbol to handle special case where libdir is /usr/lib64 - use --disable-rpath-link to link sample programs without rpath * Fri Mar 25 2011 Thomas Dickey - initial version