ncurses 6.0 - patch 20170422
[ncurses.git] / doc / html / ada / terminal_interface-curses-aux__ads.htm
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>terminal_interface-curses-aux.ads</TITLE>
5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6 <style type="text/css">
7 *.comment {
8         color: green;
9 }
10 *.symbol {
11         color: red;
12 }
13 </style>
14 </HEAD>
15 <BODY>
16 <HR><DIV style="text-align:center"><H1> File : terminal_interface-curses-aux.ads </H1></DIV><HR>
17 <PRE>
18 <span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
19 <span class="comment"><EM>--                                                                          --</EM></span>
20 <span class="comment"><EM>--                           <A HREF="http://www.gnat.com">GNAT</A> ncurses Binding                           --</EM></span>
21 <span class="comment"><EM>--                                                                          --</EM></span>
22 <span class="comment"><EM>--                       Terminal_Interface.Curses.Aux                      --</EM></span>
23 <span class="comment"><EM>--                                                                          --</EM></span>
24 <span class="comment"><EM>--                                 S P E C                                  --</EM></span>
25 <span class="comment"><EM>--                                                                          --</EM></span>
26 <span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
27 <span class="comment"><EM>-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc.              --</EM></span>
28 <span class="comment"><EM>--                                                                          --</EM></span>
29 <span class="comment"><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></span>
30 <span class="comment"><EM>-- copy of this software and associated documentation files (the            --</EM></span>
31 <span class="comment"><EM>-- "Software"), to deal in the Software without restriction, including      --</EM></span>
32 <span class="comment"><EM>-- without limitation the rights to use, copy, modify, merge, publish,      --</EM></span>
33 <span class="comment"><EM>-- distribute, distribute with modifications, sublicense, and/or sell       --</EM></span>
34 <span class="comment"><EM>-- copies of the Software, and to permit persons to whom the Software is    --</EM></span>
35 <span class="comment"><EM>-- furnished to do so, subject to the following conditions:                 --</EM></span>
36 <span class="comment"><EM>--                                                                          --</EM></span>
37 <span class="comment"><EM>-- The above copyright notice and this permission notice shall be included  --</EM></span>
38 <span class="comment"><EM>-- in all copies or substantial portions of the Software.                   --</EM></span>
39 <span class="comment"><EM>--                                                                          --</EM></span>
40 <span class="comment"><EM>-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --</EM></span>
41 <span class="comment"><EM>-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --</EM></span>
42 <span class="comment"><EM>-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --</EM></span>
43 <span class="comment"><EM>-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --</EM></span>
44 <span class="comment"><EM>-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --</EM></span>
45 <span class="comment"><EM>-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --</EM></span>
46 <span class="comment"><EM>-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --</EM></span>
47 <span class="comment"><EM>--                                                                          --</EM></span>
48 <span class="comment"><EM>-- Except as contained in this notice, the name(s) of the above copyright   --</EM></span>
49 <span class="comment"><EM>-- holders shall not be used in advertising or otherwise to promote the     --</EM></span>
50 <span class="comment"><EM>-- sale, use or other dealings in this Software without prior written       --</EM></span>
51 <span class="comment"><EM>-- authorization.                                                           --</EM></span>
52 <span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
53 <span class="comment"><EM>--  Author:  Juergen Pfeifer, 1996</EM></span>
54 <span class="comment"><EM>--  Version Control:</EM></span>
55 <span class="comment"><EM>--  @Revision: 1.23 @</EM></span>
56 <span class="comment"><EM>--  Binding Version 01.00</EM></span>
57 <span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
58 <b>with</b> System;
59 <b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
60 <b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings;
61
62 <b>package</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_45_35" HREF="terminal_interface-curses-aux__adb.htm#ref_41_40">Aux</A></span> <b>is</b>
63    <b>pragma</b> Preelaborate (<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>);
64
65    <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
66
67    <b>subtype</b> <span class="symbol"><A NAME="ref_50_12">C_Int</A></span>      <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
68    <b>subtype</b> <span class="symbol"><A NAME="ref_51_12">C_Short</A></span>    <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.short;
69    <b>subtype</b> <span class="symbol"><A NAME="ref_52_12">C_Long_Int</A></span> <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.long;
70    <b>subtype</b> <span class="symbol"><A NAME="ref_53_12">C_Size_T</A></span>   <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.size_t;
71    <b>subtype</b> <span class="symbol"><A NAME="ref_54_12">C_UInt</A></span>     <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.unsigned;
72    <b>subtype</b> <span class="symbol"><A NAME="ref_55_12">C_ULong</A></span>    <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.unsigned_long;
73    <b>subtype</b> <span class="symbol"><A NAME="ref_56_12">C_Char_Ptr</A></span> <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings.chars_ptr;
74    <b>type</b>    <span class="symbol"><A NAME="ref_57_12">C_Void_Ptr</A></span> <b>is</b> <b>new</b> System.Address;
75
76    <span class="comment"><EM>--  This is how those constants are defined in ncurses. I see them also</EM></span>
77    <span class="comment"><EM>--  exactly like this in all ETI implementations I ever tested. So it</EM></span>
78    <span class="comment"><EM>--  could be that this is quite general, but please check with your curses.</EM></span>
79    <span class="comment"><EM>--  This is critical, because curses sometime mixes Boolean returns with</EM></span>
80    <span class="comment"><EM>--  returning an error status.</EM></span>
81    <span class="symbol"><A NAME="ref_64_4">Curses_Ok</A></span>    : <b>constant</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_50_12">C_Int</A> := <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_12_4">OK</A>;
82    <span class="symbol"><A NAME="ref_65_4">Curses_Err</A></span>   : <b>constant</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_50_12">C_Int</A> := <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_13_4">ERR</A>;
83
84    <span class="symbol"><A NAME="ref_67_4">Curses_True</A></span>  : <b>constant</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_50_12">C_Int</A> := <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_15_4">TRUE</A>;
85    <span class="symbol"><A NAME="ref_68_4">Curses_False</A></span> : <b>constant</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_50_12">C_Int</A> := <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_16_4">FALSE</A>;
86
87    <span class="comment"><EM>--  Eti_Error: type for error codes returned by the menu and form subsystem</EM></span>
88    <b>type</b> <span class="symbol"><A NAME="ref_71_9">Eti_Error</A></span> <b>is</b>
89      (<span class="symbol"><A NAME="ref_72_7">E_Current</A></span>,
90       <span class="symbol"><A NAME="ref_73_7">E_Invalid_Field</A></span>,
91       <span class="symbol"><A NAME="ref_74_7">E_Request_Denied</A></span>,
92       <span class="symbol"><A NAME="ref_75_7">E_Not_Connected</A></span>,
93       <span class="symbol"><A NAME="ref_76_7">E_Not_Selectable</A></span>,
94       <span class="symbol"><A NAME="ref_77_7">E_No_Match</A></span>,
95       <span class="symbol"><A NAME="ref_78_7">E_Unknown_Command</A></span>,
96       <span class="symbol"><A NAME="ref_79_7">E_Not_Posted</A></span>,
97       <span class="symbol"><A NAME="ref_80_7">E_No_Room</A></span>,
98       <span class="symbol"><A NAME="ref_81_7">E_Bad_State</A></span>,
99       <span class="symbol"><A NAME="ref_82_7">E_Connected</A></span>,
100       <span class="symbol"><A NAME="ref_83_7">E_Posted</A></span>,
101       <span class="symbol"><A NAME="ref_84_7">E_Bad_Argument</A></span>,
102       <span class="symbol"><A NAME="ref_85_7">E_System_Error</A></span>,
103       <span class="symbol"><A NAME="ref_86_7">E_Ok</A></span>);
104
105    <b>procedure</b> <span class="symbol"><A NAME="ref_88_14" HREF="terminal_interface-curses-aux__adb.htm#ref_94_14">Eti_Exception</A></span> (<span class="symbol"><A NAME="ref_88_29" HREF="terminal_interface-curses-aux__adb.htm#ref_94_29">Code</A></span> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_71_9">Eti_Error</A>);
106    <span class="comment"><EM>--  Do nothing if Code = E_Ok.</EM></span>
107    <span class="comment"><EM>--  Else dispatch the error code and raise the appropriate exception.</EM></span>
108
109    <b>procedure</b> <span class="symbol"><A NAME="ref_92_14" HREF="terminal_interface-curses-aux__adb.htm#ref_44_14">Fill_String</A></span> (<span class="symbol"><A NAME="ref_92_27" HREF="terminal_interface-curses-aux__adb.htm#ref_44_27">Cp</A></span>  : chars_ptr;
110                           <span class="symbol"><A NAME="ref_93_27" HREF="terminal_interface-curses-aux__adb.htm#ref_45_27">Str</A></span> : <b>out</b> String);
111    <span class="comment"><EM>--  Fill the Str parameter with the string denoted by the chars_ptr</EM></span>
112    <span class="comment"><EM>--  C-Style string.</EM></span>
113
114    <b>function</b> <span class="symbol"><A NAME="ref_97_13" HREF="terminal_interface-curses-aux__adb.htm#ref_73_13">Fill_String</A></span> (<span class="symbol"><A NAME="ref_97_26" HREF="terminal_interface-curses-aux__adb.htm#ref_73_26">Cp</A></span> : chars_ptr) <b>return</b> String;
115    <span class="comment"><EM>--  Same but as function.</EM></span>
116
117 <b>private</b>
118    <b>for</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_71_9">Eti_Error</A>'Size <b>use</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_50_12">C_Int</A>'Size;
119    <b>pragma</b> Convention (C, <A HREF="terminal_interface-curses-aux__ads.htm#ref_71_9">Eti_Error</A>);
120    <b>for</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_71_9">Eti_Error</A> <b>use</b>
121      (<A HREF="terminal_interface-curses-aux__ads.htm#ref_72_7">E_Current</A>         =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_94_4">E_CURRENT</A>,
122       <A HREF="terminal_interface-curses-aux__ads.htm#ref_73_7">E_Invalid_Field</A>   =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_93_4">E_INVALID_FIELD</A>,
123       <A HREF="terminal_interface-curses-aux__ads.htm#ref_74_7">E_Request_Denied</A>  =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_92_4">E_REQUEST_DENIED</A>,
124       <A HREF="terminal_interface-curses-aux__ads.htm#ref_75_7">E_Not_Connected</A>   =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_91_4">E_NOT_CONNECTED</A>,
125       <A HREF="terminal_interface-curses-aux__ads.htm#ref_76_7">E_Not_Selectable</A>  =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_90_4">E_NOT_SELECTABLE</A>,
126       <A HREF="terminal_interface-curses-aux__ads.htm#ref_77_7">E_No_Match</A>        =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_89_4">E_NO_MATCH</A>,
127       <A HREF="terminal_interface-curses-aux__ads.htm#ref_78_7">E_Unknown_Command</A> =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_88_4">E_UNKNOWN_COMMAND</A>,
128       <A HREF="terminal_interface-curses-aux__ads.htm#ref_79_7">E_Not_Posted</A>      =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_87_4">E_NOT_POSTED</A>,
129       <A HREF="terminal_interface-curses-aux__ads.htm#ref_80_7">E_No_Room</A>         =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_86_4">E_NO_ROOM</A>,
130       <A HREF="terminal_interface-curses-aux__ads.htm#ref_81_7">E_Bad_State</A>       =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_85_4">E_BAD_STATE</A>,
131       <A HREF="terminal_interface-curses-aux__ads.htm#ref_82_7">E_Connected</A>       =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_84_4">E_CONNECTED</A>,
132       <A HREF="terminal_interface-curses-aux__ads.htm#ref_83_7">E_Posted</A>          =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_83_4">E_POSTED</A>,
133       <A HREF="terminal_interface-curses-aux__ads.htm#ref_84_7">E_Bad_Argument</A>    =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_82_4">E_BAD_ARGUMENT</A>,
134       <A HREF="terminal_interface-curses-aux__ads.htm#ref_85_7">E_System_Error</A>    =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_81_4">E_SYSTEM_ERROR</A>,
135       <A HREF="terminal_interface-curses-aux__ads.htm#ref_86_7">E_Ok</A>              =&gt; <A HREF="terminal_interface-curses_constants__ads.htm#ref_6_28">Curses_Constants</A>.<A HREF="terminal_interface-curses_constants__ads.htm#ref_80_4">E_OK</A>);
136 <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>;
137 </PRE></BODY></HTML>