]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/ada/terminal_interface-curses-aux__ads.htm
ncurses 6.3 - patch 20220924
[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>--                           <strong>GNAT</strong> 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 2018,2020 Thomas E. Dickey                                     --</em></span>
28 <span class="comment"><em>-- Copyright 1998-2011,2014 Free Software Foundation, Inc.                  --</em></span>
29 <span class="comment"><em>--                                                                          --</em></span>
30 <span class="comment"><em>-- Permission is hereby granted, free of charge, to any person obtaining a  --</em></span>
31 <span class="comment"><em>-- copy of this software and associated documentation files (the            --</em></span>
32 <span class="comment"><em>-- "Software"), to deal in the Software without restriction, including      --</em></span>
33 <span class="comment"><em>-- without limitation the rights to use, copy, modify, merge, publish,      --</em></span>
34 <span class="comment"><em>-- distribute, distribute with modifications, sublicense, and/or sell       --</em></span>
35 <span class="comment"><em>-- copies of the Software, and to permit persons to whom the Software is    --</em></span>
36 <span class="comment"><em>-- furnished to do so, subject to the following conditions:                 --</em></span>
37 <span class="comment"><em>--                                                                          --</em></span>
38 <span class="comment"><em>-- The above copyright notice and this permission notice shall be included  --</em></span>
39 <span class="comment"><em>-- in all copies or substantial portions of the Software.                   --</em></span>
40 <span class="comment"><em>--                                                                          --</em></span>
41 <span class="comment"><em>-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --</em></span>
42 <span class="comment"><em>-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --</em></span>
43 <span class="comment"><em>-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --</em></span>
44 <span class="comment"><em>-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --</em></span>
45 <span class="comment"><em>-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --</em></span>
46 <span class="comment"><em>-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --</em></span>
47 <span class="comment"><em>-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --</em></span>
48 <span class="comment"><em>--                                                                          --</em></span>
49 <span class="comment"><em>-- Except as contained in this notice, the name(s) of the above copyright   --</em></span>
50 <span class="comment"><em>-- holders shall not be used in advertising or otherwise to promote the     --</em></span>
51 <span class="comment"><em>-- sale, use or other dealings in this Software without prior written       --</em></span>
52 <span class="comment"><em>-- authorization.                                                           --</em></span>
53 <span class="comment"><em>------------------------------------------------------------------------------</em></span>
54 <span class="comment"><em>--  Author:  Juergen Pfeifer, 1996</em></span>
55 <span class="comment"><em>--  Version Control:</em></span>
56 <span class="comment"><em>--  @Revision: 1.25 @</em></span>
57 <span class="comment"><em>--  Binding Version 01.00</em></span>
58 <span class="comment"><em>------------------------------------------------------------------------------</em></span>
59 <b>with</b> System;
60 <b>with</b> <a href="interfac__ads.htm#ref_38_9">Interfaces</a>.C;
61 <b>with</b> <a href="interfac__ads.htm#ref_38_9">Interfaces</a>.C.Strings; <b>use</b> <a href="interfac__ads.htm#ref_38_9">Interfaces</a>.C.Strings;
62
63 <b>package</b> <a href="terminal_interface__ads.htm#ref_43_9">Terminal_Interface</a>.<a href="terminal_interface-curses__ads.htm#ref_48_28">Curses</a>.<span class="symbol"><a name="ref_46_35" href="terminal_interface-curses-aux__adb.htm#ref_42_40">Aux</a></span> <b>is</b>
64    <b>pragma</b> Preelaborate (<a href="terminal_interface__ads.htm#ref_43_9">Terminal_Interface</a>.<a href="terminal_interface-curses__ads.htm#ref_48_28">Curses</a>.<a href="terminal_interface-curses-aux__ads.htm#ref_46_35">Aux</a>);
65
66    <b>subtype</b> <span class="symbol"><a name="ref_49_12">C_Int</a></span>      <b>is</b> <a href="interfac__ads.htm#ref_38_9">Interfaces</a>.C.int;
67    <b>subtype</b> <span class="symbol"><a name="ref_50_12">C_Short</a></span>    <b>is</b> <a href="interfac__ads.htm#ref_38_9">Interfaces</a>.C.short;
68    <b>subtype</b> <span class="symbol"><a name="ref_51_12">C_Long_Int</a></span> <b>is</b> <a href="interfac__ads.htm#ref_38_9">Interfaces</a>.C.long;
69    <b>subtype</b> <span class="symbol"><a name="ref_52_12">C_Size_T</a></span>   <b>is</b> <a href="interfac__ads.htm#ref_38_9">Interfaces</a>.C.size_t;
70    <b>subtype</b> <span class="symbol"><a name="ref_53_12">C_UInt</a></span>     <b>is</b> <a href="interfac__ads.htm#ref_38_9">Interfaces</a>.C.unsigned;
71    <b>subtype</b> <span class="symbol"><a name="ref_54_12">C_ULong</a></span>    <b>is</b> <a href="interfac__ads.htm#ref_38_9">Interfaces</a>.C.unsigned_long;
72    <b>subtype</b> <span class="symbol"><a name="ref_55_12">C_Char_Ptr</a></span> <b>is</b> <a href="interfac__ads.htm#ref_38_9">Interfaces</a>.C.Strings.chars_ptr;
73    <b>type</b>    <span class="symbol"><a name="ref_56_12">C_Void_Ptr</a></span> <b>is</b> <b>new</b> System.Address;
74
75    <span class="comment"><em>--  This is how those constants are defined in ncurses. I see them also</em></span>
76    <span class="comment"><em>--  exactly like this in all ETI implementations I ever tested. So it</em></span>
77    <span class="comment"><em>--  could be that this is quite general, but please check with your curses.</em></span>
78    <span class="comment"><em>--  This is critical, because curses sometime mixes Boolean returns with</em></span>
79    <span class="comment"><em>--  returning an error status.</em></span>
80    <span class="symbol"><a name="ref_63_4">Curses_Ok</a></span>    : <b>constant</b> <a href="terminal_interface-curses-aux__ads.htm#ref_49_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>;
81    <span class="symbol"><a name="ref_64_4">Curses_Err</a></span>   : <b>constant</b> <a href="terminal_interface-curses-aux__ads.htm#ref_49_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>;
82
83    <span class="symbol"><a name="ref_66_4">Curses_True</a></span>  : <b>constant</b> <a href="terminal_interface-curses-aux__ads.htm#ref_49_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>;
84    <span class="symbol"><a name="ref_67_4">Curses_False</a></span> : <b>constant</b> <a href="terminal_interface-curses-aux__ads.htm#ref_49_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>;
85
86    <span class="comment"><em>--  Eti_Error: type for error codes returned by the menu and form subsystem</em></span>
87    <b>type</b> <span class="symbol"><a name="ref_70_9" href="terminal_interface-curses-aux__ads.htm#ref_46_35">Eti_Error</a></span> <b>is</b>
88      (<span class="symbol"><a name="ref_71_7">E_Current</a></span>,
89       <span class="symbol"><a name="ref_72_7">E_Invalid_Field</a></span>,
90       <span class="symbol"><a name="ref_73_7">E_Request_Denied</a></span>,
91       <span class="symbol"><a name="ref_74_7">E_Not_Connected</a></span>,
92       <span class="symbol"><a name="ref_75_7">E_Not_Selectable</a></span>,
93       <span class="symbol"><a name="ref_76_7">E_No_Match</a></span>,
94       <span class="symbol"><a name="ref_77_7">E_Unknown_Command</a></span>,
95       <span class="symbol"><a name="ref_78_7">E_Not_Posted</a></span>,
96       <span class="symbol"><a name="ref_79_7">E_No_Room</a></span>,
97       <span class="symbol"><a name="ref_80_7">E_Bad_State</a></span>,
98       <span class="symbol"><a name="ref_81_7">E_Connected</a></span>,
99       <span class="symbol"><a name="ref_82_7">E_Posted</a></span>,
100       <span class="symbol"><a name="ref_83_7">E_Bad_Argument</a></span>,
101       <span class="symbol"><a name="ref_84_7">E_System_Error</a></span>,
102       <span class="symbol"><a name="ref_85_7">E_Ok</a></span>);
103
104    <b>procedure</b> <span class="symbol"><a name="ref_87_14" href="terminal_interface-curses-aux__adb.htm#ref_95_14">Eti_Exception</a></span> (<span class="symbol"><a name="ref_87_29" href="terminal_interface-curses-aux__adb.htm#ref_95_29">Code</a></span> : <a href="terminal_interface-curses-aux__ads.htm#ref_70_9">Eti_Error</a>);
105    <span class="comment"><em>--  Do nothing if Code = E_Ok.</em></span>
106    <span class="comment"><em>--  Else dispatch the error code and raise the appropriate exception.</em></span>
107
108    <b>procedure</b> <span class="symbol"><a name="ref_91_14" href="terminal_interface-curses-aux__adb.htm#ref_45_14">Fill_String</a></span> (<span class="symbol"><a name="ref_91_27" href="terminal_interface-curses-aux__adb.htm#ref_45_27">Cp</a></span>  : chars_ptr;
109                           <span class="symbol"><a name="ref_92_27" href="terminal_interface-curses-aux__adb.htm#ref_46_27">Str</a></span> : <b>out</b> String);
110    <span class="comment"><em>--  Fill the Str parameter with the string denoted by the chars_ptr</em></span>
111    <span class="comment"><em>--  C-Style string.</em></span>
112
113    <b>function</b> <span class="symbol"><a name="ref_96_13" href="terminal_interface-curses-aux__adb.htm#ref_74_13">Fill_String</a></span> (<span class="symbol"><a name="ref_96_26" href="terminal_interface-curses-aux__adb.htm#ref_74_26">Cp</a></span> : chars_ptr) <b>return</b> String;
114    <span class="comment"><em>--  Same but as function.</em></span>
115
116 <b>private</b>
117    <b>for</b> <a href="terminal_interface-curses-aux__ads.htm#ref_70_9">Eti_Error</a>'Size <b>use</b> <a href="terminal_interface-curses-aux__ads.htm#ref_49_12">C_Int</a>'Size;
118    <b>pragma</b> Convention (C, <a href="terminal_interface-curses-aux__ads.htm#ref_70_9">Eti_Error</a>);
119    <b>for</b> <a href="terminal_interface-curses-aux__ads.htm#ref_70_9">Eti_Error</a> <b>use</b>
120      (<a href="terminal_interface-curses-aux__ads.htm#ref_71_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>,
121       <a href="terminal_interface-curses-aux__ads.htm#ref_72_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>,
122       <a href="terminal_interface-curses-aux__ads.htm#ref_73_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>,
123       <a href="terminal_interface-curses-aux__ads.htm#ref_74_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>,
124       <a href="terminal_interface-curses-aux__ads.htm#ref_75_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>,
125       <a href="terminal_interface-curses-aux__ads.htm#ref_76_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>,
126       <a href="terminal_interface-curses-aux__ads.htm#ref_77_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>,
127       <a href="terminal_interface-curses-aux__ads.htm#ref_78_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>,
128       <a href="terminal_interface-curses-aux__ads.htm#ref_79_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>,
129       <a href="terminal_interface-curses-aux__ads.htm#ref_80_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>,
130       <a href="terminal_interface-curses-aux__ads.htm#ref_81_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>,
131       <a href="terminal_interface-curses-aux__ads.htm#ref_82_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>,
132       <a href="terminal_interface-curses-aux__ads.htm#ref_83_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>,
133       <a href="terminal_interface-curses-aux__ads.htm#ref_84_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>,
134       <a href="terminal_interface-curses-aux__ads.htm#ref_85_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>);
135 <b>end</b> <a href="terminal_interface__ads.htm#ref_43_9">Terminal_Interface</a>.<a href="terminal_interface-curses__ads.htm#ref_48_28">Curses</a>.<a href="terminal_interface-curses-aux__ads.htm#ref_46_35">Aux</a>;
136 </pre></body></html>