[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] [PATCH] relocate check_vitals_mapped() function to just abo
From: |
Mike Frysinger |
Subject: |
[Nano-devel] [PATCH] relocate check_vitals_mapped() function to just above where it actually gets used and declare it "static void" in the process |
Date: |
Wed, 19 Mar 2008 02:19:11 -0400 |
Signed-off-by: Mike Frysinger <address@hidden>
---
src/rcfile.c | 52 ++++++++++++++++++++++++++--------------------------
1 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/src/rcfile.c b/src/rcfile.c
index 253a321..fd730e4 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -690,6 +690,32 @@ void parse_colors(char *ptr, bool icase)
}
#endif /* ENABLE_COLOR */
+/* Check whether the user has unmapped every shortcut for a
+sequence we consider 'vital', like the exit function */
+static void check_vitals_mapped(void)
+{
+ subnfunc *f;
+ int v;
+#define VITALS 5
+ void *vitals[VITALS] = { do_exit, do_exit, (void *) cancel_msg, (void *)
cancel_msg, (void *) cancel_msg };
+ int inmenus[VITALS] = { MMAIN, MHELP, MWHEREIS, MREPLACE, MGOTOLINE };
+
+ for (v = 0; v < VITALS; v++) {
+ for (f = allfuncs; f != NULL; f = f->next) {
+ if (f->scfunc == vitals[v] && f->menus & inmenus[v]) {
+ const sc *s = first_sc_for(inmenus[v], f->scfunc);
+ if (!s) {
+ rcfile_error(N_("Fatal error: no keys mapped for function
\"%s\""),
+ f->desc);
+ fprintf(stderr, N_("Exiting. Please use nano with the -I
option if needed to adjust your nanorc settings\n"));
+ exit(1);
+ }
+ break;
+ }
+ }
+ }
+}
+
/* Parse the rcfile, once it has been opened successfully at rcstream,
* and close it afterwards. If syntax_only is TRUE, only allow the file
* to contain color syntax commands: syntax, color, and icolor. */
@@ -1022,30 +1048,4 @@ void do_rcfile(void)
#endif
}
-/* Check whether the user has unmapped every shortcut for a
-sequence we consider 'vital', like the exit function */
-int check_vitals_mapped(void)
-{
- subnfunc *f;
- int v;
-#define VITALS 5
- void *vitals[VITALS] = { do_exit, do_exit, (void *) cancel_msg, (void *)
cancel_msg, (void *) cancel_msg };
- int inmenus[VITALS] = { MMAIN, MHELP, MWHEREIS, MREPLACE, MGOTOLINE };
-
- for (v = 0; v < VITALS; v++) {
- for (f = allfuncs; f != NULL; f = f->next) {
- if (f->scfunc == vitals[v] && f->menus & inmenus[v]) {
- const sc *s = first_sc_for(inmenus[v], f->scfunc);
- if (!s) {
- rcfile_error(N_("Fatal error: no keys mapped for function
\"%s\""),
- f->desc);
- fprintf(stderr, N_("Exiting. Please use nano with the -I
option if needed to adjust your nanorc settings\n"));
- exit(1);
- }
- break;
- }
- }
- }
-}
-
#endif /* ENABLE_NANORC */
--
1.5.4.3