move do_verbatim_input() from nano.c to text.c, since it's an advanced

text-based operation


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3096 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-11-07 06:06:05 +00:00
parent 64844b6959
commit 37ddfa9dbd
4 changed files with 34 additions and 30 deletions

View File

@ -64,6 +64,10 @@ CVS code -
read_file() read_file()
- Remove apparently unneeded logic to handle a case where - Remove apparently unneeded logic to handle a case where
current is NULL, since it shouldn't be NULL there. (DLR) current is NULL, since it shouldn't be NULL there. (DLR)
- nano.c:
do_verbatim_input()
- Move to text.c, since it's an advanced text-based operation.
(DLR)
- nano.h: - nano.h:
- Readd MIN_EDITOR_COLS #define. (DLR) - Readd MIN_EDITOR_COLS #define. (DLR)
- rcfile.c: - rcfile.c:

View File

@ -900,35 +900,6 @@ void nano_disabled_msg(void)
statusbar(_("Sorry, support for this function has been disabled")); statusbar(_("Sorry, support for this function has been disabled"));
} }
void do_verbatim_input(void)
{
int *kbinput;
size_t kbinput_len, i;
char *output;
statusbar(_("Verbatim Input"));
/* If constant cursor position display is on, make sure the current
* cursor position will be properly displayed on the statusbar. */
if (ISSET(CONST_UPDATE))
do_cursorpos(TRUE);
/* Read in all the verbatim characters. */
kbinput = get_verbatim_kbinput(edit, &kbinput_len);
/* Display all the verbatim characters at once, not filtering out
* control characters. */
output = charalloc(kbinput_len + 1);
for (i = 0; i < kbinput_len; i++)
output[i] = (char)kbinput[i];
output[i] = '\0';
do_output(output, kbinput_len, TRUE);
free(output);
}
void do_exit(void) void do_exit(void)
{ {
int i; int i;

View File

@ -391,7 +391,6 @@ void version(void);
int no_more_space(void); int no_more_space(void);
int no_help(void); int no_help(void);
void nano_disabled_msg(void); void nano_disabled_msg(void);
void do_verbatim_input(void);
void do_exit(void); void do_exit(void);
void signal_init(void); void signal_init(void);
void handle_hupterm(int signal); void handle_hupterm(int signal);
@ -574,6 +573,7 @@ void do_spell(void);
#ifndef NANO_SMALL #ifndef NANO_SMALL
void do_wordlinechar_count(void); void do_wordlinechar_count(void);
#endif #endif
void do_verbatim_input(void);
/* Public functions in utils.c. */ /* Public functions in utils.c. */
int digits(size_t n); int digits(size_t n);

View File

@ -2132,3 +2132,32 @@ void do_wordlinechar_count(void)
(unsigned long)chars); (unsigned long)chars);
} }
#endif /* !NANO_SMALL */ #endif /* !NANO_SMALL */
void do_verbatim_input(void)
{
int *kbinput;
size_t kbinput_len, i;
char *output;
statusbar(_("Verbatim Input"));
/* If constant cursor position display is on, make sure the current
* cursor position will be properly displayed on the statusbar. */
if (ISSET(CONST_UPDATE))
do_cursorpos(TRUE);
/* Read in all the verbatim characters. */
kbinput = get_verbatim_kbinput(edit, &kbinput_len);
/* Display all the verbatim characters at once, not filtering out
* control characters. */
output = charalloc(kbinput_len + 1);
for (i = 0; i < kbinput_len; i++)
output[i] = (char)kbinput[i];
output[i] = '\0';
do_output(output, kbinput_len, TRUE);
free(output);
}