mirror of
https://github.com/Aigor44/ncursesw-morphos.git
synced 2024-12-27 07:49:06 +08:00
34d602f272
+ 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.
135 lines
13 KiB
HTML
135 lines
13 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>terminal_interface-curses-aux.adb</TITLE>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<style type="text/css">
|
|
*.comment {
|
|
color: green;
|
|
}
|
|
*.symbol {
|
|
color: red;
|
|
}
|
|
</style>
|
|
</HEAD>
|
|
<BODY>
|
|
<HR><DIV style="text-align:center"><H1> File : terminal_interface-curses-aux.adb </H1></DIV><HR>
|
|
<PRE>
|
|
<span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
|
|
<span class="comment"><EM>-- --</EM></span>
|
|
<span class="comment"><EM>-- <A HREF="http://www.gnat.com">GNAT</A> ncurses Binding --</EM></span>
|
|
<span class="comment"><EM>-- --</EM></span>
|
|
<span class="comment"><EM>-- Terminal_Interface.Curses.Aux --</EM></span>
|
|
<span class="comment"><EM>-- --</EM></span>
|
|
<span class="comment"><EM>-- B O D Y --</EM></span>
|
|
<span class="comment"><EM>-- --</EM></span>
|
|
<span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
|
|
<span class="comment"><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --</EM></span>
|
|
<span class="comment"><EM>-- --</EM></span>
|
|
<span class="comment"><EM>-- Permission is hereby granted, free of charge, to any person obtaining a --</EM></span>
|
|
<span class="comment"><EM>-- copy of this software and associated documentation files (the --</EM></span>
|
|
<span class="comment"><EM>-- "Software"), to deal in the Software without restriction, including --</EM></span>
|
|
<span class="comment"><EM>-- without limitation the rights to use, copy, modify, merge, publish, --</EM></span>
|
|
<span class="comment"><EM>-- distribute, distribute with modifications, sublicense, and/or sell --</EM></span>
|
|
<span class="comment"><EM>-- copies of the Software, and to permit persons to whom the Software is --</EM></span>
|
|
<span class="comment"><EM>-- furnished to do so, subject to the following conditions: --</EM></span>
|
|
<span class="comment"><EM>-- --</EM></span>
|
|
<span class="comment"><EM>-- The above copyright notice and this permission notice shall be included --</EM></span>
|
|
<span class="comment"><EM>-- in all copies or substantial portions of the Software. --</EM></span>
|
|
<span class="comment"><EM>-- --</EM></span>
|
|
<span class="comment"><EM>-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --</EM></span>
|
|
<span class="comment"><EM>-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --</EM></span>
|
|
<span class="comment"><EM>-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --</EM></span>
|
|
<span class="comment"><EM>-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --</EM></span>
|
|
<span class="comment"><EM>-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --</EM></span>
|
|
<span class="comment"><EM>-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --</EM></span>
|
|
<span class="comment"><EM>-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --</EM></span>
|
|
<span class="comment"><EM>-- --</EM></span>
|
|
<span class="comment"><EM>-- Except as contained in this notice, the name(s) of the above copyright --</EM></span>
|
|
<span class="comment"><EM>-- holders shall not be used in advertising or otherwise to promote the --</EM></span>
|
|
<span class="comment"><EM>-- sale, use or other dealings in this Software without prior written --</EM></span>
|
|
<span class="comment"><EM>-- authorization. --</EM></span>
|
|
<span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
|
|
<span class="comment"><EM>-- Author: Juergen Pfeifer, 1996</EM></span>
|
|
<span class="comment"><EM>-- Version Control:</EM></span>
|
|
<span class="comment"><EM>-- @Revision: 1.11 @</EM></span>
|
|
<span class="comment"><EM>-- Binding Version 01.00</EM></span>
|
|
<span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
|
|
<b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_47_28">Curses</A>.<span class="symbol"><A NAME="ref_41_40" HREF="terminal_interface-curses-aux__ads.htm#ref_45_35">Aux</A></span> <b>is</b>
|
|
<span class="comment"><EM>--</EM></span>
|
|
<span class="comment"><EM>-- Some helpers</EM></span>
|
|
<b>procedure</b> <span class="symbol"><A NAME="ref_44_14" HREF="terminal_interface-curses-aux__ads.htm#ref_92_14">Fill_String</A></span> (<span class="symbol"><A NAME="ref_44_27" HREF="terminal_interface-curses-aux__ads.htm#ref_92_27">Cp</A></span> : chars_ptr;
|
|
<span class="symbol"><A NAME="ref_45_27" HREF="terminal_interface-curses-aux__ads.htm#ref_93_27">Str</A></span> : <b>out</b> String)
|
|
<b>is</b>
|
|
<span class="comment"><EM>-- Fill the string with the characters referenced by the</EM></span>
|
|
<span class="comment"><EM>-- chars_ptr.</EM></span>
|
|
<span class="comment"><EM>--</EM></span>
|
|
<span class="symbol"><A NAME="ref_50_7">Len</A></span> : Natural;
|
|
<b>begin</b>
|
|
<b>if</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_92_27">Cp</A> /= Null_Ptr <b>then</b>
|
|
<A HREF="terminal_interface-curses-aux__adb.htm#ref_50_7">Len</A> := Natural (Strlen (<A HREF="terminal_interface-curses-aux__ads.htm#ref_92_27">Cp</A>));
|
|
<b>if</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_93_27">Str</A>'Length < <A HREF="terminal_interface-curses-aux__adb.htm#ref_50_7">Len</A> <b>then</b>
|
|
<b>raise</b> Constraint_Error;
|
|
<b>end</b> <b>if</b>;
|
|
<b>declare</b>
|
|
<span class="symbol"><A NAME="ref_58_13">S</A></span> : String (1 .. <A HREF="terminal_interface-curses-aux__adb.htm#ref_50_7">Len</A>);
|
|
<b>begin</b>
|
|
<A HREF="terminal_interface-curses-aux__adb.htm#ref_58_13">S</A> := Value (<A HREF="terminal_interface-curses-aux__ads.htm#ref_92_27">Cp</A>);
|
|
<A HREF="terminal_interface-curses-aux__ads.htm#ref_93_27">Str</A> (<A HREF="terminal_interface-curses-aux__ads.htm#ref_93_27">Str</A>'First .. (<A HREF="terminal_interface-curses-aux__ads.htm#ref_93_27">Str</A>'First + <A HREF="terminal_interface-curses-aux__adb.htm#ref_50_7">Len</A> - 1)) := <A HREF="terminal_interface-curses-aux__adb.htm#ref_58_13">S</A> (<A HREF="terminal_interface-curses-aux__adb.htm#ref_58_13">S</A>'<b>Range</b>);
|
|
<b>end</b>;
|
|
<b>else</b>
|
|
<A HREF="terminal_interface-curses-aux__adb.htm#ref_50_7">Len</A> := 0;
|
|
<b>end</b> <b>if</b>;
|
|
|
|
<b>if</b> <A HREF="terminal_interface-curses-aux__adb.htm#ref_50_7">Len</A> < <A HREF="terminal_interface-curses-aux__ads.htm#ref_93_27">Str</A>'Length <b>then</b>
|
|
<A HREF="terminal_interface-curses-aux__ads.htm#ref_93_27">Str</A> ((<A HREF="terminal_interface-curses-aux__ads.htm#ref_93_27">Str</A>'First + <A HREF="terminal_interface-curses-aux__adb.htm#ref_50_7">Len</A>) .. <A HREF="terminal_interface-curses-aux__ads.htm#ref_93_27">Str</A>'Last) := (<b>others</b> => ' ');
|
|
<b>end</b> <b>if</b>;
|
|
|
|
<b>end</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_92_14">Fill_String</A>;
|
|
|
|
<b>function</b> <span class="symbol"><A NAME="ref_73_13" HREF="terminal_interface-curses-aux__ads.htm#ref_97_13">Fill_String</A></span> (<span class="symbol"><A NAME="ref_73_26" HREF="terminal_interface-curses-aux__ads.htm#ref_97_26">Cp</A></span> : chars_ptr) <b>return</b> String
|
|
<b>is</b>
|
|
<span class="symbol"><A NAME="ref_75_7">Len</A></span> : Natural;
|
|
<b>begin</b>
|
|
<b>if</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_97_26">Cp</A> /= Null_Ptr <b>then</b>
|
|
<A HREF="terminal_interface-curses-aux__adb.htm#ref_75_7">Len</A> := Natural (Strlen (<A HREF="terminal_interface-curses-aux__ads.htm#ref_97_26">Cp</A>));
|
|
<b>if</b> <A HREF="terminal_interface-curses-aux__adb.htm#ref_75_7">Len</A> = 0 <b>then</b>
|
|
<b>return</b> "";
|
|
<b>else</b>
|
|
<b>declare</b>
|
|
<span class="symbol"><A NAME="ref_83_16">S</A></span> : String (1 .. <A HREF="terminal_interface-curses-aux__adb.htm#ref_75_7">Len</A>);
|
|
<b>begin</b>
|
|
<A HREF="terminal_interface-curses-aux__ads.htm#ref_92_14">Fill_String</A> (<A HREF="terminal_interface-curses-aux__ads.htm#ref_97_26">Cp</A>, <A HREF="terminal_interface-curses-aux__adb.htm#ref_83_16">S</A>);
|
|
<b>return</b> <A HREF="terminal_interface-curses-aux__adb.htm#ref_83_16">S</A>;
|
|
<b>end</b>;
|
|
<b>end</b> <b>if</b>;
|
|
<b>else</b>
|
|
<b>return</b> "";
|
|
<b>end</b> <b>if</b>;
|
|
<b>end</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_97_13">Fill_String</A>;
|
|
|
|
<b>procedure</b> <span class="symbol"><A NAME="ref_94_14" HREF="terminal_interface-curses-aux__ads.htm#ref_88_14">Eti_Exception</A></span> (<span class="symbol"><A NAME="ref_94_29" HREF="terminal_interface-curses-aux__ads.htm#ref_88_29">Code</A></span> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_71_9">Eti_Error</A>)
|
|
<b>is</b>
|
|
<b>begin</b>
|
|
<b>case</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_88_29">Code</A> <b>is</b>
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_86_7">E_Ok</A> => <b>null</b>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_85_7">E_System_Error</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_527_4">Eti_System_Error</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_84_7">E_Bad_Argument</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_528_4">Eti_Bad_Argument</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_83_7">E_Posted</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_529_4">Eti_Posted</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_82_7">E_Connected</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_530_4">Eti_Connected</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_81_7">E_Bad_State</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_531_4">Eti_Bad_State</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_80_7">E_No_Room</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_532_4">Eti_No_Room</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_79_7">E_Not_Posted</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_533_4">Eti_Not_Posted</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_78_7">E_Unknown_Command</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_534_4">Eti_Unknown_Command</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_77_7">E_No_Match</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_535_4">Eti_No_Match</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_76_7">E_Not_Selectable</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_536_4">Eti_Not_Selectable</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_75_7">E_Not_Connected</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_537_4">Eti_Not_Connected</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_74_7">E_Request_Denied</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_538_4">Eti_Request_Denied</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_73_7">E_Invalid_Field</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_539_4">Eti_Invalid_Field</A>;
|
|
<b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_72_7">E_Current</A> => <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_540_4">Eti_Current</A>;
|
|
<b>end</b> <b>case</b>;
|
|
<b>end</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_88_14">Eti_Exception</A>;
|
|
|
|
<b>end</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_47_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_45_35">Aux</A>;
|
|
</PRE></BODY></HTML>
|