view oldXMenu/FindSel.c @ 26844:9e9a0735c824

In this entry, just `Modified' means that codes for a composite character is deleted. (Qcomposition) (leading_code_composition) (charset_composition) (min_composite_char) (cmpchar_table) (cmpchar_table_size) (n_cmpchars): Deleted. (SPLIT_COMPOSITE_SEQ): Deleted. (SPLIT_MULTIBYTE_SEQ): Modified. (char_to_string): Renamed from non_ascii_char_to_string. Modified. (string_to_char): Renamed from string_to_non_ascii_char. (split_string): Renamed from split_non_ascii_string. (char_printable_p) (Fsplit_char) (Ffind_charset_region) (Ffind_charset_string) (char_valid_p) (char_bytes) (Fchar_width) (strwidth): Modified. (find_charset_in_str): Argument CMPCHARP deleted. Modified. (Fstring): Adjusted for the change of CHAR_STRING. Modified. (hash_string) (CMPCHAR_HASH_TABLE_SIZE) (cmpchar_hash_table) (CMPCHAR_HASH_SIZE) (CMPCHAR_HASH_USED) (CMPCHAR_HASH_CMPCHAR_ID) (str_cmpchar_id) (cmpchar_component) (Fcmpcharp) (Fcmpchar_component) (Fcmpchar_cmp_rule) (Fcmpchar_cmp_rule_p) (Fcmpchar_cmp_count): Deleted. (Fcompose_string): Implemented by Emacs Lisp in composite.el. (init_charset_once): Modified. (syms_of_charset): Modified.
author Kenichi Handa <handa@m17n.org>
date Wed, 15 Dec 1999 00:04:59 +0000
parents bbce331da1be
children 695cf19ef79e d7ddb3e565de
line wrap: on
line source

#include "copyright.h"

/* $Header: /u/src/emacs/19.0/oldXMenu/RCS/FindSel.c,v 1.1 1992/04/11 22:10:19 jimb Exp $ */
/* Copyright    Massachusetts Institute of Technology    1985	*/

/*
 * XMenu:	MIT Project Athena, X Window system menu package
 *
 *	XMenuFindSelection - Find the first selection in a pane who's
 *			     label matches a particular string.
 *
 *	Author:		Tony Della Fera, DEC
 *			January 22, 1986
 *
 */

#include "XMenuInt.h"

int
XMenuFindSelection(menu, p_num, label)
    register XMenu *menu;
    int p_num;
    register char *label;
{
    register XMPane *p_ptr;
    register XMSelect *s_ptr;
    register int i = 0;

    /*
     * Check for NULL pointers!
     */
    if (label == NULL) {
	_XMErrorCode = XME_ARG_BOUNDS;
	return(XM_FAILURE);
    }

    /*
     * Find the right pane.
     */
    p_ptr = _XMGetPanePtr(menu, p_num);
    if (p_ptr == NULL) return(XM_FAILURE);

    /*
     * Find the right selection.
     */
    for (
	s_ptr = p_ptr->s_list->next;
	s_ptr != p_ptr->s_list;
	s_ptr = s_ptr->next
    ){
	if (s_ptr->label_length == 0) {
	    if (*label == '\0') {
		_XMErrorCode = XME_NO_ERROR;
		return (i);
	    }
	}
	else {
	    if (strncmp (label, s_ptr->label, s_ptr->label_length) == 0) {
		_XMErrorCode = XME_NO_ERROR;
		return (i);
	    }
	}
	i++;
    }

    /*
     * If we get here then we have not found
     * a match.
     */
    _XMErrorCode = XME_S_NOT_FOUND;
    return (XM_FAILURE);
}