commit acfee2538ebb12c9e42fba3815534fd38f493c42
parent 32431cddf84443d0245b8b8adc2de812bc05a2e2
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 3 Apr 2019 17:11:24 +0200
tweaks: rename a cryptic type to something that makes a little sense
Diffstat:
7 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -196,11 +196,11 @@ int currmenu = MMOST;
/* The currently active menu, initialized to a dummy value. */
sc *sclist = NULL;
/* The start of the shortcuts list. */
-subnfunc *allfuncs = NULL;
+funcstruct *allfuncs = NULL;
/* The start of the functions list. */
-subnfunc *tailfunc;
+funcstruct *tailfunc;
/* The last function in the list. */
-subnfunc *exitfunc;
+funcstruct *exitfunc;
/* A pointer to the special Exit/Close item. */
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. */
size_t length_of_list(int menu)
{
- subnfunc *f;
+ funcstruct *f;
size_t i = 0;
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,
bool blank_after, bool viewok)
{
- subnfunc *f = nmalloc(sizeof(subnfunc));
+ funcstruct *f = nmalloc(sizeof(funcstruct));
if (allfuncs == NULL)
allfuncs = f;
@@ -506,7 +506,7 @@ int keycode_from_string(const char *keystring)
void print_sclist(void)
{
sc *s;
- const subnfunc *f;
+ const funcstruct *f;
for (s = sclist; s != NULL; s = s->next) {
f = sctofunc(s);
@@ -1390,9 +1390,9 @@ void shortcut_init(void)
#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)
f = f->next;
diff --git a/src/help.c b/src/help.c
@@ -291,7 +291,7 @@ void help_init(void)
/* Untranslated help introduction. We break it up into three chunks
* in case the full string is too long for the compiler to handle. */
char *ptr;
- const subnfunc *f;
+ const funcstruct *f;
const sc *s;
/* First, set up the initial help text for the current function. */
diff --git a/src/nano.c b/src/nano.c
@@ -1658,7 +1658,7 @@ bool wanted_to_move(void (*func)(void))
/* Return TRUE when the given shortcut is admissible in view mode. */
bool okay_for_view(const sc *shortcut)
{
- const subnfunc *func = sctofunc(shortcut);
+ const funcstruct *func = sctofunc(shortcut);
return (func == NULL || func->viewok);
}
diff --git a/src/nano.h b/src/nano.h
@@ -452,7 +452,7 @@ typedef struct sc {
/* Next in the list. */
} sc;
-typedef struct subnfunc {
+typedef struct funcstruct {
void (*func)(void);
/* The actual function to call. */
int menus;
@@ -470,9 +470,9 @@ typedef struct subnfunc {
/* Is this function allowed when in view mode? */
long toggle;
/* If this is a toggle, which toggle to affect. */
- struct subnfunc *next;
+ struct funcstruct *next;
/* Next item in the list. */
-} subnfunc;
+} funcstruct;
#ifdef ENABLE_WORDCOMPLETION
typedef struct completion_word {
diff --git a/src/proto.h b/src/proto.h
@@ -144,8 +144,8 @@ extern bool refresh_needed;
extern int currmenu;
extern sc *sclist;
-extern subnfunc *allfuncs;
-extern subnfunc *exitfunc;
+extern funcstruct *allfuncs;
+extern funcstruct *exitfunc;
extern linestruct *search_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 print_sclist(void);
void shortcut_init(void);
-const subnfunc *sctofunc(const sc *s);
+const funcstruct *sctofunc(const sc *s);
const char *flagtostr(int flag);
#ifdef ENABLE_NANORC
sc *strtosc(const char *input);
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -349,7 +349,7 @@ void parse_binding(char *ptr, bool dobind)
char *keyptr = NULL, *keycopy = NULL, *funcptr = NULL, *menuptr = NULL;
sc *s, *newsc = NULL;
int menu, mask = 0;
- subnfunc *f;
+ funcstruct *f;
if (*ptr == '\0') {
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"). */
static void check_vitals_mapped(void)
{
- subnfunc *f;
+ funcstruct *f;
int v;
#define VITALS 3
void (*vitals[VITALS])(void) = { do_exit, do_exit, do_cancel };
diff --git a/src/winio.c b/src/winio.c
@@ -1654,7 +1654,7 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
{
MEVENT mevent;
bool in_bottomwin;
- subnfunc *f;
+ funcstruct *f;
/* First, get the actual mouse event. */
if (getmouse(&mevent) == ERR)
@@ -2286,7 +2286,7 @@ void statusline(message_type importance, const char *msg, ...)
void bottombars(int menu)
{
size_t number, itemwidth, i;
- subnfunc *f;
+ funcstruct *f;
const sc *s;
/* Set the global variable to the given menu. */