Moving first_sc_for() next to its sister function too.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5081 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
80750632d0
commit
dbb5e7cd8e
|
@ -2,6 +2,7 @@
|
||||||
* src/global.c (add_to_sclist): Remove the now unused and unneeded
|
* src/global.c (add_to_sclist): Remove the now unused and unneeded
|
||||||
addition ability from this builder function of the shortcut list.
|
addition ability from this builder function of the shortcut list.
|
||||||
* src/global.c (strtokeytype): Move this to a better place.
|
* src/global.c (strtokeytype): Move this to a better place.
|
||||||
|
* src/global.c (first_sc_for): Move this too to a better place.
|
||||||
|
|
||||||
2014-07-24 Jordi Mallach <jordi@gnu.org>
|
2014-07-24 Jordi Mallach <jordi@gnu.org>
|
||||||
* doc/texinfo/nano.texi, doc/man/nanorc.5: Typo fix.
|
* doc/texinfo/nano.texi, doc/man/nanorc.5: Typo fix.
|
||||||
|
|
34
src/global.c
34
src/global.c
|
@ -312,23 +312,6 @@ void add_to_funcs(void (*func)(void), int menus, const char *desc, const char *h
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the first shortcut in the list of shortcuts that
|
|
||||||
* matches the given func in the given menu. */
|
|
||||||
const sc *first_sc_for(int menu, void (*func)(void))
|
|
||||||
{
|
|
||||||
const sc *s;
|
|
||||||
|
|
||||||
for (s = sclist; s != NULL; s = s->next)
|
|
||||||
if ((s->menu & menu) && s->scfunc == func)
|
|
||||||
return s;
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
fprintf(stderr, "Whoops, returning null given func %ld in menu %x\n", (long)func, menu);
|
|
||||||
#endif
|
|
||||||
/* Otherwise... */
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add a key combo to the shortcut list. */
|
/* Add a key combo to the shortcut list. */
|
||||||
void add_to_sclist(int menu, const char *scstring, void (*func)(void), int toggle)
|
void add_to_sclist(int menu, const char *scstring, void (*func)(void), int toggle)
|
||||||
{
|
{
|
||||||
|
@ -366,6 +349,23 @@ void replace_scs_for(void (*oldfunc)(void), void (*newfunc)(void))
|
||||||
s->scfunc = newfunc;
|
s->scfunc = newfunc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return the first shortcut in the list of shortcuts that
|
||||||
|
* matches the given func in the given menu. */
|
||||||
|
const sc *first_sc_for(int menu, void (*func)(void))
|
||||||
|
{
|
||||||
|
const sc *s;
|
||||||
|
|
||||||
|
for (s = sclist; s != NULL; s = s->next)
|
||||||
|
if ((s->menu & menu) && s->scfunc == func)
|
||||||
|
return s;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
fprintf(stderr, "Whoops, returning null given func %ld in menu %x\n", (long)func, menu);
|
||||||
|
#endif
|
||||||
|
/* Otherwise... */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Return the given menu's first shortcut sequence, or the default value
|
/* Return the given menu's first shortcut sequence, or the default value
|
||||||
* (2nd arg). Assumes currmenu for the menu to check. */
|
* (2nd arg). Assumes currmenu for the menu to check. */
|
||||||
int sc_seq_or(void (*func)(void), int defaultval)
|
int sc_seq_or(void (*func)(void), int defaultval)
|
||||||
|
|
Loading…
Reference in New Issue