ncurses 5.3
[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:  <A HREF="http://www.familiepfeifer.de/juergen">J&uuml;rgen Pfeifer</A>, 1996</EM></FONT>
41 <FONT COLOR=green><EM>--  Contact: <A HREF="http://www.familiepfeifer.de/Contact.aspx?Lang=en">www.familiepfeifer.de/Contact.aspx?Lang=en</A></EM></FONT>
42 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
43 <FONT COLOR=green><EM>--  @Revision: 1.13 @</EM></FONT>
44 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
45 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
46 <b>with</b> <A HREF="interfac__ads.htm#23_9">Interfaces</A>.C;
47 <b>with</b> <A HREF="terminal_interface__ads.htm#42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#51_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#51_35">Aux</A>;
48 <b>with</b> Ada.Unchecked_Deallocation;
49 <b>with</b> Ada.Unchecked_Conversion;
50 <FONT COLOR=green><EM>--  |</EM></FONT>
51 <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
52 <FONT COLOR=green><EM>--  | man page form_fieldtype.3x</EM></FONT>
53 <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
54 <FONT COLOR=green><EM>--  |</EM></FONT>
55 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#44_41">Field_Types</A><FONT COLOR=red><A NAME="51_46"></A></FONT> <b>is</b>
56
57    <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#23_9">Interfaces</A>.C.int;
58    <b>use</b> <b>type</b> System.Address;
59
60    <b>function</b> <FONT COLOR=red><A NAME="56_13">To_Argument_Access</A></FONT> <b>is</b> <b>new</b> Ada.Unchecked_Conversion
61      (System.Address, <A HREF="terminal_interface-curses-forms-field_types__ads.htm#217_9">Argument_Access</A>);
62
63    <b>function</b> <FONT COLOR=red><A NAME="59_13">Get_Fieldtype</A></FONT> (<FONT COLOR=red><A NAME="59_28">F</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#133_9">C_Field_Type</A>;
64    <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#59_13">Get_Fieldtype</A>, "field_type");
65
66    <b>function</b> <FONT COLOR=red><A NAME="62_13">Get_Arg</A></FONT> (<FONT COLOR=red><A NAME="62_22">F</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#56_9">Field</A>) <b>return</b> System.Address;
67    <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#62_13">Get_Arg</A>, "field_arg");
68    <FONT COLOR=green><EM>--  |</EM></FONT>
69    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
70    <FONT COLOR=green><EM>--  | man page form_field_validation.3x</EM></FONT>
71    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
72    <FONT COLOR=green><EM>--  |</EM></FONT>
73    <FONT COLOR=green><EM>--  |</EM></FONT>
74    <FONT COLOR=green><EM>--  |</EM></FONT>
75    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#80_13">Get_Type</A><FONT COLOR=red><A NAME="71_13"></A></FONT> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#80_23">Fld</A> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#64_9">Field_Type_Access</A>
76    <b>is</b>
77       <FONT COLOR=red><A NAME="73_7">Low_Level</A></FONT> : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#133_9">C_Field_Type</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#59_13">Get_Fieldtype</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#80_23">Fld</A>);
78       <FONT COLOR=red><A NAME="74_7">Arg</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#217_9">Argument_Access</A>;
79    <b>begin</b>
80       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#73_7">Low_Level</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#135_4">Null_Field_Type</A> <b>then</b>
81          <b>return</b> <b>null</b>;
82       <b>else</b>
83          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#73_7">Low_Level</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#144_4">M_Builtin_Router</A> <b>or</b> <b>else</b>
84            <A HREF="terminal_interface-curses-forms-field_types__adb.htm#73_7">Low_Level</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#142_4">M_Generic_Type</A> <b>or</b> <b>else</b>
85            <A HREF="terminal_interface-curses-forms-field_types__adb.htm#73_7">Low_Level</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#145_4">M_Choice_Router</A> <b>or</b> <b>else</b>
86            <A HREF="terminal_interface-curses-forms-field_types__adb.htm#73_7">Low_Level</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#143_4">M_Generic_Choice</A> <b>then</b>
87             <A HREF="terminal_interface-curses-forms-field_types__adb.htm#74_7">Arg</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#56_13">To_Argument_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#62_13">Get_Arg</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#80_23">Fld</A>));
88             <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#74_7">Arg</A> = <b>null</b> <b>then</b>
89                <b>raise</b> <A HREF="terminal_interface-curses-forms__ads.htm#289_4">Form_Exception</A>;
90             <b>else</b>
91                <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#74_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Typ</A>;
92             <b>end</b> <b>if</b>;
93          <b>else</b>
94             <b>raise</b> <A HREF="terminal_interface-curses-forms__ads.htm#289_4">Form_Exception</A>;
95          <b>end</b> <b>if</b>;
96       <b>end</b> <b>if</b>;
97    <b>end</b> Get_Type;
98
99    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#163_13">Make_Arg</A><FONT COLOR=red><A NAME="95_13"></A></FONT> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#163_23">Args</A> : System.Address) <b>return</b> System.Address
100    <b>is</b>
101       <FONT COLOR=green><EM>--  Actually args is a double indirected pointer to the arguments</EM></FONT>
102       <FONT COLOR=green><EM>--  of a C variable argument list. In theory it is now quite</EM></FONT>
103       <FONT COLOR=green><EM>--  complicated to write portable routine that reads the arguments,</EM></FONT>
104       <FONT COLOR=green><EM>--  because one has to know the growth direction of the stack and</EM></FONT>
105       <FONT COLOR=green><EM>--  the sizes of the individual arguments.</EM></FONT>
106       <FONT COLOR=green><EM>--  Fortunately we are only interested in the first argument (#0),</EM></FONT>
107       <FONT COLOR=green><EM>--  we know its size and for the first arg we don't care about</EM></FONT>
108       <FONT COLOR=green><EM>--  into which stack direction we have to proceed. We simply</EM></FONT>
109       <FONT COLOR=green><EM>--  resolve the double indirection and thats it.</EM></FONT>
110       <b>type</b> <FONT COLOR=red><A NAME="106_12">V</A></FONT> <b>is</b> <b>access</b> <b>all</b> System.Address;
111       <b>function</b> <FONT COLOR=red><A NAME="107_16">To_Access</A></FONT> <b>is</b> <b>new</b> Ada.Unchecked_Conversion (System.Address,
112                                                           <A HREF="terminal_interface-curses-forms-field_types__adb.htm#106_12">V</A>);
113    <b>begin</b>
114       <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#107_16">To_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#107_16">To_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#163_23">Args</A>).<b>all</b>).<b>all</b>;
115    <b>end</b> Make_Arg;
116
117    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#168_13">Copy_Arg</A><FONT COLOR=red><A NAME="113_13"></A></FONT> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#168_23">Usr</A> : System.Address) <b>return</b> System.Address
118    <b>is</b>
119    <b>begin</b>
120       <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#168_23">Usr</A>;
121    <b>end</b> Copy_Arg;
122
123    <b>procedure</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#173_14">Free_Arg</A><FONT COLOR=red><A NAME="119_14"></A></FONT> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#173_24">Usr</A> : <b>in</b> System.Address)
124    <b>is</b>
125       <b>procedure</b> <FONT COLOR=red><A NAME="121_17">Free_Type</A></FONT> <b>is</b> <b>new</b> Ada.Unchecked_Deallocation
126         (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#53_9">Field_Type</A>'Class, <A HREF="terminal_interface-curses-forms-field_types__ads.htm#64_9">Field_Type_Access</A>);
127       <b>procedure</b> <FONT COLOR=red><A NAME="123_17">Freeargs</A></FONT> <b>is</b> <b>new</b> Ada.Unchecked_Deallocation
128         (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#212_9">Argument</A>, <A HREF="terminal_interface-curses-forms-field_types__ads.htm#217_9">Argument_Access</A>);
129
130       <FONT COLOR=red><A NAME="126_7">To_Be_Free</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#217_9">Argument_Access</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#56_13">To_Argument_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#173_24">Usr</A>);
131       <FONT COLOR=red><A NAME="127_7">Low_Level</A></FONT>  : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#133_9">C_Field_Type</A>;
132    <b>begin</b>
133       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#126_7">To_Be_Free</A> /= <b>null</b> <b>then</b>
134          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#126_7">To_Be_Free</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Usr</A> /= System.Null_Address <b>then</b>
135             <A HREF="terminal_interface-curses-forms-field_types__adb.htm#127_7">Low_Level</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#126_7">To_Be_Free</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A>;
136             <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#127_7">Low_Level</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#127_10">Freearg</A> /= <b>null</b> <b>then</b>
137                <A HREF="terminal_interface-curses-forms-field_types__adb.htm#127_7">Low_Level</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#127_10">Freearg</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#126_7">To_Be_Free</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Usr</A>);
138             <b>end</b> <b>if</b>;
139          <b>end</b> <b>if</b>;
140          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#126_7">To_Be_Free</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Typ</A> /= <b>null</b> <b>then</b>
141             <A HREF="terminal_interface-curses-forms-field_types__adb.htm#121_17">Free_Type</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#126_7">To_Be_Free</A>.<A HREF="terminal_interface-curses-forms-field_types__adb.htm#126_7">Typ</A>);
142          <b>end</b> <b>if</b>;
143          <A HREF="terminal_interface-curses-forms-field_types__adb.htm#123_17">Freeargs</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#126_7">To_Be_Free</A>);
144       <b>end</b> <b>if</b>;
145    <b>end</b> Free_Arg;
146
147
148    <b>procedure</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#152_14">Wrap_Builtin</A><FONT COLOR=red><A NAME="144_14"></A></FONT> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#152_28">Fld</A> : <A HREF="terminal_interface-curses-forms__ads.htm#56_9">Field</A>;
149                            <A HREF="terminal_interface-curses-forms-field_types__ads.htm#153_28">Typ</A> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#53_9">Field_Type</A>'Class;
150                            <A HREF="terminal_interface-curses-forms-field_types__ads.htm#154_28">Cft</A> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#133_9">C_Field_Type</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#149_13">C_Builtin_Router</A>)
151    <b>is</b>
152       <FONT COLOR=red><A NAME="148_7">Usr_Arg</A></FONT>   : System.Address := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#62_13">Get_Arg</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#152_28">Fld</A>);
153       <FONT COLOR=red><A NAME="149_7">Low_Level</A></FONT> : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#133_9">C_Field_Type</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#59_13">Get_Fieldtype</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#152_28">Fld</A>);
154       <FONT COLOR=red><A NAME="150_7">Arg</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#217_9">Argument_Access</A>;
155       <FONT COLOR=red><A NAME="151_7">Res</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#79_12">Eti_Error</A>;
156       <b>function</b> <FONT COLOR=red><A NAME="152_16">Set_Fld_Type</A></FONT> (<FONT COLOR=red><A NAME="152_30">F</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#56_9">Field</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#152_28">Fld</A>;
157                              <FONT COLOR=red><A NAME="153_30">Cf</A></FONT>   : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#133_9">C_Field_Type</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#154_28">Cft</A>;
158                              <FONT COLOR=red><A NAME="154_30">Arg1</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#217_9">Argument_Access</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#47_12">C_Int</A>;
159       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#152_16">Set_Fld_Type</A>, "set_field_type");
160
161    <b>begin</b>
162       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#149_7">Low_Level</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#135_4">Null_Field_Type</A>);
163       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#154_28">Cft</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#149_13">C_Builtin_Router</A> <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#154_28">Cft</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#150_13">C_Choice_Router</A> <b>then</b>
164          <b>raise</b> <A HREF="terminal_interface-curses-forms__ads.htm#289_4">Form_Exception</A>;
165       <b>else</b>
166          <A HREF="terminal_interface-curses-forms-field_types__adb.htm#150_7">Arg</A> := <b>new</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#212_9">Argument</A>'(Usr =&gt; System.Null_Address,
167                               Typ =&gt; <b>new</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#53_9">Field_Type</A>'Class'(<A HREF="terminal_interface-curses-forms-field_types__ads.htm#153_28">Typ</A>),
168                               Cft =&gt; <A HREF="terminal_interface-curses-forms-field_types__adb.htm#59_13">Get_Fieldtype</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#152_28">Fld</A>));
169          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#148_7">Usr_Arg</A> /= System.Null_Address <b>then</b>
170             <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#149_7">Low_Level</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#126_10">Copyarg</A> /= <b>null</b> <b>then</b>
171                <A HREF="terminal_interface-curses-forms-field_types__adb.htm#150_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__adb.htm#150_7">Usr</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#149_7">Low_Level</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#126_10">Copyarg</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#148_7">Usr_Arg</A>);
172             <b>else</b>
173                <A HREF="terminal_interface-curses-forms-field_types__adb.htm#150_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__adb.htm#150_7">Usr</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#148_7">Usr_Arg</A>;
174             <b>end</b> <b>if</b>;
175          <b>end</b> <b>if</b>;
176
177          <A HREF="terminal_interface-curses-forms-field_types__adb.htm#151_7">Res</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#152_16">Set_Fld_Type</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#154_30">Arg1</A> =&gt; <A HREF="terminal_interface-curses-forms-field_types__adb.htm#150_7">Arg</A>);
178          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#151_7">Res</A> /= <A HREF="terminal_interface-curses-aux__ads.htm#81_4">E_Ok</A> <b>then</b>
179             <A HREF="terminal_interface-curses-aux__ads.htm#97_14">Eti_Exception</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#151_7">Res</A>);
180          <b>end</b> <b>if</b>;
181       <b>end</b> <b>if</b>;
182    <b>end</b> Wrap_Builtin;
183
184    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#178_13">Field_Check_Router</A><FONT COLOR=red><A NAME="180_13"></A></FONT> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#178_33">Fld</A> : <A HREF="terminal_interface-curses-forms__ads.htm#56_9">Field</A>;
185                                 <A HREF="terminal_interface-curses-forms-field_types__ads.htm#179_33">Usr</A> : System.Address) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#47_12">C_Int</A>
186    <b>is</b>
187       <FONT COLOR=red><A NAME="183_7">Arg</A></FONT>  : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#217_9">Argument_Access</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#56_13">To_Argument_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#179_33">Usr</A>);
188    <b>begin</b>
189       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#183_7">Arg</A> /= <b>null</b> <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#183_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#135_4">Null_Field_Type</A>
190                      <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#183_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Typ</A> /= <b>null</b>);
191       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#183_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#128_10">Fcheck</A> /= <b>null</b> <b>then</b>
192          <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#183_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#128_10">Fcheck</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#178_33">Fld</A>, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#183_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Usr</A>);
193       <b>else</b>
194          <b>return</b> 1;
195       <b>end</b> <b>if</b>;
196    <b>end</b> Field_Check_Router;
197
198    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#186_13">Char_Check_Router</A><FONT COLOR=red><A NAME="194_13"></A></FONT> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#186_32">Ch</A>  : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#47_12">C_Int</A>;
199                                <A HREF="terminal_interface-curses-forms-field_types__ads.htm#187_32">Usr</A> : System.Address) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#47_12">C_Int</A>
200    <b>is</b>
201       <FONT COLOR=red><A NAME="197_7">Arg</A></FONT>  : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#217_9">Argument_Access</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#56_13">To_Argument_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#187_32">Usr</A>);
202    <b>begin</b>
203       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#197_7">Arg</A> /= <b>null</b> <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#197_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#135_4">Null_Field_Type</A>
204                      <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#197_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Typ</A> /= <b>null</b>);
205       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#197_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#129_10">Ccheck</A> /= <b>null</b> <b>then</b>
206          <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#197_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#129_10">Ccheck</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#186_32">Ch</A>, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#197_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Usr</A>);
207       <b>else</b>
208          <b>return</b> 1;
209       <b>end</b> <b>if</b>;
210    <b>end</b> Char_Check_Router;
211
212    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#194_13">Next_Router</A><FONT COLOR=red><A NAME="208_13"></A></FONT> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#194_26">Fld</A> : <A HREF="terminal_interface-curses-forms__ads.htm#56_9">Field</A>;
213                          <A HREF="terminal_interface-curses-forms-field_types__ads.htm#195_26">Usr</A> : System.Address) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#47_12">C_Int</A>
214    <b>is</b>
215       <FONT COLOR=red><A NAME="211_7">Arg</A></FONT>  : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#217_9">Argument_Access</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#56_13">To_Argument_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#195_26">Usr</A>);
216    <b>begin</b>
217       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#211_7">Arg</A> /= <b>null</b> <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#211_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#135_4">Null_Field_Type</A>
218                      <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#211_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Typ</A> /= <b>null</b>);
219       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#211_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#130_10">Next</A> /= <b>null</b> <b>then</b>
220          <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#211_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#130_10">Next</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#194_26">Fld</A>, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#211_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Usr</A>);
221       <b>else</b>
222          <b>return</b> 1;
223       <b>end</b> <b>if</b>;
224    <b>end</b> Next_Router;
225
226    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#202_13">Prev_Router</A><FONT COLOR=red><A NAME="222_13"></A></FONT> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#202_26">Fld</A> : <A HREF="terminal_interface-curses-forms__ads.htm#56_9">Field</A>;
227                          <A HREF="terminal_interface-curses-forms-field_types__ads.htm#203_26">Usr</A> : System.Address) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#47_12">C_Int</A>
228    <b>is</b>
229       <FONT COLOR=red><A NAME="225_7">Arg</A></FONT>  : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#217_9">Argument_Access</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#56_13">To_Argument_Access</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#203_26">Usr</A>);
230    <b>begin</b>
231       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#225_7">Arg</A> /= <b>null</b> <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#225_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#135_4">Null_Field_Type</A>
232                      <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#225_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#213_7">Typ</A> /= <b>null</b>);
233       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#225_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#130_16">Prev</A> /= <b>null</b> <b>then</b>
234          <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#225_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#215_7">Cft</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#130_16">Prev</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#202_26">Fld</A>, <A HREF="terminal_interface-curses-forms-field_types__adb.htm#225_7">Arg</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#214_7">Usr</A>);
235       <b>else</b>
236          <b>return</b> 1;
237       <b>end</b> <b>if</b>;
238    <b>end</b> Prev_Router;
239
240    <FONT COLOR=green><EM>--  -----------------------------------------------------------------------</EM></FONT>
241    <FONT COLOR=green><EM>--</EM></FONT>
242    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#149_13">C_Builtin_Router</A><FONT COLOR=red><A NAME="238_13"></A></FONT> <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#133_9">C_Field_Type</A>
243    <b>is</b>
244       <FONT COLOR=red><A NAME="240_7">Res</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#79_12">Eti_Error</A>;
245       <FONT COLOR=red><A NAME="241_7">T</A></FONT>   : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#133_9">C_Field_Type</A>;
246    <b>begin</b>
247       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#144_4">M_Builtin_Router</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#135_4">Null_Field_Type</A> <b>then</b>
248          <A HREF="terminal_interface-curses-forms-field_types__adb.htm#241_7">T</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#223_13">New_Fieldtype</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#178_13">Field_Check_Router</A>'<b>Access</b>,
249                              <A HREF="terminal_interface-curses-forms-field_types__ads.htm#186_13">Char_Check_Router</A>'<b>Access</b>);
250          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#241_7">T</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#135_4">Null_Field_Type</A> <b>then</b>
251             <b>raise</b> <A HREF="terminal_interface-curses-forms__ads.htm#289_4">Form_Exception</A>;
252          <b>else</b>
253             <A HREF="terminal_interface-curses-forms-field_types__adb.htm#240_7">Res</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#228_13">Set_Fieldtype_Arg</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#241_7">T</A>,
254                                       <A HREF="terminal_interface-curses-forms-field_types__ads.htm#163_13">Make_Arg</A>'<b>Access</b>,
255                                       <A HREF="terminal_interface-curses-forms-field_types__ads.htm#168_13">Copy_Arg</A>'<b>Access</b>,
256                                       <A HREF="terminal_interface-curses-forms-field_types__ads.htm#173_14">Free_Arg</A>'<b>Access</b>);
257             <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#240_7">Res</A> /= <A HREF="terminal_interface-curses-aux__ads.htm#81_4">E_Ok</A> <b>then</b>
258                <A HREF="terminal_interface-curses-aux__ads.htm#97_14">Eti_Exception</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#240_7">Res</A>);
259             <b>end</b> <b>if</b>;
260          <b>end</b> <b>if</b>;
261          <A HREF="terminal_interface-curses-forms-field_types__ads.htm#144_4">M_Builtin_Router</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#241_7">T</A>;
262       <b>end</b> <b>if</b>;
263       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#144_4">M_Builtin_Router</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#135_4">Null_Field_Type</A>);
264       <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#144_4">M_Builtin_Router</A>;
265    <b>end</b> C_Builtin_Router;
266
267    <FONT COLOR=green><EM>--  -----------------------------------------------------------------------</EM></FONT>
268    <FONT COLOR=green><EM>--</EM></FONT>
269    <b>function</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#150_13">C_Choice_Router</A><FONT COLOR=red><A NAME="265_13"></A></FONT> <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#133_9">C_Field_Type</A>
270    <b>is</b>
271       <FONT COLOR=red><A NAME="267_7">Res</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#79_12">Eti_Error</A>;
272       <FONT COLOR=red><A NAME="268_7">T</A></FONT>   : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#133_9">C_Field_Type</A>;
273    <b>begin</b>
274       <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#145_4">M_Choice_Router</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#135_4">Null_Field_Type</A> <b>then</b>
275          <A HREF="terminal_interface-curses-forms-field_types__adb.htm#268_7">T</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#223_13">New_Fieldtype</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#178_13">Field_Check_Router</A>'<b>Access</b>,
276                              <A HREF="terminal_interface-curses-forms-field_types__ads.htm#186_13">Char_Check_Router</A>'<b>Access</b>);
277          <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#268_7">T</A> = <A HREF="terminal_interface-curses-forms-field_types__ads.htm#135_4">Null_Field_Type</A> <b>then</b>
278             <b>raise</b> <A HREF="terminal_interface-curses-forms__ads.htm#289_4">Form_Exception</A>;
279          <b>else</b>
280             <A HREF="terminal_interface-curses-forms-field_types__adb.htm#267_7">Res</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#228_13">Set_Fieldtype_Arg</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#268_7">T</A>,
281                                       <A HREF="terminal_interface-curses-forms-field_types__ads.htm#163_13">Make_Arg</A>'<b>Access</b>,
282                                       <A HREF="terminal_interface-curses-forms-field_types__ads.htm#168_13">Copy_Arg</A>'<b>Access</b>,
283                                       <A HREF="terminal_interface-curses-forms-field_types__ads.htm#173_14">Free_Arg</A>'<b>Access</b>);
284             <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#267_7">Res</A> /= <A HREF="terminal_interface-curses-aux__ads.htm#81_4">E_Ok</A> <b>then</b>
285                <A HREF="terminal_interface-curses-aux__ads.htm#97_14">Eti_Exception</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#267_7">Res</A>);
286             <b>end</b> <b>if</b>;
287
288             <A HREF="terminal_interface-curses-forms-field_types__adb.htm#267_7">Res</A> := <A HREF="terminal_interface-curses-forms-field_types__ads.htm#235_13">Set_Fieldtype_Choice</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#268_7">T</A>,
289                                          <A HREF="terminal_interface-curses-forms-field_types__ads.htm#194_13">Next_Router</A>'<b>Access</b>,
290                                          <A HREF="terminal_interface-curses-forms-field_types__ads.htm#202_13">Prev_Router</A>'<b>Access</b>);
291             <b>if</b> <A HREF="terminal_interface-curses-forms-field_types__adb.htm#267_7">Res</A> /= <A HREF="terminal_interface-curses-aux__ads.htm#81_4">E_Ok</A> <b>then</b>
292                <A HREF="terminal_interface-curses-aux__ads.htm#97_14">Eti_Exception</A> (<A HREF="terminal_interface-curses-forms-field_types__adb.htm#267_7">Res</A>);
293             <b>end</b> <b>if</b>;
294          <b>end</b> <b>if</b>;
295          <A HREF="terminal_interface-curses-forms-field_types__ads.htm#145_4">M_Choice_Router</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#268_7">T</A>;
296       <b>end</b> <b>if</b>;
297       <b>pragma</b> Assert (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#145_4">M_Choice_Router</A> /= <A HREF="terminal_interface-curses-forms-field_types__ads.htm#135_4">Null_Field_Type</A>);
298       <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#145_4">M_Choice_Router</A>;
299    <b>end</b> C_Choice_Router;
300
301 <b>end</b> Terminal_Interface.Curses.Forms.Field_Types;
302 </PRE></BODY></HTML>