version 1.53, 2012/05/25 04:56:58 |
version 1.54, 2014/03/20 07:47:29 |
|
|
ele--; |
ele--; |
if ((pfp = calloc(c - ele->k_base + 1, |
if ((pfp = calloc(c - ele->k_base + 1, |
sizeof(PF))) == NULL) { |
sizeof(PF))) == NULL) { |
|
dobeep(); |
ewprintf("Out of memory"); |
ewprintf("Out of memory"); |
return (FALSE); |
return (FALSE); |
} |
} |
|
|
} else if (n2 <= MAPELEDEF) { |
} else if (n2 <= MAPELEDEF) { |
if ((pfp = calloc(ele->k_num - c + 1, |
if ((pfp = calloc(ele->k_num - c + 1, |
sizeof(PF))) == NULL) { |
sizeof(PF))) == NULL) { |
|
dobeep(); |
ewprintf("Out of memory"); |
ewprintf("Out of memory"); |
return (FALSE); |
return (FALSE); |
} |
} |
|
|
curmap = newmap; |
curmap = newmap; |
} |
} |
if ((pfp = malloc(sizeof(PF))) == NULL) { |
if ((pfp = malloc(sizeof(PF))) == NULL) { |
|
dobeep(); |
ewprintf("Out of memory"); |
ewprintf("Out of memory"); |
return (FALSE); |
return (FALSE); |
} |
} |
|
|
else { |
else { |
if ((mp = malloc(sizeof(KEYMAP) + |
if ((mp = malloc(sizeof(KEYMAP) + |
(MAPINIT - 1) * sizeof(struct map_element))) == NULL) { |
(MAPINIT - 1) * sizeof(struct map_element))) == NULL) { |
|
dobeep(); |
ewprintf("Out of memory"); |
ewprintf("Out of memory"); |
ele->k_funcp[c - ele->k_base] = |
ele->k_funcp[c - ele->k_base] = |
curmap->map_default; |
curmap->map_default; |
|
|
if ((mp = malloc(sizeof(KEYMAP) + |
if ((mp = malloc(sizeof(KEYMAP) + |
(MAPINIT - 1) * |
(MAPINIT - 1) * |
sizeof(struct map_element))) == NULL) { |
sizeof(struct map_element))) == NULL) { |
|
dobeep(); |
ewprintf("Out of memory"); |
ewprintf("Out of memory"); |
ele->k_funcp[c - ele->k_base] = |
ele->k_funcp[c - ele->k_base] = |
curmap->map_default; |
curmap->map_default; |
|
|
} |
} |
if ((pfp = calloc(ele->k_num - c + !n2, |
if ((pfp = calloc(ele->k_num - c + !n2, |
sizeof(PF))) == NULL) { |
sizeof(PF))) == NULL) { |
|
dobeep(); |
ewprintf("Out of memory"); |
ewprintf("Out of memory"); |
return (FALSE); |
return (FALSE); |
} |
} |
|
|
if (pref_map == NULL) { |
if (pref_map == NULL) { |
if ((mp = malloc(sizeof(KEYMAP) + (MAPINIT - 1) |
if ((mp = malloc(sizeof(KEYMAP) + (MAPINIT - 1) |
* sizeof(struct map_element))) == NULL) { |
* sizeof(struct map_element))) == NULL) { |
|
dobeep(); |
ewprintf("Out of memory"); |
ewprintf("Out of memory"); |
ele->k_funcp[c - ele->k_base] = |
ele->k_funcp[c - ele->k_base] = |
curmap->map_default; |
curmap->map_default; |
|
|
int i; |
int i; |
|
|
if (curmap->map_max > SHRT_MAX - MAPGROW) { |
if (curmap->map_max > SHRT_MAX - MAPGROW) { |
|
dobeep(); |
ewprintf("keymap too large"); |
ewprintf("keymap too large"); |
return (NULL); |
return (NULL); |
} |
} |
if ((mp = malloc(sizeof(KEYMAP) + (curmap->map_max + (MAPGROW - 1)) * |
if ((mp = malloc(sizeof(KEYMAP) + (curmap->map_max + (MAPGROW - 1)) * |
sizeof(struct map_element))) == NULL) { |
sizeof(struct map_element))) == NULL) { |
|
dobeep(); |
ewprintf("Out of memory"); |
ewprintf("Out of memory"); |
return (NULL); |
return (NULL); |
} |
} |
|
|
* Keystrokes aren't collected. Not hard, but pretty useless. |
* Keystrokes aren't collected. Not hard, but pretty useless. |
* Would not work for function keys in any case. |
* Would not work for function keys in any case. |
*/ |
*/ |
|
dobeep(); |
ewprintf("Can't rebind key in macro"); |
ewprintf("Can't rebind key in macro"); |
return (FALSE); |
return (FALSE); |
} |
} |
|
|
return (FALSE); |
return (FALSE); |
if (((funct = name_function(bprompt)) == NULL) ? |
if (((funct = name_function(bprompt)) == NULL) ? |
(pref_map = name_map(bprompt)) == NULL : funct == NULL) { |
(pref_map = name_map(bprompt)) == NULL : funct == NULL) { |
|
dobeep(); |
ewprintf("[No match]"); |
ewprintf("[No match]"); |
return (FALSE); |
return (FALSE); |
} |
} |
|
|
funct = rescan; |
funct = rescan; |
else if (((funct = name_function(fname)) == NULL) ? |
else if (((funct = name_function(fname)) == NULL) ? |
(pref_map = name_map(fname)) == NULL : funct == NULL) { |
(pref_map = name_map(fname)) == NULL : funct == NULL) { |
|
dobeep(); |
ewprintf("[No match: %s]", fname); |
ewprintf("[No match: %s]", fname); |
return (FALSE); |
return (FALSE); |
} |
} |
|
|
return (FALSE); |
return (FALSE); |
(void)strlcat(buf, tmp, sizeof(buf)); |
(void)strlcat(buf, tmp, sizeof(buf)); |
if ((mp = name_map(tmp)) == NULL) { |
if ((mp = name_map(tmp)) == NULL) { |
|
dobeep(); |
ewprintf("Unknown map %s", tmp); |
ewprintf("Unknown map %s", tmp); |
return (FALSE); |
return (FALSE); |
} |
} |
|
|
} |
} |
return ((*funct)(f, n)); |
return ((*funct)(f, n)); |
} |
} |
|
dobeep(); |
ewprintf("[No match]"); |
ewprintf("[No match]"); |
return (FALSE); |
return (FALSE); |
} |
} |
|
|
excbuf[nbytes] = '\0'; |
excbuf[nbytes] = '\0'; |
if (excline(excbuf) != TRUE) { |
if (excline(excbuf) != TRUE) { |
s = FIOERR; |
s = FIOERR; |
|
dobeep(); |
ewprintf("Error loading file %s at line %d", fname, line); |
ewprintf("Error loading file %s at line %d", fname, line); |
break; |
break; |
} |
} |
|
|
lp = NULL; |
lp = NULL; |
|
|
if (macrodef || inmacro) { |
if (macrodef || inmacro) { |
|
dobeep(); |
ewprintf("Not now!"); |
ewprintf("Not now!"); |
return (FALSE); |
return (FALSE); |
} |
} |
|
|
n = (int)nl; |
n = (int)nl; |
} |
} |
if ((fp = name_function(funcp)) == NULL) { |
if ((fp = name_function(funcp)) == NULL) { |
|
dobeep(); |
ewprintf("Unknown function: %s", funcp); |
ewprintf("Unknown function: %s", funcp); |
return (FALSE); |
return (FALSE); |
} |
} |
|
|
case BINDNEXT: |
case BINDNEXT: |
lp->l_text[lp->l_used] = '\0'; |
lp->l_text[lp->l_used] = '\0'; |
if ((curmap = name_map(lp->l_text)) == NULL) { |
if ((curmap = name_map(lp->l_text)) == NULL) { |
|
dobeep(); |
ewprintf("No such mode: %s", lp->l_text); |
ewprintf("No such mode: %s", lp->l_text); |
status = FALSE; |
status = FALSE; |
free(lp); |
free(lp); |
|
|
#ifdef FKEYS |
#ifdef FKEYS |
switch (bind) { |
switch (bind) { |
default: |
default: |
|
dobeep(); |
ewprintf("Bad args to set key"); |
ewprintf("Bad args to set key"); |
status = FALSE; |
status = FALSE; |
break; |
break; |