Mercurial > emacs
annotate oldXMenu/FindPane.c @ 90745:1b883722b73c
src/Makefile.in: Remove redundant HAVE_XFT clause
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-168
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 31 Jan 2007 00:26:59 +0000 |
parents | 95d0cdf160ea |
children | ec58e5c426ef |
rev | line source |
---|---|
25858 | 1 #include "copyright.h" |
2 | |
3 /* Copyright Massachusetts Institute of Technology 1985 */ | |
74548 | 4 /* Copyright (C) 2001, 2002, 2003, 2004, 2005, |
75348 | 5 2006, 2007 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) */ |