tweaks: rename a cryptic type to something that makes a little sense
parent
32431cddf8
commit
acfee2538e
16
src/global.c
16
src/global.c
|
@ -196,11 +196,11 @@ int currmenu = MMOST;
|
||||||
/* The currently active menu, initialized to a dummy value. */
|
/* The currently active menu, initialized to a dummy value. */
|
||||||
sc *sclist = NULL;
|
sc *sclist = NULL;
|
||||||
/* The start of the shortcuts list. */
|
/* The start of the shortcuts list. */
|
||||||
subnfunc *allfuncs = NULL;
|
funcstruct *allfuncs = NULL;
|
||||||
/* The start of the functions list. */
|
/* The start of the functions list. */
|
||||||
subnfunc *tailfunc;
|
funcstruct *tailfunc;
|
||||||
/* The last function in the list. */
|
/* The last function in the list. */
|
||||||
subnfunc *exitfunc;
|
funcstruct *exitfunc;
|
||||||
/* A pointer to the special Exit/Close item. */
|
/* A pointer to the special Exit/Close item. */
|
||||||
|
|
||||||
linestruct *search_history = NULL;
|
linestruct *search_history = NULL;
|
||||||
|
@ -269,7 +269,7 @@ size_t light_to_col = 0;
|
||||||
/* Return the number of entries in the shortcut list for a given menu. */
|
/* Return the number of entries in the shortcut list for a given menu. */
|
||||||
size_t length_of_list(int menu)
|
size_t length_of_list(int menu)
|
||||||
{
|
{
|
||||||
subnfunc *f;
|
funcstruct *f;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
|
||||||
for (f = allfuncs; f != NULL; f = f->next)
|
for (f = allfuncs; f != NULL; f = f->next)
|
||||||
|
@ -359,7 +359,7 @@ void do_cancel(void)
|
||||||
void add_to_funcs(void (*func)(void), int menus, const char *desc, const char *help,
|
void add_to_funcs(void (*func)(void), int menus, const char *desc, const char *help,
|
||||||
bool blank_after, bool viewok)
|
bool blank_after, bool viewok)
|
||||||
{
|
{
|
||||||
subnfunc *f = nmalloc(sizeof(subnfunc));
|
funcstruct *f = nmalloc(sizeof(funcstruct));
|
||||||
|
|
||||||
if (allfuncs == NULL)
|
if (allfuncs == NULL)
|
||||||
allfuncs = f;
|
allfuncs = f;
|
||||||
|
@ -506,7 +506,7 @@ int keycode_from_string(const char *keystring)
|
||||||
void print_sclist(void)
|
void print_sclist(void)
|
||||||
{
|
{
|
||||||
sc *s;
|
sc *s;
|
||||||
const subnfunc *f;
|
const funcstruct *f;
|
||||||
|
|
||||||
for (s = sclist; s != NULL; s = s->next) {
|
for (s = sclist; s != NULL; s = s->next) {
|
||||||
f = sctofunc(s);
|
f = sctofunc(s);
|
||||||
|
@ -1390,9 +1390,9 @@ void shortcut_init(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const subnfunc *sctofunc(const sc *s)
|
const funcstruct *sctofunc(const sc *s)
|
||||||
{
|
{
|
||||||
subnfunc *f = allfuncs;
|
funcstruct *f = allfuncs;
|
||||||
|
|
||||||
while (f != NULL && f->func != s->func)
|
while (f != NULL && f->func != s->func)
|
||||||
f = f->next;
|
f = f->next;
|
||||||
|
|
|
@ -291,7 +291,7 @@ void help_init(void)
|
||||||
/* Untranslated help introduction. We break it up into three chunks
|
/* Untranslated help introduction. We break it up into three chunks
|
||||||
* in case the full string is too long for the compiler to handle. */
|
* in case the full string is too long for the compiler to handle. */
|
||||||
char *ptr;
|
char *ptr;
|
||||||
const subnfunc *f;
|
const funcstruct *f;
|
||||||
const sc *s;
|
const sc *s;
|
||||||
|
|
||||||
/* First, set up the initial help text for the current function. */
|
/* First, set up the initial help text for the current function. */
|
||||||
|
|
|
@ -1658,7 +1658,7 @@ bool wanted_to_move(void (*func)(void))
|
||||||
/* Return TRUE when the given shortcut is admissible in view mode. */
|
/* Return TRUE when the given shortcut is admissible in view mode. */
|
||||||
bool okay_for_view(const sc *shortcut)
|
bool okay_for_view(const sc *shortcut)
|
||||||
{
|
{
|
||||||
const subnfunc *func = sctofunc(shortcut);
|
const funcstruct *func = sctofunc(shortcut);
|
||||||
|
|
||||||
return (func == NULL || func->viewok);
|
return (func == NULL || func->viewok);
|
||||||
}
|
}
|
||||||
|
|
|
@ -452,7 +452,7 @@ typedef struct sc {
|
||||||
/* Next in the list. */
|
/* Next in the list. */
|
||||||
} sc;
|
} sc;
|
||||||
|
|
||||||
typedef struct subnfunc {
|
typedef struct funcstruct {
|
||||||
void (*func)(void);
|
void (*func)(void);
|
||||||
/* The actual function to call. */
|
/* The actual function to call. */
|
||||||
int menus;
|
int menus;
|
||||||
|
@ -470,9 +470,9 @@ typedef struct subnfunc {
|
||||||
/* Is this function allowed when in view mode? */
|
/* Is this function allowed when in view mode? */
|
||||||
long toggle;
|
long toggle;
|
||||||
/* If this is a toggle, which toggle to affect. */
|
/* If this is a toggle, which toggle to affect. */
|
||||||
struct subnfunc *next;
|
struct funcstruct *next;
|
||||||
/* Next item in the list. */
|
/* Next item in the list. */
|
||||||
} subnfunc;
|
} funcstruct;
|
||||||
|
|
||||||
#ifdef ENABLE_WORDCOMPLETION
|
#ifdef ENABLE_WORDCOMPLETION
|
||||||
typedef struct completion_word {
|
typedef struct completion_word {
|
||||||
|
|
|
@ -144,8 +144,8 @@ extern bool refresh_needed;
|
||||||
|
|
||||||
extern int currmenu;
|
extern int currmenu;
|
||||||
extern sc *sclist;
|
extern sc *sclist;
|
||||||
extern subnfunc *allfuncs;
|
extern funcstruct *allfuncs;
|
||||||
extern subnfunc *exitfunc;
|
extern funcstruct *exitfunc;
|
||||||
|
|
||||||
extern linestruct *search_history;
|
extern linestruct *search_history;
|
||||||
extern linestruct *replace_history;
|
extern linestruct *replace_history;
|
||||||
|
@ -322,7 +322,7 @@ int keycode_from_string(const char *keystring);
|
||||||
void assign_keyinfo(sc *s, const char *keystring, const int keycode);
|
void assign_keyinfo(sc *s, const char *keystring, const int keycode);
|
||||||
void print_sclist(void);
|
void print_sclist(void);
|
||||||
void shortcut_init(void);
|
void shortcut_init(void);
|
||||||
const subnfunc *sctofunc(const sc *s);
|
const funcstruct *sctofunc(const sc *s);
|
||||||
const char *flagtostr(int flag);
|
const char *flagtostr(int flag);
|
||||||
#ifdef ENABLE_NANORC
|
#ifdef ENABLE_NANORC
|
||||||
sc *strtosc(const char *input);
|
sc *strtosc(const char *input);
|
||||||
|
|
|
@ -349,7 +349,7 @@ void parse_binding(char *ptr, bool dobind)
|
||||||
char *keyptr = NULL, *keycopy = NULL, *funcptr = NULL, *menuptr = NULL;
|
char *keyptr = NULL, *keycopy = NULL, *funcptr = NULL, *menuptr = NULL;
|
||||||
sc *s, *newsc = NULL;
|
sc *s, *newsc = NULL;
|
||||||
int menu, mask = 0;
|
int menu, mask = 0;
|
||||||
subnfunc *f;
|
funcstruct *f;
|
||||||
|
|
||||||
if (*ptr == '\0') {
|
if (*ptr == '\0') {
|
||||||
rcfile_error(N_("Missing key name"));
|
rcfile_error(N_("Missing key name"));
|
||||||
|
@ -884,7 +884,7 @@ void pick_up_name(const char *kind, char *ptr, char **storage)
|
||||||
* function that we consider 'vital' (such as "Exit"). */
|
* function that we consider 'vital' (such as "Exit"). */
|
||||||
static void check_vitals_mapped(void)
|
static void check_vitals_mapped(void)
|
||||||
{
|
{
|
||||||
subnfunc *f;
|
funcstruct *f;
|
||||||
int v;
|
int v;
|
||||||
#define VITALS 3
|
#define VITALS 3
|
||||||
void (*vitals[VITALS])(void) = { do_exit, do_exit, do_cancel };
|
void (*vitals[VITALS])(void) = { do_exit, do_exit, do_cancel };
|
||||||
|
|
|
@ -1654,7 +1654,7 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
|
||||||
{
|
{
|
||||||
MEVENT mevent;
|
MEVENT mevent;
|
||||||
bool in_bottomwin;
|
bool in_bottomwin;
|
||||||
subnfunc *f;
|
funcstruct *f;
|
||||||
|
|
||||||
/* First, get the actual mouse event. */
|
/* First, get the actual mouse event. */
|
||||||
if (getmouse(&mevent) == ERR)
|
if (getmouse(&mevent) == ERR)
|
||||||
|
@ -2286,7 +2286,7 @@ void statusline(message_type importance, const char *msg, ...)
|
||||||
void bottombars(int menu)
|
void bottombars(int menu)
|
||||||
{
|
{
|
||||||
size_t number, itemwidth, i;
|
size_t number, itemwidth, i;
|
||||||
subnfunc *f;
|
funcstruct *f;
|
||||||
const sc *s;
|
const sc *s;
|
||||||
|
|
||||||
/* Set the global variable to the given menu. */
|
/* Set the global variable to the given menu. */
|
||||||
|
|
Loading…
Reference in New Issue