From c359301955823f2545635ba49d4c5c933a2bd847 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Tue, 1 Nov 2005 20:11:55 +0000 Subject: [PATCH] reorder functions git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3073 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- src/help.c | 46 +++++++++++++++++++++++----------------------- src/proto.h | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/help.c b/src/help.c index 556270f7..e799f0c3 100644 --- a/src/help.c +++ b/src/help.c @@ -356,29 +356,6 @@ void help_init(void) assert(strlen(help_text) <= allocsize + 1); } -/* Calculate the next line of help_text, starting at ptr. */ -size_t help_line_len(const char *ptr) -{ - int help_cols = (COLS > 24) ? COLS - 8 : 24; - - /* Try to break the line at (COLS - 8) columns if we have more than - * 24 columns, and at 24 columns otherwise. */ - size_t retval = break_line(ptr, help_cols, TRUE); - size_t retval_save = retval; - - /* Get the length of the entire line up to a null or a newline. */ - while (*(ptr + retval) != '\0' && *(ptr + retval) != '\n') - retval += move_mbright(ptr + retval, 0); - - /* If the entire line doesn't go more than 8 columns beyond where we - * tried to break it, we should display it as-is. Otherwise, we - * should display it only up to the break. */ - if (strnlenpt(ptr, retval) > help_cols + 8) - retval = retval_save; - - return retval; -} - /* Our dynamic, shortcut-list-compliant help function. */ void do_help(void) { @@ -514,4 +491,27 @@ void do_help(void) help_text = NULL; } +/* Calculate the next line of help_text, starting at ptr. */ +size_t help_line_len(const char *ptr) +{ + int help_cols = (COLS > 24) ? COLS - 8 : 24; + + /* Try to break the line at (COLS - 8) columns if we have more than + * 24 columns, and at 24 columns otherwise. */ + size_t retval = break_line(ptr, help_cols, TRUE); + size_t retval_save = retval; + + /* Get the length of the entire line up to a null or a newline. */ + while (*(ptr + retval) != '\0' && *(ptr + retval) != '\n') + retval += move_mbright(ptr + retval, 0); + + /* If the entire line doesn't go more than 8 columns beyond where we + * tried to break it, we should display it as-is. Otherwise, we + * should display it only up to the break. */ + if (strnlenpt(ptr, retval) > help_cols + 8) + retval = retval_save; + + return retval; +} + #endif /* !DISABLE_HELP */ diff --git a/src/proto.h b/src/proto.h index 6f6fbc48..a3247cee 100644 --- a/src/proto.h +++ b/src/proto.h @@ -313,8 +313,8 @@ void thanks_for_all_the_fish(void); /* Public functions in help.c. */ #ifndef DISABLE_HELP void help_init(void); -size_t help_line_len(const char *ptr); void do_help(void); +size_t help_line_len(const char *ptr); #endif /* Public functions in move.c. */ -- 2.39.5