Commit 57d1755d authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: preen some comments, and reshuffle a few ifdefs

No related merge requests found
Showing with 18 additions and 20 deletions
+18 -20
/************************************************************************** /**************************************************************************
* global.c -- This file is part of GNU nano. * * global.c -- This file is part of GNU nano. *
* * * *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, *
* 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. * * 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. *
...@@ -89,13 +89,13 @@ int maxrows = 0; ...@@ -89,13 +89,13 @@ int maxrows = 0;
filestruct *cutbuffer = NULL; filestruct *cutbuffer = NULL;
/* The buffer where we store cut text. */ /* The buffer where we store cut text. */
filestruct *cutbottom = NULL; filestruct *cutbottom = NULL;
/* The last line in the cutbuffer. */
#ifndef DISABLE_JUSTIFY #ifndef DISABLE_JUSTIFY
filestruct *jusbuffer = NULL; filestruct *jusbuffer = NULL;
/* The buffer where we store unjustified text. */ /* The buffer where we store unjustified text. */
#endif #endif
partition *filepart = NULL; partition *filepart = NULL;
/* The partition where we store a portion of the current /* The "partition" where we store a portion of the current file. */
* file. */
openfilestruct *openfile = NULL; openfilestruct *openfile = NULL;
/* The list of all open file buffers. */ /* The list of all open file buffers. */
...@@ -128,7 +128,7 @@ char *quoteerr = NULL; ...@@ -128,7 +128,7 @@ char *quoteerr = NULL;
size_t quotelen; size_t quotelen;
/* The length of the quoting string in bytes. */ /* The length of the quoting string in bytes. */
#endif #endif
#endif #endif /* !DISABLE_JUSTIFY */
char *word_chars = NULL; char *word_chars = NULL;
/* Nonalphanumeric characters that also form words. */ /* Nonalphanumeric characters that also form words. */
...@@ -140,8 +140,7 @@ char *answer = NULL; ...@@ -140,8 +140,7 @@ char *answer = NULL;
/* The answer string used by the statusbar prompt. */ /* The answer string used by the statusbar prompt. */
ssize_t tabsize = -1; ssize_t tabsize = -1;
/* The width of a tab in spaces. The default value is set in /* The width of a tab in spaces. The default is set in main(). */
* main(). */
#ifndef NANO_TINY #ifndef NANO_TINY
char *backup_dir = NULL; char *backup_dir = NULL;
...@@ -179,15 +178,15 @@ bool refresh_needed = FALSE; ...@@ -179,15 +178,15 @@ bool refresh_needed = FALSE;
int currmenu = MMOST; int currmenu = MMOST;
/* The currently active menu, initialized to a dummy value. */ /* The currently active menu, initialized to a dummy value. */
sc *sclist = NULL; sc *sclist = NULL;
/* Pointer to the start of the shortcuts list. */ /* The start of the shortcuts list. */
subnfunc *allfuncs = NULL; subnfunc *allfuncs = NULL;
/* Pointer to the start of the functions list. */ /* The start of the functions list. */
subnfunc *tailfunc; subnfunc *tailfunc;
/* Pointer to the last function in the list. */ /* The last function in the list. */
subnfunc *exitfunc; subnfunc *exitfunc;
/* Pointer to the special Exit/Close item. */ /* A pointer to the special Exit/Close item. */
subnfunc *uncutfunc; subnfunc *uncutfunc;
/* Pointer to the special Uncut/Unjustify item. */ /* A pointer to the special Uncut/Unjustify item. */
#ifndef DISABLE_HISTORIES #ifndef DISABLE_HISTORIES
filestruct *search_history = NULL; filestruct *search_history = NULL;
...@@ -206,7 +205,6 @@ poshiststruct *position_history = NULL; ...@@ -206,7 +205,6 @@ poshiststruct *position_history = NULL;
/* The cursor position history list. */ /* The cursor position history list. */
#endif #endif
/* Regular expressions. */
#ifdef HAVE_REGEX_H #ifdef HAVE_REGEX_H
regex_t search_regexp; regex_t search_regexp;
/* The compiled regular expression to use in searches. */ /* The compiled regular expression to use in searches. */
...@@ -216,7 +214,7 @@ regmatch_t regmatches[10]; ...@@ -216,7 +214,7 @@ regmatch_t regmatches[10];
#endif #endif
int hilite_attribute = A_REVERSE; int hilite_attribute = A_REVERSE;
/* The curses attribute we use for reverse video. */ /* The curses attribute we use to highlight something. */
#ifndef DISABLE_COLOR #ifndef DISABLE_COLOR
char* specified_color_combo[] = {}; char* specified_color_combo[] = {};
/* The color combinations as specified in the rcfile. */ /* The color combinations as specified in the rcfile. */
...@@ -227,6 +225,7 @@ int interface_color_pair[] = {}; ...@@ -227,6 +225,7 @@ int interface_color_pair[] = {};
char *homedir = NULL; char *homedir = NULL;
/* The user's home directory, from $HOME or /etc/passwd. */ /* The user's home directory, from $HOME or /etc/passwd. */
/* Return the number of entries in the shortcut list for a given menu. */ /* Return the number of entries in the shortcut list for a given menu. */
size_t length_of_list(int menu) size_t length_of_list(int menu)
{ {
...@@ -1572,8 +1571,8 @@ sc *strtosc(const char *input) ...@@ -1572,8 +1571,8 @@ sc *strtosc(const char *input)
else if (!strcasecmp(input, "lastfile")) else if (!strcasecmp(input, "lastfile"))
s->scfunc = do_last_file; s->scfunc = do_last_file;
#endif #endif
#ifndef NANO_TINY
else { else {
#ifndef NANO_TINY
s->scfunc = do_toggle_void; s->scfunc = do_toggle_void;
if (!strcasecmp(input, "nohelp")) if (!strcasecmp(input, "nohelp"))
s->toggle = NO_HELP; s->toggle = NO_HELP;
...@@ -1617,14 +1616,13 @@ sc *strtosc(const char *input) ...@@ -1617,14 +1616,13 @@ sc *strtosc(const char *input)
s->toggle = NO_CONVERT; s->toggle = NO_CONVERT;
else if (!strcasecmp(input, "suspendenable")) else if (!strcasecmp(input, "suspendenable"))
s->toggle = SUSPEND; s->toggle = SUSPEND;
else
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
else { {
free(s); free(s);
return NULL; return NULL;
} }
#ifndef NANO_TINY
} }
#endif
return s; return s;
} }
......
...@@ -1178,9 +1178,9 @@ void stdin_pager(void) ...@@ -1178,9 +1178,9 @@ void stdin_pager(void)
tcsetattr(0, TCSANOW, &oldterm); tcsetattr(0, TCSANOW, &oldterm);
fprintf(stderr, _("Reading from stdin, ^C to abort\n")); fprintf(stderr, _("Reading from stdin, ^C to abort\n"));
#ifndef NANO_TINY
/* Enable interpretation of the special control keys so that /* Enable interpretation of the special control keys so that
* we get SIGINT when Ctrl-C is pressed. */ * we get SIGINT when Ctrl-C is pressed. */
#ifndef NANO_TINY
enable_signals(); enable_signals();
#endif #endif
...@@ -1300,7 +1300,7 @@ RETSIGTYPE do_continue(int signal) ...@@ -1300,7 +1300,7 @@ RETSIGTYPE do_continue(int signal)
/* Restore the terminal to its previous state. */ /* Restore the terminal to its previous state. */
terminal_init(); terminal_init();
/* Redraw the contents of the windows that need it. */ /* Wipe statusbar; redraw titlebar and edit window (and help lines). */
blank_statusbar(); blank_statusbar();
wnoutrefresh(bottomwin); wnoutrefresh(bottomwin);
total_refresh(); total_refresh();
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, * * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, *
* 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. * * 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. *
* Copyright (C) 2014, 2015, 2016 Benno Schulenberg * * Copyright (C) 2014, 2015, 2016 Benno Schulenberg *
* * *
* GNU nano is free software: you can redistribute it and/or modify * * GNU nano is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published * * it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, either version 3 of the License, * * by the Free Software Foundation, either version 3 of the License, *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment