Beispiel #1
0
void
setKeymap(char *p, int lineno, int verbose)
{
    unsigned char *map = NULL;
    char *s, *emsg;
    int c, f;

    s = getQWord(&p);
    c = getKey(s);
    if (c < 0) {		/* error */
	if (lineno > 0)
	    /* FIXME: gettextize? */
	    emsg = Sprintf("line %d: unknown key '%s'", lineno, s)->ptr;
	else
	    /* FIXME: gettextize? */
	    emsg = Sprintf("defkey: unknown key '%s'", s)->ptr;
	record_err_message(emsg);
	if (verbose)
	    disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE);
	return;
    }
    s = getWord(&p);
    f = getFuncList(s);
    if (f < 0) {
	if (lineno > 0)
	    /* FIXME: gettextize? */
	    emsg = Sprintf("line %d: invalid command '%s'", lineno, s)->ptr;
	else
	    /* FIXME: gettextize? */
	    emsg = Sprintf("defkey: invalid command '%s'", s)->ptr;
	record_err_message(emsg);
	if (verbose)
	    disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE);
	return;
    }
    if (c & K_MULTI) {
	unsigned char **mmap = NULL;
	int i, j, m = MULTI_KEY(c);

	if (m & K_ESCD)
	    map = EscDKeymap;
	else if (m & K_ESCB)
	    map = EscBKeymap;
	else if (m & K_ESC)
	    map = EscKeymap;
	else
	    map = GlobalKeymap;
	if (map[m & 0x7F] == FUNCNAME_multimap)
	    mmap = (unsigned char **)getKeyData(m);
	else
	    map[m & 0x7F] = FUNCNAME_multimap;
	if (!mmap) {
	    mmap = New_N(unsigned char *, 4);
	    for (i = 0; i < 4; i++) {
		mmap[i] = New_N(unsigned char, 128);
		for (j = 0; j < 128; j++)
		    mmap[i][j] = FUNCNAME_nulcmd;
	    }
	    mmap[0][ESC_CODE] = FUNCNAME_escmap;
	    mmap[1]['['] = FUNCNAME_escbmap;
	    mmap[1]['O'] = FUNCNAME_escbmap;
	}
Beispiel #2
0
int GetQWordH(const uint8_t **ppCur, uint32_t *pdwLeft, uint64_t *pqwValue)
{
	return getQWord(ppCur, pdwLeft, pqwValue, 0);
}