Example #1
0
/*
**	funkey_keys(test_list, status, ch)
**
**	Test function keys
*/
static void
funkey_keys(
	       TestList * t,
	       int *state,
	       int *ch)
{
    char keybuf[256];

    if (keypad_xmit) {
	tc_putp(keypad_xmit);
    }
    keys_tested(1, 1, hex_out);	/* also clears screen */
    keybuf[0] = '\0';
    end_state = 0;
    if (scan_mode) {
	fkmax = scan_max;
    }
    tty_raw(0, char_mask);
    while (end_state != 'd') {
	read_key(keybuf, sizeof(keybuf));
	fresh_line();
	if (found_match(keybuf, hex_out, 0)) {
	    continue;
	}
	if (found_exit(keybuf, hex_out, 0)) {
	    break;
	}
    }
    if (keypad_local) {
	tc_putp(keypad_local);
    }
    keys_tested(0, 0, hex_out);
    ptext("Function key test ");
    generic_done_message(t, state, ch);
}
Example #2
0
	/*! @brief Search a string for the search string.
	 * @param[in] haystack string to search
	 * @param[in] haystack_len length of string to search
	 * @param[out] res pointer to first match
	 * @retval @c true if match was found
	 * @retval @c false if match was not found
	 */
	bool search(const char* haystack, size_t haystack_len, const char*& res) const {
		res = search(haystack, haystack_len);
		return found_match(haystack, haystack_len, res);
	}