2
* Modifications Copyright 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2004, 2005
4
* Original X11 Port Copyright 1990 by Jeff Sparkes.
5
* Permission to use, copy, modify, and distribute this software and its
6
* documentation for any purpose and without fee is hereby granted,
7
* provided that the above copyright notice appear in all copies and that
8
* both that copyright notice and this permission notice appear in
9
* supporting documentation.
11
* Copyright 1989 by Georgia Tech Research Corporation, Atlanta, GA 30332.
12
* All Rights Reserved. GTRC hereby grants public use of this software.
13
* Derivative works based on this software must incorporate this copyright
16
* x3270, c3270, s3270 and tcl3270 are distributed in the hope that they will
17
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file LICENSE
2
* Copyright (c) 1993-2009, Paul Mattes.
3
* Copyright (c) 1990, Jeff Sparkes.
4
* Copyright (c) 1989, Georgia Tech Research Corporation (GTRC), Atlanta, GA
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions are met:
10
* * Redistributions of source code must retain the above copyright
11
* notice, this list of conditions and the following disclaimer.
12
* * Redistributions in binary form must reproduce the above copyright
13
* notice, this list of conditions and the following disclaimer in the
14
* documentation and/or other materials provided with the distribution.
15
* * Neither the names of Paul Mattes, Jeff Sparkes, GTRC nor the names of
16
* their contributors may be used to endorse or promote products derived
17
* from this software without specific prior written permission.
19
* THIS SOFTWARE IS PROVIDED BY PAUL MATTES, JEFF SPARKES AND GTRC "AS IS" AND
20
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
* ARE DISCLAIMED. IN NO EVENT SHALL PAUL MATTES, JEFF SPARKES OR GTRC BE
23
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
* POSSIBILITY OF SUCH DAMAGE.
137
Toggle_action(Widget w unused, XEvent *event, String *params,
151
Toggle_action(Widget w _is_unused, XEvent *event, String *params,
138
152
Cardinal *num_params)
142
157
action_debug(Toggle_action, event, params, num_params);
143
158
if (check_usage(Toggle_action, *num_params, 1, 2) < 0)
145
for (j = 0; j < N_TOGGLES; j++)
146
if (toggle_names[j].index >= 0 &&
147
!strcasecmp(params[0], toggle_names[j].name)) {
160
for (j = 0; toggle_names[j].name != NULL; j++) {
161
if (!strcasecmp(params[0], toggle_names[j].name)) {
162
ix = toggle_names[j].index;
150
if (j >= N_TOGGLES) {
166
if (toggle_names[j].name == NULL) {
151
167
popup_an_error("%s: Unknown toggle name '%s'",
152
168
action_name(Toggle_action), params[0]);
156
172
if (*num_params == 1) {
157
do_toggle_reason(j, TT_ACTION);
173
do_toggle_reason(ix, TT_ACTION);
158
174
} else if (!strcasecmp(params[1], "set")) {
160
do_toggle_reason(j, TT_ACTION);
176
do_toggle_reason(ix, TT_ACTION);
162
178
} else if (!strcasecmp(params[1], "clear")) {
164
do_toggle_reason(j, TT_ACTION);
180
do_toggle_reason(ix, TT_ACTION);
167
183
popup_an_error("%s: Unknown keyword '%s' (must be 'set' or "