3 /* Copyright Massachusetts Institute of Technology 1985 */
4 /* Copyright (C) 2002, 2003, 2004, 2005,
5 2006 Free Software Foundation, Inc. */
8 * XMenu: MIT Project Athena, X Window system menu package
10 * XMenuFindSelection - Find the first selection in a pane who's
11 * label matches a particular string.
13 * Author: Tony Della Fera, DEC
21 XMenuFindSelection(menu
, p_num
, label
)
26 register XMPane
*p_ptr
;
27 register XMSelect
*s_ptr
;
31 * Check for NULL pointers!
34 _XMErrorCode
= XME_ARG_BOUNDS
;
39 * Find the right pane.
41 p_ptr
= _XMGetPanePtr(menu
, p_num
);
42 if (p_ptr
== NULL
) return(XM_FAILURE
);
45 * Find the right selection.
48 s_ptr
= p_ptr
->s_list
->next
;
49 s_ptr
!= p_ptr
->s_list
;
52 if (s_ptr
->label_length
== 0) {
54 _XMErrorCode
= XME_NO_ERROR
;
59 if (strncmp (label
, s_ptr
->label
, s_ptr
->label_length
) == 0) {
60 _XMErrorCode
= XME_NO_ERROR
;
68 * If we get here then we have not found
71 _XMErrorCode
= XME_S_NOT_FOUND
;
75 /* arch-tag: 564a4a95-9ab0-4580-b05f-6970c4b25dd4
76 (do not change this comment) */