nanoget_repaint(), nanogetstr(), and statusq(). (DLR)
- Since the statusbar prompt code needs at least 4 columns in
order to work properly, make that the minimum number of
- columns nano requires to run, and remove assertions and code
- that make use of a smaller number. Changes to window_init(),
- nanoget_repaint(), titlebar(), statusbar(), and
- get_page_start(). (DLR)
+ columns that nano requires in order to run, and remove
+ assertions and code that make use of a smaller number of
+ columns. Changes to window_init(), nanoget_repaint(),
+ titlebar(), statusbar(), and get_page_start(). (DLR)
- Move get_page_start(), xplustabs(), actual_x(), strnlenpt(),
- and strlenpt() from winio.c to utils.c, as they're really
- utility functions. (DLR)
+ strlenpt(), check_linenumbers(), dump_buffer(), and
+ dump_buffer_reverse() from winio.c to utils.c, as they're
+ really utility functions. (DLR)
- Add missing stdio.h #include to winio.c. (DLR)
- Move functions specific to the statusbar prompt to their own
source file, adjust related variables accordingly, and rename
**bot, size_t *bot_x, bool *right_side_up);
#endif
size_t get_totsize(const filestruct *begin, const filestruct *end);
+#ifndef NDEBUG
+int check_linenumbers(const filestruct *fileptr);
+#endif
+#ifdef DEBUG
+void dump_filestruct(const filestruct *inptr);
+void dump_filestruct_reverse(void);
+#endif
/* Public functions in winio.c. */
#ifndef NANO_SMALL
void do_cursorpos(bool constant);
void do_cursorpos_void(void);
void do_replace_highlight(bool highlight, const char *word);
-#ifndef NDEBUG
-int check_linenumbers(const filestruct *fileptr);
-#endif
-#ifdef DEBUG
-void dump_filestruct(const filestruct *inptr);
-void dump_filestruct_reverse(void);
-#endif
#ifdef NANO_EXTRA
void do_credits(void);
#endif
return totsize;
}
+
+#ifndef NDEBUG
+/* Return what the current line number should be, starting at edittop
+ * and ending at fileptr. */
+int check_linenumbers(const filestruct *fileptr)
+{
+ int check_line = 0;
+ const filestruct *filetmp;
+
+ for (filetmp = openfile->edittop; filetmp != fileptr;
+ filetmp = filetmp->next)
+ check_line++;
+
+ return check_line;
+}
+#endif /* !NDEBUG */
+
+#ifdef DEBUG
+/* Dump the filestruct inptr to stderr. */
+void dump_filestruct(const filestruct *inptr)
+{
+ if (inptr == openfile->fileage)
+ fprintf(stderr, "Dumping file buffer to stderr...\n");
+ else if (inptr == cutbuffer)
+ fprintf(stderr, "Dumping cutbuffer to stderr...\n");
+ else
+ fprintf(stderr, "Dumping a buffer to stderr...\n");
+
+ while (inptr != NULL) {
+ fprintf(stderr, "(%ld) %s\n", (long)inptr->lineno, inptr->data);
+ inptr = inptr->next;
+ }
+}
+
+/* Dump the current buffer's filestruct to stderr in reverse. */
+void dump_filestruct_reverse(void)
+{
+ const filestruct *fileptr = openfile->filebot;
+
+ while (fileptr != NULL) {
+ fprintf(stderr, "(%ld) %s\n", (long)fileptr->lineno,
+ fileptr->data);
+ fileptr = fileptr->prev;
+ }
+}
+#endif /* DEBUG */
wattroff(edit, A_REVERSE);
}
-#ifndef NDEBUG
-/* Return what the current line number should be, starting at edittop
- * and ending at fileptr. */
-int check_linenumbers(const filestruct *fileptr)
-{
- int check_line = 0;
- const filestruct *filetmp;
-
- for (filetmp = openfile->edittop; filetmp != fileptr;
- filetmp = filetmp->next)
- check_line++;
-
- return check_line;
-}
-#endif /* !NDEBUG */
-
-#ifdef DEBUG
-/* Dump the filestruct inptr to stderr. */
-void dump_filestruct(const filestruct *inptr)
-{
- if (inptr == openfile->fileage)
- fprintf(stderr, "Dumping file buffer to stderr...\n");
- else if (inptr == cutbuffer)
- fprintf(stderr, "Dumping cutbuffer to stderr...\n");
- else
- fprintf(stderr, "Dumping a buffer to stderr...\n");
-
- while (inptr != NULL) {
- fprintf(stderr, "(%ld) %s\n", (long)inptr->lineno, inptr->data);
- inptr = inptr->next;
- }
-}
-
-/* Dump the current buffer's filestruct to stderr in reverse. */
-void dump_filestruct_reverse(void)
-{
- const filestruct *fileptr = openfile->filebot;
-
- while (fileptr != NULL) {
- fprintf(stderr, "(%ld) %s\n", (long)fileptr->lineno,
- fileptr->data);
- fileptr = fileptr->prev;
- }
-}
-#endif /* DEBUG */
-
#ifdef NANO_EXTRA
#define CREDIT_LEN 54
#define XLCREDIT_LEN 8