annotate oldXMenu/FindSel.c @ 111439:8426207480fa

* src/xfns.c (set_machine_and_pid_properties): Let X set WM_CLIENT_MACHINE.
author Jan D <jan.h.d@swipnet.se>
date Sun, 07 Nov 2010 12:25:55 +0100
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) */