Mercurial > emacs
annotate oldXMenu/FindSel.c @ 73934:0a6f264ee5b6
(ada-prj-default-check-cmd): New variable, replacing deleted variable
`ada-check-switch'.
(ada-project-file-extension): Rename to `ada-prj-file-extension'.
(ada-xref-project-files): Improve doc string.
(ada-find-executable): New function.
(ada-initialize-runtime-library): Use `ada-find-executable'.
(ada-xref-set-default-prj-values): In compile commands, don't
need `ada-cd-command'; `compile' does that more portably.
Use ada-prj-default-check-cmd.
(ada-parse-prj-file): Don't set 'debug_post_cmd, 'debug_pre_cmd
properties if not specified in project file.
(ada-goto-declaration): Display useful message for new error
'error-file-not-found.
(ada-get-ada-file-name, ada-find-in-src-path): Signal new error
'error-file-not-found.
(ada-get-all-references): Match latest ali syntax.
Signal new error 'error-file-not-found.
(ada-find-in-ali): Match latest ali syntax.
(ada-make-filename-from-adaname): Handle different semantics
of gnatkr in GNAT 3.15p vs later.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Sun, 12 Nov 2006 17:06:31 +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 * | |
10 * XMenuFindSelection - Find the first selection in a pane who's | |
11 * label matches a particular string. | |
12 * | |
13 * Author: Tony Della Fera, DEC | |
14 * January 22, 1986 | |
15 * | |
16 */ | |
17 | |
18 #include "XMenuInt.h" | |
19 | |
20 int | |
21 XMenuFindSelection(menu, p_num, label) | |
22 register XMenu *menu; | |
23 int p_num; | |
24 register char *label; | |
25 { | |
26 register XMPane *p_ptr; | |
27 register XMSelect *s_ptr; | |
28 register int i = 0; | |
29 | |
30 /* | |
31 * Check for NULL pointers! | |
32 */ | |
33 if (label == NULL) { | |
34 _XMErrorCode = XME_ARG_BOUNDS; | |
35 return(XM_FAILURE); | |
36 } | |
37 | |
38 /* | |
39 * Find the right pane. | |
40 */ | |
41 p_ptr = _XMGetPanePtr(menu, p_num); | |
42 if (p_ptr == NULL) return(XM_FAILURE); | |
43 | |
44 /* | |
45 * Find the right selection. | |
46 */ | |
47 for ( | |
48 s_ptr = p_ptr->s_list->next; | |
49 s_ptr != p_ptr->s_list; | |
50 s_ptr = s_ptr->next | |
51 ){ | |
52 if (s_ptr->label_length == 0) { | |
53 if (*label == '\0') { | |
54 _XMErrorCode = XME_NO_ERROR; | |
55 return (i); | |
56 } | |
57 } | |
58 else { | |
59 if (strncmp (label, s_ptr->label, s_ptr->label_length) == 0) { | |
60 _XMErrorCode = XME_NO_ERROR; | |
61 return (i); | |
62 } | |
63 } | |
64 i++; | |
65 } | |
66 | |
67 /* | |
68 * If we get here then we have not found | |
69 * a match. | |
70 */ | |
71 _XMErrorCode = XME_S_NOT_FOUND; | |
72 return (XM_FAILURE); | |
73 } | |
52401 | 74 |
75 /* arch-tag: 564a4a95-9ab0-4580-b05f-6970c4b25dd4 | |
76 (do not change this comment) */ |