ncurses 5.6 - patch 20070505
[ncurses.git] / doc / html / ada / terminal_interface-curses-aux__adb.htm
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML><HEAD><TITLE>terminal_interface-curses-aux.adb</TITLE></HEAD>
3 <BODY>
4 <HR><DIV ALIGN="center"><H1> File : terminal_interface-curses-aux.adb </H1></DIV><HR>
5 <PRE>
6 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
7 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
8 <FONT COLOR=green><EM>--                           <A HREF="http://www.gnat.com">GNAT</A> ncurses Binding                           --</EM></FONT>
9 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
10 <FONT COLOR=green><EM>--                      Terminal_Interface.Curses.Aux                       --</EM></FONT>
11 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
12 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
13 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
14 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
15 <FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
16 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
17 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
18 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
19 <FONT COLOR=green><EM>-- "Software"), to deal in the Software without restriction, including      --</EM></FONT>
20 <FONT COLOR=green><EM>-- without limitation the rights to use, copy, modify, merge, publish,      --</EM></FONT>
21 <FONT COLOR=green><EM>-- distribute, distribute with modifications, sublicense, and/or sell       --</EM></FONT>
22 <FONT COLOR=green><EM>-- copies of the Software, and to permit persons to whom the Software is    --</EM></FONT>
23 <FONT COLOR=green><EM>-- furnished to do so, subject to the following conditions:                 --</EM></FONT>
24 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
25 <FONT COLOR=green><EM>-- The above copyright notice and this permission notice shall be included  --</EM></FONT>
26 <FONT COLOR=green><EM>-- in all copies or substantial portions of the Software.                   --</EM></FONT>
27 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
28 <FONT COLOR=green><EM>-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --</EM></FONT>
29 <FONT COLOR=green><EM>-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --</EM></FONT>
30 <FONT COLOR=green><EM>-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --</EM></FONT>
31 <FONT COLOR=green><EM>-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --</EM></FONT>
32 <FONT COLOR=green><EM>-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --</EM></FONT>
33 <FONT COLOR=green><EM>-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --</EM></FONT>
34 <FONT COLOR=green><EM>-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --</EM></FONT>
35 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
36 <FONT COLOR=green><EM>-- Except as contained in this notice, the name(s) of the above copyright   --</EM></FONT>
37 <FONT COLOR=green><EM>-- holders shall not be used in advertising or otherwise to promote the     --</EM></FONT>
38 <FONT COLOR=green><EM>-- sale, use or other dealings in this Software without prior written       --</EM></FONT>
39 <FONT COLOR=green><EM>-- authorization.                                                           --</EM></FONT>
40 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
41 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
42 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
43 <FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
44 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
45 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
46 <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_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_41_40" HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A></FONT> <b>is</b>
47    <FONT COLOR=green><EM>--</EM></FONT>
48    <FONT COLOR=green><EM>--  Some helpers</EM></FONT>
49    <b>procedure</b> <FONT COLOR=red><A NAME="ref_44_14" HREF="terminal_interface-curses-aux__ads.htm#ref_116_14">Fill_String</A></FONT> (<FONT COLOR=red><A NAME="ref_44_27" HREF="terminal_interface-curses-aux__ads.htm#ref_116_27">Cp</A></FONT>  : <b>in</b>  chars_ptr;
50                           <FONT COLOR=red><A NAME="ref_45_27" HREF="terminal_interface-curses-aux__ads.htm#ref_117_27">Str</A></FONT> : <b>out</b> String)
51    <b>is</b>
52       <FONT COLOR=green><EM>--  Fill the string with the characters referenced by the</EM></FONT>
53       <FONT COLOR=green><EM>--  chars_ptr.</EM></FONT>
54       <FONT COLOR=green><EM>--</EM></FONT>
55       <FONT COLOR=red><A NAME="ref_50_7">Len</A></FONT> : Natural;
56    <b>begin</b>
57       <b>if</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_116_27">Cp</A> /= Null_Ptr <b>then</b>
58          <A HREF="terminal_interface-curses-aux__adb.htm#ref_50_7">Len</A> := Natural (Strlen (<A HREF="terminal_interface-curses-aux__ads.htm#ref_116_27">Cp</A>));
59          <b>if</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_117_27">Str</A>'Length &lt; <A HREF="terminal_interface-curses-aux__adb.htm#ref_50_7">Len</A> <b>then</b>
60             <b>raise</b> Constraint_Error;
61          <b>end</b> <b>if</b>;
62          <b>declare</b>
63             <FONT COLOR=red><A NAME="ref_58_13">S</A></FONT> : String (1 .. <A HREF="terminal_interface-curses-aux__adb.htm#ref_50_7">Len</A>);
64          <b>begin</b>
65             <A HREF="terminal_interface-curses-aux__adb.htm#ref_58_13">S</A> := Value (<A HREF="terminal_interface-curses-aux__ads.htm#ref_116_27">Cp</A>);
66             <A HREF="terminal_interface-curses-aux__ads.htm#ref_117_27">Str</A> (<A HREF="terminal_interface-curses-aux__ads.htm#ref_117_27">Str</A>'First .. (<A HREF="terminal_interface-curses-aux__ads.htm#ref_117_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>);
67          <b>end</b>;
68       <b>else</b>
69          <A HREF="terminal_interface-curses-aux__adb.htm#ref_50_7">Len</A> := 0;
70       <b>end</b> <b>if</b>;
71
72       <b>if</b> <A HREF="terminal_interface-curses-aux__adb.htm#ref_50_7">Len</A> &lt; <A HREF="terminal_interface-curses-aux__ads.htm#ref_117_27">Str</A>'Length <b>then</b>
73          <A HREF="terminal_interface-curses-aux__ads.htm#ref_117_27">Str</A> ((<A HREF="terminal_interface-curses-aux__ads.htm#ref_117_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_117_27">Str</A>'Last) := (<b>others</b> =&gt; ' ');
74       <b>end</b> <b>if</b>;
75
76    <b>end</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_116_14">Fill_String</A>;
77
78    <b>function</b> <FONT COLOR=red><A NAME="ref_73_13" HREF="terminal_interface-curses-aux__ads.htm#ref_121_13">Fill_String</A></FONT> (<FONT COLOR=red><A NAME="ref_73_26" HREF="terminal_interface-curses-aux__ads.htm#ref_121_26">Cp</A></FONT> : chars_ptr) <b>return</b> String
79    <b>is</b>
80       <FONT COLOR=red><A NAME="ref_75_7">Len</A></FONT> : Natural;
81    <b>begin</b>
82       <b>if</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_121_26">Cp</A> /= Null_Ptr <b>then</b>
83          <A HREF="terminal_interface-curses-aux__adb.htm#ref_75_7">Len</A> := Natural (Strlen (<A HREF="terminal_interface-curses-aux__ads.htm#ref_121_26">Cp</A>));
84          <b>if</b> <A HREF="terminal_interface-curses-aux__adb.htm#ref_75_7">Len</A> = 0 <b>then</b>
85             <b>return</b> "";
86          <b>else</b>
87             <b>declare</b>
88                <FONT COLOR=red><A NAME="ref_83_16">S</A></FONT> : String (1 .. <A HREF="terminal_interface-curses-aux__adb.htm#ref_75_7">Len</A>);
89             <b>begin</b>
90                <A HREF="terminal_interface-curses-aux__ads.htm#ref_116_14">Fill_String</A> (<A HREF="terminal_interface-curses-aux__ads.htm#ref_121_26">Cp</A>, <A HREF="terminal_interface-curses-aux__adb.htm#ref_83_16">S</A>);
91                <b>return</b> <A HREF="terminal_interface-curses-aux__adb.htm#ref_83_16">S</A>;
92             <b>end</b>;
93          <b>end</b> <b>if</b>;
94       <b>else</b>
95          <b>return</b> "";
96       <b>end</b> <b>if</b>;
97    <b>end</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_121_13">Fill_String</A>;
98
99    <b>procedure</b> <FONT COLOR=red><A NAME="ref_94_14" HREF="terminal_interface-curses-aux__ads.htm#ref_96_14">Eti_Exception</A></FONT> (<FONT COLOR=red><A NAME="ref_94_29" HREF="terminal_interface-curses-aux__ads.htm#ref_96_29">Code</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_78_12">Eti_Error</A>)
100    <b>is</b>
101    <b>begin</b>
102       <b>case</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_96_29">Code</A> <b>is</b>
103          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_80_4">E_Ok</A>              =&gt; <b>null</b>;
104          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_81_4">E_System_Error</A>    =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_389_4">Eti_System_Error</A>;
105          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_82_4">E_Bad_Argument</A>    =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_390_4">Eti_Bad_Argument</A>;
106          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_83_4">E_Posted</A>          =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_391_4">Eti_Posted</A>;
107          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_84_4">E_Connected</A>       =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_392_4">Eti_Connected</A>;
108          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_85_4">E_Bad_State</A>       =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_393_4">Eti_Bad_State</A>;
109          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_86_4">E_No_Room</A>         =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_394_4">Eti_No_Room</A>;
110          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_87_4">E_Not_Posted</A>      =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_395_4">Eti_Not_Posted</A>;
111          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_88_4">E_Unknown_Command</A> =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_396_4">Eti_Unknown_Command</A>;
112          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_89_4">E_No_Match</A>        =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_397_4">Eti_No_Match</A>;
113          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_90_4">E_Not_Selectable</A>  =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_398_4">Eti_Not_Selectable</A>;
114          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_91_4">E_Not_Connected</A>   =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_399_4">Eti_Not_Connected</A>;
115          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_92_4">E_Request_Denied</A>  =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_400_4">Eti_Request_Denied</A>;
116          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_93_4">E_Invalid_Field</A>   =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_401_4">Eti_Invalid_Field</A>;
117          <b>when</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_94_4">E_Current</A>         =&gt; <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_402_4">Eti_Current</A>;
118       <b>end</b> <b>case</b>;
119    <b>end</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_96_14">Eti_Exception</A>;
120
121 <b>end</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
122 </PRE></BODY></HTML>