annotate oldXMenu/FindSel.c @ 109770:30994c3466ad

Fix compilation of xmenu.c and unexcoff.c, clean up MSDOS source files. unexcoff.c: Remove the parts used when "emacs" is not defined. (report_error, report_error_1): Ditto. (write_segment): Remove "#if 0" unused code. (make_hdr): Remove code that was "#ifndef NO_REMAP" before NO_REMAP was removed (in revno 100928). (start_of_text): Remove unused function (was used only if NO_REMAP was NOT defined). msdos.c (IT_set_face): Fix format string to match argument types. (IT_write_glyphs, IT_note_mode_line_highlight) (IT_set_frame_parameters): Remove unused variables. (x_set_menu_bar_lines): Declare set_menu_bar_lines. (IT_set_terminal_modes): Disambiguate expression in if clause. (Fmsdos_remember_default_colors): Return Qnil. (IT_set_frame_parameters): Add parens to disambiguate boolean expression for logging the cursor type to termscript. (keyboard_layout_list, keypad_translate_map) (grey_key_translate_map): Add braces in inner initializers. (dos_rawgetc): Add parens in condition for mouse-3 button-press. (dos_rawgetc): Remove unused label. (XMenuActivate): Add braces to remove ambiguous `else'. (dos_ttraw): Always return a value. (spawnve): Declare. (run_msdos_command): Cast 3rd arg of spawnve to "char **". dosfns.h (x_set_title): Declare. w16select.c (Fw16_set_clipboard_data, Fw16_get_clipboard_data): Remove unused variables. dosfns.c (Fint86, Fdos_memget, Fdos_memput): Remove unused variables. (init_dosfns): Declare get_lim_data. (system_process_attributes): Declare Fget_internal_run_time. xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Fix argument list to be consistent with menu.h.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 13 Aug 2010 14:09:51 +0300
parents 5cc91198ffb2
children 417b1e4d63cd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
100952
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
1 /* Copyright Massachusetts Institute of Technology 1985 */
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
2
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
3 #include "copyright.h"
Dave Love <fx@gnu.org>
parents:
diff changeset
4
100952
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
5 /*
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
6 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 100952
diff changeset
7 2009, 2010 Free Software Foundation, Inc.
100952
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
8
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
9 This program is free software: you can redistribute it and/or modify
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
10 it under the terms of the GNU General Public License as published by
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
11 the Free Software Foundation, either version 3 of the License, or
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
12 (at your option) any later version.
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
13
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
14 This program is distributed in the hope that it will be useful,
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
17 GNU General Public License for more details.
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
18
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
19 You should have received a copy of the GNU General Public License
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
54f43e0fcdc6 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79743
diff changeset
21 */
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
22
Dave Love <fx@gnu.org>
parents:
diff changeset
23 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
24 * XMenu: MIT Project Athena, X Window system menu package
Dave Love <fx@gnu.org>
parents:
diff changeset
25 *
Dave Love <fx@gnu.org>
parents:
diff changeset
26 * XMenuFindSelection - Find the first selection in a pane who's
Dave Love <fx@gnu.org>
parents:
diff changeset
27 * label matches a particular string.
Dave Love <fx@gnu.org>
parents:
diff changeset
28 *
Dave Love <fx@gnu.org>
parents:
diff changeset
29 * Author: Tony Della Fera, DEC
Dave Love <fx@gnu.org>
parents:
diff changeset
30 * January 22, 1986
Dave Love <fx@gnu.org>
parents:
diff changeset
31 *
Dave Love <fx@gnu.org>
parents:
diff changeset
32 */
Dave Love <fx@gnu.org>
parents:
diff changeset
33
Dave Love <fx@gnu.org>
parents:
diff changeset
34 #include "XMenuInt.h"
Dave Love <fx@gnu.org>
parents:
diff changeset
35
Dave Love <fx@gnu.org>
parents:
diff changeset
36 int
109124
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
37 XMenuFindSelection(register XMenu *menu, int p_num, register char *label)
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
38 {
Dave Love <fx@gnu.org>
parents:
diff changeset
39 register XMPane *p_ptr;
Dave Love <fx@gnu.org>
parents:
diff changeset
40 register XMSelect *s_ptr;
Dave Love <fx@gnu.org>
parents:
diff changeset
41 register int i = 0;
Dave Love <fx@gnu.org>
parents:
diff changeset
42
Dave Love <fx@gnu.org>
parents:
diff changeset
43 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
44 * Check for NULL pointers!
Dave Love <fx@gnu.org>
parents:
diff changeset
45 */
Dave Love <fx@gnu.org>
parents:
diff changeset
46 if (label == NULL) {
Dave Love <fx@gnu.org>
parents:
diff changeset
47 _XMErrorCode = XME_ARG_BOUNDS;
Dave Love <fx@gnu.org>
parents:
diff changeset
48 return(XM_FAILURE);
Dave Love <fx@gnu.org>
parents:
diff changeset
49 }
Dave Love <fx@gnu.org>
parents:
diff changeset
50
Dave Love <fx@gnu.org>
parents:
diff changeset
51 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
52 * Find the right pane.
Dave Love <fx@gnu.org>
parents:
diff changeset
53 */
Dave Love <fx@gnu.org>
parents:
diff changeset
54 p_ptr = _XMGetPanePtr(menu, p_num);
Dave Love <fx@gnu.org>
parents:
diff changeset
55 if (p_ptr == NULL) return(XM_FAILURE);
Dave Love <fx@gnu.org>
parents:
diff changeset
56
Dave Love <fx@gnu.org>
parents:
diff changeset
57 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
58 * Find the right selection.
Dave Love <fx@gnu.org>
parents:
diff changeset
59 */
Dave Love <fx@gnu.org>
parents:
diff changeset
60 for (
Dave Love <fx@gnu.org>
parents:
diff changeset
61 s_ptr = p_ptr->s_list->next;
Dave Love <fx@gnu.org>
parents:
diff changeset
62 s_ptr != p_ptr->s_list;
Dave Love <fx@gnu.org>
parents:
diff changeset
63 s_ptr = s_ptr->next
Dave Love <fx@gnu.org>
parents:
diff changeset
64 ){
Dave Love <fx@gnu.org>
parents:
diff changeset
65 if (s_ptr->label_length == 0) {
Dave Love <fx@gnu.org>
parents:
diff changeset
66 if (*label == '\0') {
Dave Love <fx@gnu.org>
parents:
diff changeset
67 _XMErrorCode = XME_NO_ERROR;
Dave Love <fx@gnu.org>
parents:
diff changeset
68 return (i);
Dave Love <fx@gnu.org>
parents:
diff changeset
69 }
Dave Love <fx@gnu.org>
parents:
diff changeset
70 }
Dave Love <fx@gnu.org>
parents:
diff changeset
71 else {
Dave Love <fx@gnu.org>
parents:
diff changeset
72 if (strncmp (label, s_ptr->label, s_ptr->label_length) == 0) {
Dave Love <fx@gnu.org>
parents:
diff changeset
73 _XMErrorCode = XME_NO_ERROR;
Dave Love <fx@gnu.org>
parents:
diff changeset
74 return (i);
Dave Love <fx@gnu.org>
parents:
diff changeset
75 }
Dave Love <fx@gnu.org>
parents:
diff changeset
76 }
Dave Love <fx@gnu.org>
parents:
diff changeset
77 i++;
Dave Love <fx@gnu.org>
parents:
diff changeset
78 }
Dave Love <fx@gnu.org>
parents:
diff changeset
79
Dave Love <fx@gnu.org>
parents:
diff changeset
80 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
81 * If we get here then we have not found
Dave Love <fx@gnu.org>
parents:
diff changeset
82 * a match.
Dave Love <fx@gnu.org>
parents:
diff changeset
83 */
Dave Love <fx@gnu.org>
parents:
diff changeset
84 _XMErrorCode = XME_S_NOT_FOUND;
Dave Love <fx@gnu.org>
parents:
diff changeset
85 return (XM_FAILURE);
Dave Love <fx@gnu.org>
parents:
diff changeset
86 }
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 25858
diff changeset
87
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 25858
diff changeset
88 /* arch-tag: 564a4a95-9ab0-4580-b05f-6970c4b25dd4
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 25858
diff changeset
89 (do not change this comment) */