ncurses 5.4
[ncurses.git] / doc / html / ada / terminal_interface-curses-forms-field_types__adb.htm
1 <HTML><HEAD><TITLE>terminal_interface-curses-forms-field_types.adb</TITLE></HEAD>
2 <BODY>
3 <HR><DIV ALIGN="center"><H1> File : terminal_interface-curses-forms-field_types.adb </H1></DIV><HR>
4 <PRE>
5 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
6 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
7 <FONT COLOR=green><EM>--                           <A HREF="http://www.gnat.com">GNAT</A> ncurses Binding                           --</EM></FONT>
8 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
9 <FONT COLOR=green><EM>--                 Terminal_Interface.Curses.Forms.Field_Types              --</EM></FONT>
10 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
11 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
12 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
13 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
14 <FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
15 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
16 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
17 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
18 <FONT COLOR=green><EM>-- "Software"), to deal in the Software without restriction, including      --</EM></FONT>
19 <FONT COLOR=green><EM>-- without limitation the rights to use, copy, modify, merge, publish,      --</EM></FONT>
20 <FONT COLOR=green><EM>-- distribute, distribute with modifications, sublicense, and/or sell       --</EM></FONT>
21 <FONT COLOR=green><EM>-- copies of the Software, and to permit persons to whom the Software is    --</EM></FONT>
22 <FONT COLOR=green><EM>-- furnished to do so, subject to the following conditions:                 --</EM></FONT>
23 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
24 <FONT COLOR=green><EM>-- The above copyright notice and this permission notice shall be included  --</EM></FONT>
25 <FONT COLOR=green><EM>-- in all copies or substantial portions of the Software.                   --</EM></FONT>
26 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
27 <FONT COLOR=green><EM>-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --</EM></FONT>
28 <FONT COLOR=green><EM>-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --</EM></FONT>
29 <FONT COLOR=green><EM>-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --</EM></FONT>
30 <FONT COLOR=green><EM>-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --</EM></FONT>
31 <FONT COLOR=green><EM>-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --</EM></FONT>
32 <FONT COLOR=green><EM>-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --</EM></FONT>
33 <FONT COLOR=green><EM>-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --</EM></FONT>
34 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
35 <FONT COLOR=green><EM>-- Except as contained in this notice, the name(s) of the above copyright   --</EM></FONT>
36 <FONT COLOR=green><EM>-- holders shall not be used in advertising or otherwise to promote the     --</EM></FONT>
37 <FONT COLOR=green><EM>-- sale, use or other dealings in this Software without prior written       --</EM></FONT>
38 <FONT COLOR=green><EM>-- authorization.                                                           --</EM></FONT>
39 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
40 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
41 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
42 <FONT COLOR=green><EM>--  @Revision: 1.14 @</EM></FONT>
43 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
44 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
45 <b>with</b> <A HREF="interfac__ads.htm#23_9">Interfaces</A>.C;
46 <b>with</b> <A HREF="terminal_interface__ads.htm#41_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#48_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#41_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#48_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#50_35">Aux</A>;
47 <b>with</b> Ada.Unchecked_Deallocation;
48 <b>with</b> Ada.Unchecked_Conversion;
49 <FONT COLOR=green><EM>--  |</EM></FONT>
50 <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
51 <FONT COLOR=green><EM>--  | man page form_fieldtype.3x</EM></FONT>
52 <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
53 <FONT COLOR=green><EM>--  |</EM></FONT>
54 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#41_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#48_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#48_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#43_41">Field_Types</A> <b>is</b>
55
56    <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#23_9">Interfaces</A>.C.int;
57    <b>use</b> <b>type</b> System.Address;
58
59    <b>function</b> <FONT COLOR=red><A NAME="55_13">To_Argument_Access</A></FONT> <b>is</b> <b>new</b> Ada.Unchecked_Conversion
60      (System.Address, <A HREF="terminal_interface-curses-forms-field_types__ads.htm#216_9">Argument_Access</A>);
61
62    <b>function</b> <FONT COLOR=red><A NAME="58_13">Get_Fieldtype</A></FONT> (<FONT COLOR=red><A NAME="58_28">F</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#55_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#132_9">C_Field_Type</A>;
63    <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#58_13">Get_Fieldtype</A>, "field_type");
64
65    <b>function</b> <FONT COLOR=red><A NAME="61_13">Get_Arg</A></FONT> (<FONT COLOR=red><A NAME="61_22">F</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#55_9">Field</A>) <b>return</b> System.Address;
66    <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#61_13">Get_Arg</A>, "field_arg");
67    <FONT COLOR=green><EM>--  |</EM></FONT>
68    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
69    <FONT COLOR=green><EM>--  | man page form_field_validation.3x</EM></FONT>
70    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
71    <FONT COLOR=green><EM>--  |</EM></FONT>
72    <FONT COLOR=green><EM>--  |</EM></FONT>
73    <FONT COLOR=green><EM>--  |</EM></FONT>
74    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#79_13">Get_Type</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#79_23">Fld</A> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#55_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#63_9">Field_Type_Access</A>
75    <b>is</b>
76       <FONT COLOR=red><A NAME="72_7">Low_Level</A></FONT> : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#132_9">C_Field_Type</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#58_13">Get_Fieldtype</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#79_23">Fld</A>);
77       <FONT COLOR=red><A NAME="73_7">Arg</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#216_9">Argument_Access</A>;
78    <b>begin</b>
79       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#72_7">Low_Level</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#134_4">Null_Field_Type</A> <b>then</b>
80          <b>return</b> <b>null</b>;
81       <b>else</b>
82          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#72_7">Low_Level</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#143_4">M_Builtin_Router</A> <b>or</b> <b>else</b>
83            <A HREF="terminal_interface-curses-forms-field_types__adb.htm#72_7">Low_Level</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#141_4">M_Generic_Type</A> <b>or</b> <b>else</b>
84            <A HREF="terminal_interface-curses-forms-field_types__adb.htm#72_7">Low_Level</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#144_4">M_Choice_Router</A> <b>or</b> <b>else</b>
85            <A HREF="terminal_interface-curses-forms-field_types__adb.htm#72_7">Low_Level</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#142_4">M_Generic_Choice</A> <b>then</b>
86             <A HREF="terminal_interface-curses-forms-field_types__adb.htm#73_7">Arg</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#55_13">To_Argument_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#61_13">Get_Arg</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#79_23">Fld</A>));
87             <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#73_7">Arg</A> = <b>null</b> <b>then</b>
88                <b>raise</b> <A HREF="terminal_interface-curses-forms__ads.htm#288_4">Form_Exception</A>;
89             <b>else</b>
90                <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#73_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#212_7">Typ</A>;
91             <b>end</b> <b>if</b>;
92          <b>else</b>
93             <b>raise</b> <A HREF="terminal_interface-curses-forms__ads.htm#288_4">Form_Exception</A>;
94          <b>end</b> <b>if</b>;
95       <b>end</b> <b>if</b>;
96    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#79_13">Get_Type</A><A HREF="terminal_interface-curses-forms-field_types__ads.htm#79_13">;</A>
97
98    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#162_13">Make_Arg</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#162_23">Args</A> : System.Address) <b>return</b> System.Address
99    <b>is</b>
100       <FONT COLOR=green><EM>--  Actually args is a double indirected pointer to the arguments</EM></FONT>
101       <FONT COLOR=green><EM>--  of a C variable argument list. In theory it is now quite</EM></FONT>
102       <FONT COLOR=green><EM>--  complicated to write portable routine that reads the arguments,</EM></FONT>
103       <FONT COLOR=green><EM>--  because one has to know the growth direction of the stack and</EM></FONT>
104       <FONT COLOR=green><EM>--  the sizes of the individual arguments.</EM></FONT>
105       <FONT COLOR=green><EM>--  Fortunately we are only interested in the first argument (#0),</EM></FONT>
106       <FONT COLOR=green><EM>--  we know its size and for the first arg we don't care about</EM></FONT>
107       <FONT COLOR=green><EM>--  into which stack direction we have to proceed. We simply</EM></FONT>
108       <FONT COLOR=green><EM>--  resolve the double indirection and thats it.</EM></FONT>
109       <b>type</b> <FONT COLOR=red><A NAME="105_12">V</A></FONT> <b>is</b> <b>access</b> <b>all</b> System.Address;
110       <b>function</b> <FONT COLOR=red><A NAME="106_16">To_Access</A></FONT> <b>is</b> <b>new</b> Ada.Unchecked_Conversion (System.Address,
111                                                           <A HREF="terminal_interface-curses-forms-field_types__adb.htm#105_12">V</A>);
112    <b>begin</b>
113       <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#106_16">To_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#106_16">To_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#162_23">Args</A>).<b>all</b>).<b>all</b>;
114    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#162_13">Make_Arg</A><A HREF="terminal_interface-curses-forms-field_types__ads.htm#162_13">;</A>
115
116    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#167_13">Copy_Arg</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#167_23">Usr</A> : System.Address) <b>return</b> System.Address
117    <b>is</b>
118    <b>begin</b>
119       <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#167_23">Usr</A>;
120    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#167_13">Copy_Arg</A><A HREF="terminal_interface-curses-forms-field_types__ads.htm#167_13">;</A>
121
122    <b>procedure</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#172_14">Free_Arg</A><FONT COLOR=red><A NAME="118_14"></A></FONT> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#172_24">Usr</A> : <b>in</b> System.Address)
123    <b>is</b>
124       <b>procedure</b> <FONT COLOR=red><A NAME="120_17">Free_Type</A></FONT> <b>is</b> <b>new</b> Ada.Unchecked_Deallocation
125         (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#52_9">Field_Type</A>'Class, <A HREF="terminal_interface-curses-forms-field_types__ads.htm#63_9">Field_Type_Access</A>);
126       <b>procedure</b> <FONT COLOR=red><A NAME="122_17">Freeargs</A></FONT> <b>is</b> <b>new</b> Ada.Unchecked_Deallocation
127         (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#211_9">Argument</A>, <A HREF="terminal_interface-curses-forms-field_types__ads.htm#216_9">Argument_Access</A>);
128
129       <FONT COLOR=red><A NAME="125_7">To_Be_Free</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#216_9">Argument_Access</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#55_13">To_Argument_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#172_24">Usr</A>);
130       <FONT COLOR=red><A NAME="126_7">Low_Level</A></FONT>  : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#132_9">C_Field_Type</A>;
131    <b>begin</b>
132       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#125_7">To_Be_Free</A> /= <b>null</b> <b>then</b>
133          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#125_7">To_Be_Free</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Usr</A> /= System.Null_Address <b>then</b>
134             <A HREF="terminal_interface-curses-forms-field_types__adb.htm#126_7">Low_Level</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#125_7">To_Be_Free</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A>;
135             <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#126_7">Low_Level</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#126_10">Freearg</A> /= <b>null</b> <b>then</b>
136                <A HREF="terminal_interface-curses-forms-field_types__adb.htm#126_7">Low_Level</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#126_10">Freearg</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#125_7">To_Be_Free</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Usr</A>);
137             <b>end</b> <b>if</b>;
138          <b>end</b> <b>if</b>;
139          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#125_7">To_Be_Free</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#212_7">Typ</A> /= <b>null</b> <b>then</b>
140             <A HREF="terminal_interface-curses-forms-field_types__adb.htm#120_17">Free_Type</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#125_7">To_Be_Free</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#212_7">Typ</A>);
141          <b>end</b> <b>if</b>;
142          <A HREF="terminal_interface-curses-forms-field_types__adb.htm#122_17">Freeargs</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#125_7">To_Be_Free</A>);
143       <b>end</b> <b>if</b>;
144    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#172_14">Free_Arg</A><A HREF="terminal_interface-curses-forms-field_types__ads.htm#172_14">;</A>
145
146
147    <b>procedure</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#151_14">Wrap_Builtin</A><FONT COLOR=red><A NAME="143_14"></A></FONT> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#151_28">Fld</A> : <A HREF="terminal_interface-curses-forms__ads.htm#55_9">Field</A>;
148                            Typ : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#52_9">Field_Type</A>'Class;
149                            <A HREF="terminal_interface-curses-forms-field_types__ads.htm#153_28">Cft</A> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#132_9">C_Field_Type</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#148_13">C_Builtin_Router</A>)
150    <b>is</b>
151       <FONT COLOR=red><A NAME="147_7">Usr_Arg</A></FONT>   : System.Address := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#61_13">Get_Arg</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#151_28">Fld</A>);
152       <FONT COLOR=red><A NAME="148_7">Low_Level</A></FONT> : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#132_9">C_Field_Type</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#58_13">Get_Fieldtype</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#151_28">Fld</A>);
153       <FONT COLOR=red><A NAME="149_7">Arg</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#216_9">Argument_Access</A>;
154       <FONT COLOR=red><A NAME="150_7">Res</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#78_12">Eti_Error</A>;
155       <b>function</b> <FONT COLOR=red><A NAME="151_16">Set_Fld_Type</A></FONT> (<FONT COLOR=red><A NAME="151_30">F</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#55_9">Field</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#151_28">Fld</A>;
156                              <FONT COLOR=red><A NAME="152_30">Cf</A></FONT>   : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#132_9">C_Field_Type</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#153_28">Cft</A>;
157                              <FONT COLOR=red><A NAME="153_30">Arg1</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#216_9">Argument_Access</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#46_12">C_Int</A>;
158       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#151_16">Set_Fld_Type</A>, "set_field_type");
159
160    <b>begin</b>
161       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#148_7">Low_Level</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#134_4">Null_Field_Type</A>);
162       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#153_28">Cft</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#148_13">C_Builtin_Router</A> <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#153_28">Cft</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#149_13">C_Choice_Router</A> <b>then</b>
163          <b>raise</b> <A HREF="terminal_interface-curses-forms__ads.htm#288_4">Form_Exception</A>;
164       <b>else</b>
165          <A HREF="terminal_interface-curses-forms-field_types__adb.htm#149_7">Arg</A> := <b>new</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#211_9">Argument</A>'(Usr =&gt; System.Null_Address,
166                               Typ =&gt; <b>new</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#52_9">Field_Type</A>'Class'(Typ),
167                               Cft =&gt; <A HREF="terminal_interface-curses-forms-field_types__adb.htm#58_13">Get_Fieldtype</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#151_28">Fld</A>));
168          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#147_7">Usr_Arg</A> /= System.Null_Address <b>then</b>
169             <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#148_7">Low_Level</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#125_10">Copyarg</A> /= <b>null</b> <b>then</b>
170                <A HREF="terminal_interface-curses-forms-field_types__adb.htm#149_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Usr</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#148_7">Low_Level</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#125_10">Copyarg</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#147_7">Usr_Arg</A>);
171             <b>else</b>
172                <A HREF="terminal_interface-curses-forms-field_types__adb.htm#149_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Usr</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#147_7">Usr_Arg</A>;
173             <b>end</b> <b>if</b>;
174          <b>end</b> <b>if</b>;
175
176          <A HREF="terminal_interface-curses-forms-field_types__adb.htm#150_7">Res</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#151_16">Set_Fld_Type</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#153_30">Arg1</A> =&gt; <A HREF="terminal_interface-curses-forms-field_types__adb.htm#149_7">Arg</A>);
177          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#150_7">Res</A> /= <A HREF="terminal_interface-curses-aux__ads.htm#80_4">E_Ok</A> <b>then</b>
178             <A HREF="terminal_interface-curses-aux__ads.htm#96_14">Eti_Exception</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#150_7">Res</A>);
179          <b>end</b> <b>if</b>;
180       <b>end</b> <b>if</b>;
181    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#151_14">Wrap_Builtin</A><A HREF="terminal_interface-curses-forms-field_types__ads.htm#151_14">;</A>
182
183    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#177_13">Field_Check_Router</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#177_33">Fld</A> : <A HREF="terminal_interface-curses-forms__ads.htm#55_9">Field</A>;
184                                 <A HREF="terminal_interface-curses-forms-field_types__ads.htm#178_33">Usr</A> : System.Address) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#46_12">C_Int</A>
185    <b>is</b>
186       <FONT COLOR=red><A NAME="182_7">Arg</A></FONT>  : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#216_9">Argument_Access</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#55_13">To_Argument_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#178_33">Usr</A>);
187    <b>begin</b>
188       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#182_7">Arg</A> /= <b>null</b> <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#182_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#134_4">Null_Field_Type</A>
189                      <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#182_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#212_7">Typ</A> /= <b>null</b>);
190       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#182_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#127_10">Fcheck</A> /= <b>null</b> <b>then</b>
191          <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#182_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#127_10">Fcheck</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#177_33">Fld</A>, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#182_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Usr</A>);
192       <b>else</b>
193          <b>return</b> 1;
194       <b>end</b> <b>if</b>;
195    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#177_13">Field_Check_Router</A><A HREF="terminal_interface-curses-forms-field_types__ads.htm#177_13">;</A>
196
197    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#185_13">Char_Check_Router</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#185_32">Ch</A>  : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#46_12">C_Int</A>;
198                                <A HREF="terminal_interface-curses-forms-field_types__ads.htm#186_32">Usr</A> : System.Address) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#46_12">C_Int</A>
199    <b>is</b>
200       <FONT COLOR=red><A NAME="196_7">Arg</A></FONT>  : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#216_9">Argument_Access</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#55_13">To_Argument_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#186_32">Usr</A>);
201    <b>begin</b>
202       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#196_7">Arg</A> /= <b>null</b> <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#196_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#134_4">Null_Field_Type</A>
203                      <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#196_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#212_7">Typ</A> /= <b>null</b>);
204       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#196_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#128_10">Ccheck</A> /= <b>null</b> <b>then</b>
205          <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#196_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#128_10">Ccheck</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#185_32">Ch</A>, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#196_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Usr</A>);
206       <b>else</b>
207          <b>return</b> 1;
208       <b>end</b> <b>if</b>;
209    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#185_13">Char_Check_Router</A><A HREF="terminal_interface-curses-forms-field_types__ads.htm#185_13">;</A>
210
211    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#193_13">Next_Router</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#193_26">Fld</A> : <A HREF="terminal_interface-curses-forms__ads.htm#55_9">Field</A>;
212                          <A HREF="terminal_interface-curses-forms-field_types__ads.htm#194_26">Usr</A> : System.Address) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#46_12">C_Int</A>
213    <b>is</b>
214       <FONT COLOR=red><A NAME="210_7">Arg</A></FONT>  : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#216_9">Argument_Access</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#55_13">To_Argument_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#194_26">Usr</A>);
215    <b>begin</b>
216       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#210_7">Arg</A> /= <b>null</b> <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#210_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#134_4">Null_Field_Type</A>
217                      <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#210_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#212_7">Typ</A> /= <b>null</b>);
218       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#210_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#129_10">Next</A> /= <b>null</b> <b>then</b>
219          <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#210_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#129_10">Next</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#193_26">Fld</A>, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#210_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Usr</A>);
220       <b>else</b>
221          <b>return</b> 1;
222       <b>end</b> <b>if</b>;
223    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#193_13">Next_Router</A><A HREF="terminal_interface-curses-forms-field_types__ads.htm#193_13">;</A>
224
225    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#201_13">Prev_Router</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#201_26">Fld</A> : <A HREF="terminal_interface-curses-forms__ads.htm#55_9">Field</A>;
226                          <A HREF="terminal_interface-curses-forms-field_types__ads.htm#202_26">Usr</A> : System.Address) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#46_12">C_Int</A>
227    <b>is</b>
228       <FONT COLOR=red><A NAME="224_7">Arg</A></FONT>  : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#216_9">Argument_Access</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#55_13">To_Argument_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#202_26">Usr</A>);
229    <b>begin</b>
230       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#224_7">Arg</A> /= <b>null</b> <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#224_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#134_4">Null_Field_Type</A>
231                      <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#224_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#212_7">Typ</A> /= <b>null</b>);
232       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#224_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#129_16">Prev</A> /= <b>null</b> <b>then</b>
233          <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#224_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#129_16">Prev</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#201_26">Fld</A>, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#224_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Usr</A>);
234       <b>else</b>
235          <b>return</b> 1;
236       <b>end</b> <b>if</b>;
237    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#201_13">Prev_Router</A><A HREF="terminal_interface-curses-forms-field_types__ads.htm#201_13">;</A>
238
239    <FONT COLOR=green><EM>--  -----------------------------------------------------------------------</EM></FONT>
240    <FONT COLOR=green><EM>--</EM></FONT>
241    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#148_13">C_Builtin_Router</A> <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#132_9">C_Field_Type</A>
242    <b>is</b>
243       <FONT COLOR=red><A NAME="239_7">Res</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#78_12">Eti_Error</A>;
244       <FONT COLOR=red><A NAME="240_7">T</A></FONT>   : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#132_9">C_Field_Type</A>;
245    <b>begin</b>
246       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#143_4">M_Builtin_Router</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#134_4">Null_Field_Type</A> <b>then</b>
247          <A HREF="terminal_interface-curses-forms-field_types__adb.htm#240_7">T</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#222_13">New_Fieldtype</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#177_13">Field_Check_Router</A>'<b>Access</b>,
248                              <A HREF="terminal_interface-curses-forms-field_types__ads.htm#185_13">Char_Check_Router</A>'<b>Access</b>);
249          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#240_7">T</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#134_4">Null_Field_Type</A> <b>then</b>
250             <b>raise</b> <A HREF="terminal_interface-curses-forms__ads.htm#288_4">Form_Exception</A>;
251          <b>else</b>
252             <A HREF="terminal_interface-curses-forms-field_types__adb.htm#239_7">Res</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#227_13">Set_Fieldtype_Arg</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#240_7">T</A>,
253                                       <A HREF="terminal_interface-curses-forms-field_types__ads.htm#162_13">Make_Arg</A>'<b>Access</b>,
254                                       <A HREF="terminal_interface-curses-forms-field_types__ads.htm#167_13">Copy_Arg</A>'<b>Access</b>,
255                                       <A HREF="terminal_interface-curses-forms-field_types__ads.htm#172_14">Free_Arg</A>'<b>Access</b>);
256             <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#239_7">Res</A> /= <A HREF="terminal_interface-curses-aux__ads.htm#80_4">E_Ok</A> <b>then</b>
257                <A HREF="terminal_interface-curses-aux__ads.htm#96_14">Eti_Exception</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#239_7">Res</A>);
258             <b>end</b> <b>if</b>;
259          <b>end</b> <b>if</b>;
260          <A HREF="terminal_interface-curses-forms-field_types__ads.htm#143_4">M_Builtin_Router</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#240_7">T</A>;
261       <b>end</b> <b>if</b>;
262       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#143_4">M_Builtin_Router</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#134_4">Null_Field_Type</A>);
263       <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#143_4">M_Builtin_Router</A>;
264    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#148_13">C_Builtin_Router</A><A HREF="terminal_interface-curses-forms-field_types__ads.htm#148_13">;</A>
265
266    <FONT COLOR=green><EM>--  -----------------------------------------------------------------------</EM></FONT>
267    <FONT COLOR=green><EM>--</EM></FONT>
268    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#149_13">C_Choice_Router</A> <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#132_9">C_Field_Type</A>
269    <b>is</b>
270       <FONT COLOR=red><A NAME="266_7">Res</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#78_12">Eti_Error</A>;
271       <FONT COLOR=red><A NAME="267_7">T</A></FONT>   : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#132_9">C_Field_Type</A>;
272    <b>begin</b>
273       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#144_4">M_Choice_Router</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#134_4">Null_Field_Type</A> <b>then</b>
274          <A HREF="terminal_interface-curses-forms-field_types__adb.htm#267_7">T</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#222_13">New_Fieldtype</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#177_13">Field_Check_Router</A>'<b>Access</b>,
275                              <A HREF="terminal_interface-curses-forms-field_types__ads.htm#185_13">Char_Check_Router</A>'<b>Access</b>);
276          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#267_7">T</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#134_4">Null_Field_Type</A> <b>then</b>
277             <b>raise</b> <A HREF="terminal_interface-curses-forms__ads.htm#288_4">Form_Exception</A>;
278          <b>else</b>
279             <A HREF="terminal_interface-curses-forms-field_types__adb.htm#266_7">Res</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#227_13">Set_Fieldtype_Arg</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#267_7">T</A>,
280                                       <A HREF="terminal_interface-curses-forms-field_types__ads.htm#162_13">Make_Arg</A>'<b>Access</b>,
281                                       <A HREF="terminal_interface-curses-forms-field_types__ads.htm#167_13">Copy_Arg</A>'<b>Access</b>,
282                                       <A HREF="terminal_interface-curses-forms-field_types__ads.htm#172_14">Free_Arg</A>'<b>Access</b>);
283             <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#266_7">Res</A> /= <A HREF="terminal_interface-curses-aux__ads.htm#80_4">E_Ok</A> <b>then</b>
284                <A HREF="terminal_interface-curses-aux__ads.htm#96_14">Eti_Exception</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#266_7">Res</A>);
285             <b>end</b> <b>if</b>;
286
287             <A HREF="terminal_interface-curses-forms-field_types__adb.htm#266_7">Res</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#234_13">Set_Fieldtype_Choice</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#267_7">T</A>,
288                                          <A HREF="terminal_interface-curses-forms-field_types__ads.htm#193_13">Next_Router</A>'<b>Access</b>,
289                                          <A HREF="terminal_interface-curses-forms-field_types__ads.htm#201_13">Prev_Router</A>'<b>Access</b>);
290             <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#266_7">Res</A> /= <A HREF="terminal_interface-curses-aux__ads.htm#80_4">E_Ok</A> <b>then</b>
291                <A HREF="terminal_interface-curses-aux__ads.htm#96_14">Eti_Exception</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#266_7">Res</A>);
292             <b>end</b> <b>if</b>;
293          <b>end</b> <b>if</b>;
294          <A HREF="terminal_interface-curses-forms-field_types__ads.htm#144_4">M_Choice_Router</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#267_7">T</A>;
295       <b>end</b> <b>if</b>;
296       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#144_4">M_Choice_Router</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#134_4">Null_Field_Type</A>);
297       <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#144_4">M_Choice_Router</A>;
298    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#149_13">C_Choice_Router</A><A HREF="terminal_interface-curses-forms-field_types__ads.htm#149_13">;</A>
299
300 <b>end</b> <A HREF="terminal_interface__ads.htm#41_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#48_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#48_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#43_41">Field_Types</A><A HREF="terminal_interface-curses-forms-field_types__ads.htm#43_41">;</A>
301 </PRE></BODY></HTML>