Mercurial > emacs
annotate oldXMenu/FindPane.c @ 72256:2eb34581dbad
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 03 Aug 2006 18:27:50 +0000 |
parents | e8a3fb527b77 |
children | ce127a46b1ca d04d8ccb3c41 c5406394f567 |
rev | line source |
---|---|
25858 | 1 #include "copyright.h" |
2 | |
3 /* Copyright Massachusetts Institute of Technology 1985 */ | |
68640
e8a3fb527b77
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
65000
diff
changeset
|
4 /* Copyright (C) 2002, 2003, 2004, 2005, |
e8a3fb527b77
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
65000
diff
changeset
|
5 2006 Free Software Foundation, Inc. */ |
25858 | 6 |
7 /* | |
8 * XMenu: MIT Project Athena, X Window system menu package | |
9 * | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
10 * XMenuFindPane - Find the first menu pane who's label matches a |
25858 | 11 * particular string. |
12 * | |
13 * Author: Tony Della Fera, DEC | |
14 * January 22, 1986 | |
15 * | |
16 */ | |
17 | |
18 #include "XMenuInt.h" | |
19 | |
20 int | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
21 XMenuFindPane(menu, label) |
25858 | 22 register XMenu *menu; |
23 register char *label; | |
24 { | |
25 register XMPane *p_ptr; | |
26 register int i = 0; | |
27 | |
28 /* | |
29 * Check for NULL pointers! | |
30 */ | |
31 if (label == NULL) { | |
32 _XMErrorCode = XME_ARG_BOUNDS; | |
33 return(XM_FAILURE); | |
34 } | |
35 | |
36 /* | |
37 * Find the pane who's label matches the given label. | |
38 */ | |
39 for ( | |
40 p_ptr = menu->p_list->next; | |
41 p_ptr != menu->p_list; | |
42 p_ptr = p_ptr->next | |
43 ){ | |
44 if (p_ptr->label_length == 0) { | |
45 if (*label == '\0') { | |
46 _XMErrorCode = XME_NO_ERROR; | |
47 return (i); | |
48 } | |
49 } | |
50 else { | |
51 if (strncmp (label, p_ptr->label, p_ptr->label_length) == 0) { | |
52 _XMErrorCode = XME_NO_ERROR; | |
53 return (i); | |
54 } | |
55 } | |
56 i++; | |
57 } | |
58 | |
59 /* | |
60 * If we get here then we have not found | |
61 * a match. | |
62 */ | |
63 _XMErrorCode = XME_P_NOT_FOUND; | |
64 return (XM_FAILURE); | |
65 } | |
52401 | 66 |
67 /* arch-tag: b6c94285-0d1d-4569-a071-b34b63c67a54 | |
68 (do not change this comment) */ |