4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
22 /* Copyright (c) 1988 AT&T */
23 /* All Rights Reserved */
27 * Copyright (c) 1997, by Sun Microsystems, Inc.
28 * All rights reserved.
31 #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.4 */
35 #include <sys/types.h>
43 static REQUEST
parse(int);
45 #define COMMAND(x) (x.class)
46 #define CALL(x, f) (x.class ? (*x.class) (x.act, f) : E_SYSTEM_ERROR)
48 /* command array(carray) order is significant(see form.h REQ_*) */
49 static REQUEST carray
[MAX_FORM_COMMAND
- MIN_FORM_COMMAND
+ 1] =
51 _page_navigation
, _next_page
, /* REQ_NEXT_PAGE */
52 _page_navigation
, _prev_page
, /* REQ_PREV_PAGE */
53 _page_navigation
, _first_page
, /* REQ_FIRST_PAGE */
54 _page_navigation
, _last_page
, /* REQ_LAST_PAGE */
56 _field_navigation
, _next_field
, /* REQ_NEXT_FIELD */
57 _field_navigation
, _prev_field
, /* REQ_PREV_FIELD */
58 _field_navigation
, _first_field
, /* REQ_FIRST_FIELD */
59 _field_navigation
, _last_field
, /* REQ_LAST_FIELD */
60 _field_navigation
, _snext_field
, /* REQ_SNEXT_FIELD */
61 _field_navigation
, _sprev_field
, /* REQ_SPREV_FIELD */
62 _field_navigation
, _sfirst_field
, /* REQ_SFIRST_FIELD */
63 _field_navigation
, _slast_field
, /* REQ_SLAST_FIELD */
64 _field_navigation
, _left_field
, /* REQ_LEFT_FIELD */
65 _field_navigation
, _right_field
, /* REQ_RIGHT_FIELD */
66 _field_navigation
, _up_field
, /* REQ_UP_FIELD */
67 _field_navigation
, _down_field
, /* REQ_DOWN_FIELD */
69 _data_navigation
, _next_char
, /* REQ_NEXT_CHAR */
70 _data_navigation
, _prev_char
, /* REQ_PREV_CHAR */
71 _data_navigation
, _next_line
, /* REQ_NEXT_LINE */
72 _data_navigation
, _prev_line
, /* REQ_PREV_LINE */
73 _data_navigation
, _next_word
, /* REQ_NEXT_WORD */
74 _data_navigation
, _prev_word
, /* REQ_PREV_WORD */
75 _data_navigation
, _beg_field
, /* REQ_BEG_FIELD */
76 _data_navigation
, _end_field
, /* REQ_END_FIELD */
77 _data_navigation
, _beg_line
, /* REQ_BEG_LINE */
78 _data_navigation
, _end_line
, /* REQ_END_LINE */
79 _data_navigation
, _left_char
, /* REQ_LEFT_CHAR */
80 _data_navigation
, _right_char
, /* REQ_RIGHT_CHAR */
81 _data_navigation
, _up_char
, /* REQ_UP_CHAR */
82 _data_navigation
, _down_char
, /* REQ_DOWN_CHAR */
84 _misc_request
, _new_line
, /* REQ_NEW_LINE */
85 _data_manipulation
, _ins_char
, /* REQ_INS_CHAR */
86 _data_manipulation
, _ins_line
, /* REQ_INS_LINE */
87 _data_manipulation
, _del_char
, /* REQ_DEL_CHAR */
88 _misc_request
, _del_prev
, /* REQ_DEL_PREV */
89 _data_manipulation
, _del_line
, /* REQ_DEL_LINE */
90 _data_manipulation
, _del_word
, /* REQ_DEL_WORD */
91 _data_manipulation
, _clr_eol
, /* REQ_CLR_EOL */
92 _data_manipulation
, _clr_eof
, /* REQ_CLR_EOF */
93 _data_manipulation
, _clr_field
, /* REQ_CLR_FIELD */
95 _misc_request
, _ovl_mode
, /* REQ_OVL_MODE */
96 _misc_request
, _ins_mode
, /* REQ_INS_MODE */
98 _data_navigation
, _scr_fline
, /* REQ_SCR_FLINE */
99 _data_navigation
, _scr_bline
, /* REQ_SCR_BLINE */
100 _data_navigation
, _scr_fpage
, /* REQ_SCR_FPAGE */
101 _data_navigation
, _scr_bpage
, /* REQ_SCR_BPAGE */
102 _data_navigation
, _scr_fhpage
, /* REQ_SCR_FHPAGE */
103 _data_navigation
, _scr_bhpage
, /* REQ_SCR_BHPAGE */
105 _data_navigation
, _scr_fchar
, /* REQ_SCR_FCHAR */
106 _data_navigation
, _scr_bchar
, /* REQ_SCR_BCHAR */
107 _data_navigation
, _scr_hfline
, /* REQ_SCR_HFLINE */
108 _data_navigation
, _scr_hbline
, /* REQ_SCR_HBLINE */
109 _data_navigation
, _scr_hfhalf
, /* REQ_SCR_HFHALF */
110 _data_navigation
, _scr_hbhalf
, /* REQ_SCR_HBHALF */
112 _misc_request
, _validation
, /* REQ_VALIDATION */
113 _misc_request
, _next_choice
, /* REQ_NEXT_CHOICE */
114 _misc_request
, _prev_choice
, /* REQ_PREV_CHOICE */
117 static REQUEST FAIL
= { (PTF_int
) 0, (PTF_int
) 0 };
119 /* _page_navigation - service page navigation request */
121 _page_navigation(PTF_int act
, FORM
*f
)
137 /* _field_navigation - service inter-field navigation request */
139 _field_navigation(PTF_int act
, FORM
*f
)
153 /* _data_navigation - service intra-field navagation request */
155 _data_navigation(PTF_int act
, FORM
*f
)
160 /* _data_manipulation - service data modification request */
162 _data_manipulation(PTF_int act
, FORM
*f
)
164 int v
= E_REQUEST_DENIED
;
168 if ((v
= (*act
) (f
)) == E_OK
)
174 _misc_request(PTF_int act
, FORM
*f
)
180 form_driver(FORM
*f
, int c
)
186 if (Status(f
, DRIVER
))
190 else if (Status(f
, POSTED
)) {
196 if (isascii(c
) && isprint(c
) &&
198 v
= _data_entry(f
, c
);
200 v
= E_UNKNOWN_COMMAND
;
202 (void) _update_current(f
);
214 if (c
< MIN_FORM_COMMAND
|| c
> MAX_FORM_COMMAND
)
217 return (carray
[c
- MIN_FORM_COMMAND
]);