- Don't install the localized versions of the manpages if
nano is built with --disable-nls. Changes to Makefile.am and
doc/man/Makefile.am. (Mike Frysinger)
+ - Rename the NANO_SMALL #define to NANO_TINY. (DLR)
- chars.c:
mbwidth()
- If wcwidth() returns -1 for the character passed in, treat the
AC_ARG_ENABLE(tiny,
[ --enable-tiny Disable features for the sake of size],
[if test x$enableval = xyes; then
- AC_DEFINE(NANO_SMALL, 1, [Define this to make the nano executable as small as possible.]) tiny_support=yes
+ AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.]) tiny_support=yes
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help menu.])
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routine.])
curs_set(1);
j = do_prompt(FALSE, gotodir_list, "",
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
NULL,
#endif
_("Go To Directory"));
return strcasestr(haystack, needle);
}
-#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
+#if !defined(NANO_TINY) || !defined(DISABLE_TABCOMP)
/* This function is equivalent to strstr(), except in that it scans the
* string in reverse, starting at rev_start. */
const char *revstrstr(const char *haystack, const char *needle, const
return NULL;
}
-#endif /* !NANO_SMALL || !DISABLE_TABCOMP */
+#endif /* !NANO_TINY || !DISABLE_TABCOMP */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* This function is equivalent to strcasestr(), except in that it scans
* the string in reverse, starting at rev_start. */
const char *revstrcasestr(const char *haystack, const char *needle,
#endif
return revstrcasestr(haystack, needle, rev_start);
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
/* This function is equivalent to strlen() for multibyte strings. */
size_t mbstrlen(const char *s)
openfile->placewewant = 0;
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Move all currently marked text to the cutbuffer, and set the current
* place we want to where the text used to start. */
void cut_marked(void)
openfile->placewewant = xplustabs();
}
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
/* Move text from the current filestruct into the cutbuffer. */
void do_cut_text(void)
* cutbuffer instead of replacing it. */
keep_cutbuffer = TRUE;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (openfile->mark_set) {
/* If the mark is on, move the marked text to the cutbuffer and
* turn the mark off. */
#endif
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Cut from the current cursor position to the end of the file. */
void do_cut_till_end(void)
{
dump_filestruct(cutbuffer);
#endif
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
/* Copy text from the cutbuffer into the current filestruct. */
void do_uncut_text(void)
openfile->current_y = 0;
openfile->modified = FALSE;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
openfile->mark_set = FALSE;
openfile->mark_begin = NULL;
* no stat, update the stat, if applicable. */
if (rc == 0) {
read_file(f, filename);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (openfile->current_stat == NULL) {
openfile->current_stat =
(struct stat *)nmalloc(sizeof(struct stat));
fileptr->data = mallocstrcpy(NULL, buf);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If it's a DOS file ("\r\n"), and file conversion isn't disabled,
* strip the '\r' part from fileptr->data. */
if (!ISSET(NO_CONVERT) && buf_len > 0 && buf[buf_len - 1] == '\r')
int input_int;
/* The current value we read from the file, whether an input
* character or EOF. */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
int format = 0;
/* 0 = *nix, 1 = DOS, 2 = Mac, 3 = both DOS and Mac. */
#endif
/* If it's a *nix file ("\n") or a DOS file ("\r\n"), and file
* conversion isn't disabled, handle it! */
if (input == '\n') {
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If there's a '\r' before the '\n', set format to DOS if
* we currently think this is a *nix file, or to both if we
* currently think it's a Mac file. */
num_lines++;
buf[0] = '\0';
i = 0;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If it's a Mac file ('\r' without '\n'), and file conversion
* isn't disabled, handle it! */
} else if (!ISSET(NO_CONVERT) && i > 0 && buf[i - 1] == '\r') {
nperror(filename);
fclose(f);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If file conversion isn't disabled and the last character in this
* file is '\r', read it in properly as a Mac format line. */
if (len == 0 && !ISSET(NO_CONVERT) && input == '\r') {
/* Did we not get a newline and still have stuff to do? */
if (len > 0) {
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If file conversion isn't disabled and the last character in
* this file is '\r', set format to Mac if we currently think
* the file is a *nix file, or to both DOS and Mac if we
* file we inserted. */
openfile->placewewant = xplustabs();
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (format == 3)
statusbar(
P_("Read %lu line (Converted from DOS and Mac format)",
}
void do_insertfile(
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
bool execute
#else
void
#endif
while (TRUE) {
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (execute) {
msg =
#ifdef ENABLE_MULTIBUFFER
N_("File to insert into new buffer [from %s] ") :
#endif
N_("File to insert [from %s] ");
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
}
#endif
i = do_prompt(TRUE,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
execute ? extcmd_list :
#endif
insertfile_list, ans,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
NULL,
#endif
_(msg),
ans = mallocstrcpy(ans, answer);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
#ifdef ENABLE_MULTIBUFFER
if (i == TOGGLE_MULTIBUFFER_KEY) {
/* Don't allow toggling if we're in view mode. */
#ifndef DISABLE_BROWSER
else
#endif
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
#ifndef DISABLE_BROWSER
if (i == NANO_TOFILES_KEY) {
}
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (execute) {
#ifdef ENABLE_MULTIBUFFER
if (ISSET(MULTIBUFFER))
/* Save the file specified in answer in the current
* buffer. */
open_buffer(answer);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
}
#endif
else
#endif
do_insertfile(
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
FALSE
#endif
);
}
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void init_backup_dir(void)
{
char *full_backup_dir;
* one). */
realexists = (stat(realname, &st) != -1);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* We backup only if the backup toggle is set, the file isn't
* temporary, and the file already exists. Furthermore, if we
* aren't appending, prepending, or writing a selection, we backup
free(backupname);
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
/* If NOFOLLOW_SYMLINKS is set and the file is a link, we aren't
* doing prepend or append. So we delete the link first, and just
if (fileptr->data[0] == '\0')
lineswritten--;
} else {
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (openfile->fmt == DOS_FILE || openfile->fmt ==
MAC_FILE) {
if (putc('\r', f) == EOF) {
fclose(f);
goto cleanup_and_exit;
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
}
#endif
}
#endif
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Update current_stat to reference the file as it is now. */
if (openfile->current_stat == NULL)
openfile->current_stat =
return retval;
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Write a marked selection from a file out. */
int write_marked_file(const char *name, FILE *f_open, bool tmp,
append_type append)
return retval;
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
int do_writeout(bool exiting)
{
}
ans = mallocstrcpy(NULL,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
(openfile->mark_set && !exiting) ? "" :
#endif
openfile->filename);
while (TRUE) {
const char *msg;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *formatstr, *backupstr;
formatstr = (openfile->fmt == DOS_FILE) ?
N_("Append Selection to File") :
N_("Write Selection to File");
else
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
msg = (append == PREPEND) ? N_("File Name to Prepend to") :
(append == APPEND) ? N_("File Name to Append to") :
N_("File Name to Write");
* completion. */
i = do_prompt(!ISSET(RESTRICTED) ||
openfile->filename[0] == '\0', writefile_list, ans,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
NULL, "%s%s%s", _(msg), formatstr, backupstr
#else
"%s", _(msg)
do_prompt_abort();
} else
#endif /* !DISABLE_BROWSER */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (i == TOGGLE_DOS_KEY) {
openfile->fmt = (openfile->fmt == DOS_FILE) ? NIX_FILE :
DOS_FILE;
TOGGLE(BACKUP_FILE);
continue;
} else
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
if (i == NANO_PREPEND_KEY) {
append = (append == PREPEND) ? OVERWRITE : PREPEND;
continue;
* bother showing the "Different Name" prompt. */
} else if (!ISSET(RESTRICTED) &&
openfile->filename[0] != '\0'
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
&& (exiting || !openfile->mark_set)
#endif
) {
}
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Here's where we allow the selected text to be written to
* a separate file. If we're using restricted mode, this is
* disabled since it allows reading from or writing to files
if (!ISSET(RESTRICTED) && !exiting && openfile->mark_set)
retval = write_marked_file(answer, NULL, FALSE, append);
else
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
retval = write_file(answer, NULL, FALSE, append, FALSE);
break;
return tmp;
}
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
/* Return $HOME/.nano_history, or NULL if we can't find the homedir.
* The string is dynamically allocated, and should be freed. */
char *histfilename(void)
free(nanohist);
}
}
-#endif /* !NANO_SMALL && ENABLE_NANORC */
+#endif /* !NANO_TINY && ENABLE_NANORC */
openfilestruct *openfile = NULL;
/* The list of open file buffers */
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
char *whitespace = NULL; /* Characters used when displaying
the first characters of tabs and
spaces. */
#endif
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
char *backup_dir = NULL; /* Backup directory. */
#endif
#ifndef DISABLE_SPELLER
shortcut *spell_list = NULL;
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
shortcut *extcmd_list = NULL;
#endif
#ifndef DISABLE_BROWSER
const shortcut *currshortcut; /* Current shortcut list we're using */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
toggle *toggles = NULL;
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
filestruct *search_history = NULL;
filestruct *searchage = NULL;
filestruct *searchbot = NULL;
const char *first_line_msg = N_("First Line");
const char *last_line_msg = N_("Last Line");
const char *refresh_msg = N_("Refresh");
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *cut_till_end_msg = N_("CutTillEnd");
#endif
#ifndef DISABLE_JUSTIFY
const char *end_of_par_msg = N_("End of Par");
const char *fulljstify_msg = N_("FullJstify");
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *case_sens_msg = N_("Case Sens");
const char *backwards_msg = N_("Backwards");
#endif
#ifdef HAVE_REGEX_H
const char *regexp_msg = N_("Regexp");
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *history_msg = N_("History");
#ifdef ENABLE_MULTIBUFFER
const char *new_buffer_msg = N_("New Buffer");
N_("Invoke the spell checker, if available");
const char *nano_gotoline_msg = N_("Go to line and column number");
const char *nano_replace_msg = N_("Replace text within the editor");
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *nano_mark_msg = N_("Mark text at the cursor position");
const char *nano_whereis_next_msg = N_("Repeat last search");
#endif
N_("Insert a tab character at the cursor position");
const char *nano_enter_msg =
N_("Insert a carriage return at the cursor position");
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *nano_nextword_msg = N_("Move forward one word");
const char *nano_prevword_msg = N_("Move backward one word");
const char *nano_wordcount_msg =
N_("Switch to the next file buffer");
#endif
const char *nano_verbatim_msg = N_("Insert character(s) verbatim");
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *nano_cut_till_end_msg =
N_("Cut from the cursor position to the end of the file");
#endif
#ifndef DISABLE_JUSTIFY
const char *nano_fulljustify_msg = N_("Justify the entire file");
#endif
-#if !defined(NANO_SMALL) && defined(HAVE_REGEX_H)
+#if !defined(NANO_TINY) && defined(HAVE_REGEX_H)
const char *nano_bracket_msg = N_("Find other bracket");
#endif
const char *nano_cancel_msg = N_("Cancel the current function");
N_("Go to the first line of the file");
const char *nano_lastline_msg =
N_("Go to the last line of the file");
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *nano_case_msg =
N_("Make the current search/replace case (in)sensitive");
const char *nano_reverse_msg =
#ifdef HAVE_REGEX_H
const char *nano_regexp_msg = N_("Use regular expressions");
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *nano_history_msg =
N_("Edit the previous search/replace strings");
#endif
#ifndef DISABLE_BROWSER
const char *nano_tofiles_msg = N_("Go to file browser");
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *nano_dos_msg = N_("Write file out in DOS format");
const char *nano_mac_msg = N_("Write file out in Mac format");
#endif
const char *nano_append_msg = N_("Append to the current file");
const char *nano_prepend_msg = N_("Prepend to the current file");
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *nano_backup_msg =
N_("Back up original file when saving");
const char *nano_execute_msg = N_("Execute external command");
#endif
-#if !defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER)
+#if !defined(NANO_TINY) && defined(ENABLE_MULTIBUFFER)
const char *nano_multibuffer_msg = N_("Insert into new buffer");
#endif
#ifndef DISABLE_BROWSER
IFHELP(nano_replace_msg, NANO_ALT_REPLACE_KEY),
NANO_REPLACE_FKEY, NANO_NO_KEY, NOVIEW, do_replace);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
sc_init_one(&main_list, NANO_MARK_KEY, N_("Mark Text"),
IFHELP(nano_mark_msg, NANO_MARK_ALTKEY), NANO_MARK_FKEY,
NANO_NO_KEY, VIEW, do_mark);
IFHELP(nano_enter_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, do_enter);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
sc_init_one(&main_list, NANO_NEXTWORD_KEY, N_("Next Word"),
IFHELP(nano_nextword_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_next_word_void);
IFHELP(nano_verbatim_msg, NANO_VERBATIM_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, do_verbatim_input);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_NO_KEY, cut_till_end_msg,
IFHELP(nano_cut_till_end_msg, NANO_CUTTILLEND_ALTKEY),
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify);
#endif
-#if !defined(NANO_SMALL) && defined(HAVE_REGEX_H)
+#if !defined(NANO_TINY) && defined(HAVE_REGEX_H)
sc_init_one(&main_list, NANO_NO_KEY, N_("Find Other Bracket"),
IFHELP(nano_bracket_msg, NANO_BRACKET_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_find_bracket);
NANO_PARAEND_ALTKEY2, VIEW, do_para_end_void);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_NO_KEY, case_sens_msg,
IFHELP(nano_case_msg, TOGGLE_CASE_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_PREVLINE_KEY, history_msg,
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY,
IFHELP(nano_gotoline_msg, NANO_NO_KEY), NANO_GOTOLINE_FKEY,
NANO_NO_KEY, VIEW, NULL);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
sc_init_one(&replace_list, NANO_NO_KEY, case_sens_msg,
IFHELP(nano_case_msg, TOGGLE_CASE_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
NANO_NO_KEY, VIEW, NULL);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
sc_init_one(&replace_list, NANO_PREVLINE_KEY, history_msg,
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_last_line);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
sc_init_one(&replace_list_2, NANO_PREVLINE_KEY, history_msg,
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
NANO_NO_KEY, NOVIEW, NULL);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If we're using restricted mode, the DOS format, Mac format,
* append, prepend, and backup toggles are disabled. The first and
* second are useless since inserting files is disabled, the third
IFHELP(nano_prepend_msg, NANO_PREPEND_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, NULL);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Translators: try to keep this string under 16 characters long */
if (!ISSET(RESTRICTED))
sc_init_one(&writefile_list, NANO_NO_KEY, N_("Backup File"),
NANO_NO_KEY, NOVIEW, NULL);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If we're using restricted mode, command execution is disabled.
* It's useless since inserting files is disabled. */
/* Translators: try to keep this string under 22 characters long */
NANO_NO_KEY, VIEW, NULL);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
free_shortcutage(&extcmd_list);
sc_init_one(&extcmd_list, NANO_HELP_KEY, get_help_msg,
currshortcut = main_list;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
toggle_init();
#endif
}
}
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Create a new toggle structure, at the end of the toggles linked
* list. */
void toggle_init_one(int val, const char *desc, long flag)
WHITESPACE_DISPLAY);
#endif
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
/* This function is called just before calling exit(). Practically, the
* only effect is to cause a segmentation fault if the various data
free(quoteerr);
#endif
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (backup_dir != NULL)
free(backup_dir);
#endif
#ifndef DISABLE_SPELLER
free_shortcutage(&spell_list);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
free_shortcutage(&extcmd_list);
#endif
#ifndef DISABLE_BROWSER
free_shortcutage(&browser_list);
free_shortcutage(&gotodir_list);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Free the memory associated with each toggle. */
while (toggles != NULL) {
toggle *t = toggles;
free(bill);
}
#endif /* ENABLE_COLOR */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Free the search and replace history lists. */
if (searchage != NULL)
free_filestruct(searchage);
* compiler to handle. */
char *ptr;
const shortcut *s;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const toggle *t;
#ifdef ENABLE_NANORC
bool old_whitespace = ISSET(WHITESPACE_DISPLAY);
htx[2] = NULL;
}
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
else if (currshortcut == extcmd_list) {
htx[0] = N_("Execute Command Help Text\n\n "
"This menu allows you to insert the output of a "
allocsize += (COLS < 24 ? (24 * mb_cur_max()) :
((COLS + 1) * mb_cur_max())) * length_of_list(currshortcut);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If we're on the main list, we also count the toggle help text.
* Each line has "M-%c\t\t\t", which fills 24 columns, plus a space,
* plus translated text, plus '\n'. */
ptr += sprintf(ptr, "\n");
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* And the toggles... */
if (currshortcut == main_list) {
for (t = toggles; t != NULL; t = t->next) {
/* If we're not in smooth scrolling mode, put the cursor at the
* beginning of the top line of the edit window, as Pico does. */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (!ISSET(SMOOTH_SCROLL)) {
#endif
openfile->current = openfile->edittop;
openfile->placewewant = 0;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
}
#endif
/* If we're not in smooth scrolling mode, put the cursor at the
* beginning of the top line of the edit window, as Pico does. */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (!ISSET(SMOOTH_SCROLL)) {
#endif
openfile->current = openfile->edittop;
openfile->placewewant = 0;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
}
#endif
}
#endif /* !DISABLE_JUSTIFY */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Move to the next word in the current filestruct. If allow_punct is
* TRUE, treat punctuation as part of a word. If allow_update is TRUE,
* update the screen afterward. Return TRUE if we started on a word,
{
do_prev_word(ISSET(WORD_BOUNDS), TRUE);
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
void do_home(void)
{
check_statusblank();
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (ISSET(SMART_HOME)) {
size_t current_x_save = openfile->current_x;
#endif
openfile->current_x = 0;
openfile->placewewant = 0;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
}
#endif
* a page if we're not. */
if (openfile->current_y == 0)
edit_scroll(UP,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
ISSET(SMOOTH_SCROLL) ? 1 :
#endif
editwinrows / 2);
}
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void do_scroll_up(void)
{
check_statusblank();
/* Scroll the edit window up one line. */
edit_scroll(UP, 1);
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
void do_down(void)
{
* half a page if we're not. */
if (openfile->current_y == editwinrows - 1)
edit_scroll(DOWN,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
ISSET(SMOOTH_SCROLL) ? 1 :
#endif
editwinrows / 2);
}
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void do_scroll_down(void)
{
check_statusblank();
/* Scroll the edit window down one line. */
edit_scroll(DOWN, 1);
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
void do_left(void)
{
#include <getopt.h>
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
#include <setjmp.h>
#endif
static struct termios oldterm; /* The user's original term settings. */
static struct sigaction act; /* For all our fun signal handlers. */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
static sigjmp_buf jmpbuf; /* Used to return to main() after a
* SIGWINCH. */
#endif
{
filestruct *top_save;
bool edittop_inside;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
bool mark_inside = FALSE;
#endif
edittop_inside = (openfile->edittop->lineno >=
openfile->fileage->lineno && openfile->edittop->lineno <=
openfile->filebot->lineno);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (openfile->mark_set)
mark_inside = (openfile->mark_begin->lineno >=
openfile->fileage->lineno &&
openfile->fileage = (filestruct *)nmalloc(sizeof(filestruct));
openfile->fileage->data = mallocstrcpy(NULL, "");
openfile->filebot = openfile->fileage;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (mark_inside) {
openfile->mark_begin = openfile->fileage;
openfile->mark_begin_x = top_x;
* it in range of current. */
if (edittop_inside)
edit_update(
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
ISSET(SMOOTH_SCROLL) ? NONE :
#endif
CENTER);
free(fileptr->filename);
free_filestruct(fileptr->fileage);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (fileptr->current_stat != NULL)
free(fileptr->current_stat);
#endif
/* Restore the old terminal settings. */
tcsetattr(0, TCSANOW, &oldterm);
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
if (!ISSET(NO_RCFILE) && ISSET(HISTORYLOG))
save_history();
#endif
print1opt("-h, -?", "--help", N_("Show this message"));
print1opt(_("+LINE,COLUMN"), "",
N_("Start at line LINE, column COLUMN"));
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
print1opt("-A", "--smarthome", N_("Enable smart home key"));
print1opt("-B", "--backup", N_("Save backups of existing files"));
print1opt(_("-C [dir]"), _("--backupdir=[dir]"),
print1opt("-F", "--multibuffer", N_("Enable multiple file buffers"));
#endif
#ifdef ENABLE_NANORC
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
print1opt("-H", "--historylog",
N_("Log & read search/replace string history"));
#endif
N_("Fix numeric keypad key confusion problem"));
print1opt("-L", "--nonewlines",
N_("Don't add newlines to the ends of files"));
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
print1opt("-N", "--noconvert",
N_("Don't convert files from DOS/Mac format"));
#endif
N_("Quoting string"));
#endif
print1opt("-R", "--restricted", N_("Restricted mode"));
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
print1opt("-S", "--smooth", N_("Smooth scrolling"));
#endif
print1opt(_("-T [#cols]"), _("--tabsize=[#cols]"),
N_("Set width of a tab in cols to #cols"));
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
print1opt("-U", "--quickblank", N_("Do quick statusbar blanking"));
#endif
print1opt("-V", "--version",
N_("Print version information and exit"));
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
print1opt("-W", "--wordbounds",
N_("Detect word boundaries more accurately"));
#endif
print1opt("-c", "--const", N_("Constantly show cursor position"));
print1opt("-d", "--rebinddelete",
N_("Fix Backspace/Delete confusion problem"));
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
print1opt("-i", "--autoindent",
N_("Automatically indent new lines"));
print1opt("-k", "--cut", N_("Cut from cursor to end of line"));
#ifdef ENABLE_NANORC
printf(" --enable-nanorc");
#endif
-#ifdef NANO_SMALL
+#ifdef NANO_TINY
printf(" --enable-tiny");
#endif
#ifdef ENABLE_UTF8
sigaction(SIGHUP, &act, NULL);
sigaction(SIGTERM, &act, NULL);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Trap SIGWINCH because we want to handle window resizes. */
act.sa_handler = handle_sigwinch;
sigaction(SIGWINCH, &act, NULL);
/* Handler for SIGCONT (continue after suspend). */
void do_cont(int signal)
{
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Perhaps the user resized the window while we slept. Handle it,
* and update the screen in the process. */
handle_sigwinch(0);
#endif
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void handle_sigwinch(int s)
{
const char *tty = ttyname(0);
sigaddset(&winch, SIGWINCH);
sigprocmask(allow ? SIG_UNBLOCK : SIG_BLOCK, &winch, NULL);
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void do_toggle(const toggle *which)
{
bool enabled;
statusbar("%s %s", which->desc, enabled ? _("enabled") :
_("disabled"));
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
void disable_extended_io(void)
{
tcsetattr(0, TCSANOW, &term);
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void enable_signals(void)
{
struct termios term;
/* The length of the input buffer. */
const shortcut *s;
bool have_shortcut;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const toggle *t;
bool have_toggle;
#endif
have_shortcut = (s != NULL || input == NANO_XON_KEY ||
input == NANO_XOFF_KEY || input == NANO_SUSPEND_KEY);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Check for a toggle in the main list. */
t = get_toggle(input, *meta_key);
/* Set s_or_t to TRUE if we got a shortcut or toggle. */
*s_or_t = (have_shortcut
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
|| have_toggle
#endif
);
case NANO_XOFF_KEY:
statusbar(_("XOFF ignored, mumble mumble."));
break;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
case NANO_SUSPEND_KEY:
if (ISSET(SUSPEND))
do_suspend(0);
break;
}
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
else if (have_toggle) {
/* Blow away the text in the cutbuffer, since we aren't
* cutting text. */
get_page_start(xplustabs()) + mouse_x);
openfile->placewewant = xplustabs();
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Clicking where the cursor is toggles the mark, as does
* clicking beyond the line length with the cursor at the
* end of the line. */
openfile->totsize++;
set_modified();
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Note that current_x has not yet been incremented. */
if (openfile->mark_set && openfile->current ==
openfile->mark_begin && openfile->current_x <
#endif
{"nohelp", 0, NULL, 'x'},
{"suspend", 0, NULL, 'z'},
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
{"smarthome", 0, NULL, 'A'},
{"backup", 0, NULL, 'B'},
{"backupdir", 1, NULL, 'C'},
case 'j':
/* Pico compatibility flags. */
break;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
case 'A':
SET(SMART_HOME);
break;
break;
#endif
#ifdef ENABLE_NANORC
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
case 'H':
SET(HISTORYLOG);
break;
case 'L':
SET(NO_NEWLINES);
break;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
case 'N':
SET(NO_CONVERT);
break;
case 'R':
SET(RESTRICTED);
break;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
case 'S':
SET(SMOOTH_SCROLL);
break;
exit(1);
}
break;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
case 'U':
SET(QUICK_BLANK);
break;
case 'V':
version();
exit(0);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
case 'W':
SET(WORD_BOUNDS);
break;
case 'd':
SET(REBIND_DELETE);
break;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
case 'i':
SET(AUTOINDENT);
break;
#ifndef DISABLE_WRAPJUSTIFY
ssize_t wrap_at_cpy = wrap_at;
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
char *backup_dir_cpy = backup_dir;
#endif
#ifndef DISABLE_JUSTIFY
#ifndef DISABLE_OPERATINGDIR
operating_dir = NULL;
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
backup_dir = NULL;
#endif
#ifndef DISABLE_JUSTIFY
if (fill_used)
wrap_at = wrap_at_cpy;
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (backup_dir_cpy != NULL) {
free(backup_dir);
backup_dir = backup_dir_cpy;
#endif
#endif /* ENABLE_NANORC */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
history_init();
#ifdef ENABLE_NANORC
if (!ISSET(NO_RCFILE) && ISSET(HISTORYLOG))
#endif
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Set up the backup directory (unless we're using restricted mode,
* in which case backups are disabled, since they would allow
* reading from or writing to files not specified on the command
}
#endif
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
/* If whitespace wasn't specified, set its default value. */
if (whitespace == NULL) {
whitespace = mallocstrcpy(NULL, " ");
display_main_list();
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Return here after a SIGWINCH. */
sigsetjmp(jmpbuf, 1);
#endif
* position. */
bool modified; /* Current file's modification
* status. */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
bool mark_set; /* Current file's marking status. */
filestruct *mark_begin; /* Current file's beginning marked
* line. */
struct shortcut *next;
} shortcut;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
typedef struct toggle {
int val; /* Sequence to toggle the key. Should only need
* one. */
#define NANO_FULLJUSTIFY_ALTKEY NANO_ALT_J
#define NANO_VERBATIM_KEY NANO_ALT_V
-#ifndef NANO_SMALL
-/* Toggles do not exist with NANO_SMALL. */
+#ifndef NANO_TINY
+/* Toggles do not exist with NANO_TINY. */
#define TOGGLE_CONST_KEY NANO_ALT_C
#define TOGGLE_AUTOINDENT_KEY NANO_ALT_I
#define TOGGLE_SUSPEND_KEY NANO_ALT_Z
#define TOGGLE_WHITESPACE_KEY NANO_ALT_P
#define TOGGLE_MORESPACE_KEY NANO_ALT_O
#define TOGGLE_TABSTOSPACES_KEY NANO_ALT_Q
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
#define MAIN_VISIBLE 12
input == NANO_FORWARD_KEY || input == NANO_BACK_KEY ||
input == NANO_BACKSPACE_KEY || input == NANO_DELETE_KEY ||
input == NANO_CUT_KEY ||
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
input == NANO_NEXTWORD_KEY ||
#endif
(*meta_key == TRUE && (
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
input == NANO_PREVWORD_KEY ||
#endif
input == NANO_VERBATIM_KEY)));
'\0' || currshortcut != writefile_list)
do_statusbar_cut_text();
break;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
case NANO_NEXTWORD_KEY:
do_statusbar_next_word(FALSE);
break;
{
size_t pww_save = statusbar_pww;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (ISSET(SMART_HOME)) {
size_t statusbar_x_save = statusbar_x;
#endif
statusbar_x = 0;
statusbar_pww = statusbar_xplustabs();
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
}
#endif
{
assert(answer != NULL);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (ISSET(CUT_TO_END))
null_at(&answer, statusbar_x);
else {
null_at(&answer, 0);
statusbar_x = 0;
statusbar_pww = statusbar_xplustabs();
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
}
#endif
update_statusbar_line(answer, statusbar_x);
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Move to the next word at the statusbar prompt. If allow_punct is
* TRUE, treat punctuation as part of a word. Return TRUE if we started
* on a word, and FALSE otherwise. */
/* Return whether we started on a word. */
return started_on_word;
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
void do_statusbar_verbatim_input(bool *got_enter)
{
/* Get a string of input at the statusbar prompt. This should only be
* called from do_prompt(). */
int get_prompt_string(bool allow_tabs, const char *curranswer,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
filestruct **history_list,
#endif
const shortcut *s
bool tabbed = FALSE;
/* Whether we've pressed Tab. */
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
char *history = NULL;
/* The current history string. */
char *magichistory = NULL;
/* The length of the original string that we're trying to
* tab complete, if any. */
#endif
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
answer = mallocstrcpy(answer, curranswer);
curranswer_len = strlen(answer);
switch (kbinput) {
case NANO_TAB_KEY:
#ifndef DISABLE_TABCOMP
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (history_list != NULL) {
if (last_kbinput != NANO_TAB_KEY)
complete_len = strlen(answer);
statusbar_x = strlen(answer);
}
} else
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
if (allow_tabs)
answer = input_tab(answer, &statusbar_x, &tabbed,
list);
#endif /* !DISABLE_TABCOMP */
break;
case NANO_PREVLINE_KEY:
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (history_list != NULL) {
/* If we're scrolling up at the bottom of the
* history list and answer isn't blank, save answer
* statusbar prompt. */
finished = FALSE;
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
break;
case NANO_NEXTLINE_KEY:
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (history_list != NULL) {
/* Get the newer search from the history list and
* save it in answer. If there is no newer search,
update_statusbar_line(answer, statusbar_x);
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
break;
}
if (finished)
break;
-#if !defined(NANO_SMALL) && !defined(DISABLE_TABCOMP)
+#if !defined(NANO_TINY) && !defined(DISABLE_TABCOMP)
last_kbinput = kbinput;
#endif
reset_statusbar_cursor();
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Set the current position in the history list to the bottom and
* free magichistory, if we need to. */
if (history_list != NULL) {
* interpreted. */
int do_prompt(bool allow_tabs, const shortcut *s, const char
*curranswer,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
filestruct **history_list,
#endif
const char *msg, ...)
null_at(&prompt, actual_x(prompt, COLS - 4));
retval = get_prompt_string(allow_tabs, curranswer,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
history_list,
#endif
s
extern ssize_t tabsize;
extern int currslen;
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
extern char *whitespace;
extern int whitespace_len[2];
#endif
#endif
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
extern char *backup_dir;
#endif
extern shortcut *replace_list, *gotoline_list;
extern shortcut *writefile_list, *insertfile_list;
extern shortcut *replace_list_2;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
extern shortcut *extcmd_list;
#endif
#ifndef DISABLE_HELP
#endif
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
extern toggle *toggles;
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
extern filestruct *search_history;
extern filestruct *searchage;
extern filestruct *searchbot;
const char *nstrcasestr(const char *haystack, const char *needle);
#endif
const char *mbstrcasestr(const char *haystack, const char *needle);
-#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
+#if !defined(NANO_TINY) || !defined(DISABLE_TABCOMP)
const char *revstrstr(const char *haystack, const char *needle, const
char *rev_start);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *revstrcasestr(const char *haystack, const char *needle,
const char *rev_start);
const char *mbrevstrcasestr(const char *haystack, const char *needle,
/* Public functions in cut.c. */
void cutbuffer_reset(void);
void cut_line(void);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void cut_marked(void);
void cut_to_eol(void);
#endif
void do_cut_text(void);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void do_cut_till_end(void);
#endif
void do_uncut_text(void);
int open_file(const char *filename, bool newfie, FILE **f);
char *get_next_filename(const char *name, const char *suffix);
void do_insertfile(
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
bool execute
#else
void
void init_operating_dir(void);
bool check_operating_dir(const char *currpath, bool allow_tabcomp);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void init_backup_dir(void);
#endif
int copy_file(FILE *inn, FILE *out);
int write_file(const char *name, FILE *f_open, bool tmp, append_type
append, bool nonamechange);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
int write_marked_file(const char *name, FILE *f_open, bool tmp,
append_type append);
#endif
char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list);
#endif
const char *tail(const char *foo);
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
char *histfilename(void);
void load_history(void);
bool writehist(FILE *hist, filestruct *histhead);
/* Public functions in global.c. */
size_t length_of_list(const shortcut *s);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void toggle_init_one(int val, const char *desc, long flag);
void toggle_init(void);
#endif
void do_para_end(bool allow_update);
void do_para_end_void(void);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
bool do_next_word(bool allow_punct, bool allow_update);
void do_next_word_void(void);
bool do_prev_word(bool allow_punct, bool allow_update);
void do_home(void);
void do_end(void);
void do_up(void);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void do_scroll_up(void);
#endif
void do_down(void);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void do_scroll_down(void);
#endif
void do_left(void);
void handle_hupterm(int signal);
void do_suspend(int signal);
void do_cont(int signal);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void handle_sigwinch(int s);
void allow_pending_sigwinch(bool allow);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void do_toggle(const toggle *which);
#endif
void disable_extended_io(void);
void disable_signals(void);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void enable_signals(void);
#endif
void disable_flow_control(void);
void do_statusbar_backspace(void);
void do_statusbar_delete(void);
void do_statusbar_cut_text(void);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
bool do_statusbar_next_word(bool allow_punct);
bool do_statusbar_prev_word(bool allow_punct);
#endif
void reset_statusbar_cursor(void);
bool need_statusbar_horizontal_update(size_t old_pww);
int get_prompt_string(bool allow_tabs, const char *curranswer,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
filestruct **history_list,
#endif
const shortcut *s
);
int do_prompt(bool allow_tabs, const shortcut *s, const char
*curranswer,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
filestruct **history_list,
#endif
const char *msg, ...);
*needle, size_t *needle_len);
void findnextstr_wrap_reset(void);
void do_search(void);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void do_research(void);
#endif
void replace_abort(void);
void do_gotopos(ssize_t line, size_t pos_x, ssize_t pos_y, size_t
pos_pww);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
#ifdef HAVE_REGEX_H
void do_find_bracket(void);
#endif
#endif
/* Public functions in text.c. */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void do_mark(void);
#endif
void do_delete(void);
void do_backspace(void);
void do_tab(void);
void do_enter(void);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void cancel_command(int signal);
bool execute_command(const char *command);
#endif
#if !defined(DISABLE_HELP) || !defined(DISABLE_JUSTIFY) || !defined(DISABLE_WRAPPING)
ssize_t break_line(const char *line, ssize_t goal, bool newline);
#endif
-#if !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY)
+#if !defined(NANO_TINY) || !defined(DISABLE_JUSTIFY)
size_t indent_length(const char *line);
#endif
#ifndef DISABLE_JUSTIFY
const char *do_alt_speller(char *tempfile_name);
void do_spell(void);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void do_wordlinechar_count(void);
#endif
void do_verbatim_input(void);
void null_at(char **data, size_t index);
void unsunder(char *str, size_t true_len);
void sunder(char *str);
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
#ifndef HAVE_GETLINE
ssize_t ngetline(char **lineptr, size_t *n, FILE *stream);
#endif
size_t strnlenpt(const char *s, size_t maxlen);
size_t strlenpt(const char *s);
void new_magicline(void);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void remove_magicline(void);
void mark_order(const filestruct **top, size_t *top_x, const filestruct
**bot, size_t *bot_x, bool *right_side_up);
#endif
/* Public functions in winio.c. */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void reset_kbinput(void);
#endif
void get_key_buffer(WINDOW *win);
int *get_input(WINDOW *win, size_t input_len);
int get_kbinput(WINDOW *win, bool *meta_key, bool *func_key);
int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
, bool reset
#endif
);
*ignore_seq);
int get_escape_seq_abcd(int kbinput);
int get_byte_kbinput(int kbinput
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
, bool reset
#endif
);
long get_unicode_kbinput(int kbinput
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
, bool reset
#endif
);
#endif
const shortcut *get_shortcut(const shortcut *s_list, int *kbinput, bool
*meta_key, bool *func_key);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const toggle *get_toggle(int kbinput, bool meta_key);
#endif
void blank_line(WINDOW *win, int y, int x, int n);
{"tabsize", 0},
{"tempfile", TEMP_FILE},
{"view", VIEW_MODE},
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
{"autoindent", AUTOINDENT},
{"backup", BACKUP_FILE},
{"backupdir", 0},
free(option);
} else
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (strcasecmp(rcopts[i].name, "whitespace") == 0) {
whitespace = option;
if (mbstrlen(whitespace) != 2 ||
quotestr = option;
else
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (strcasecmp(rcopts[i].name,
"backupdir") == 0)
backup_dir = option;
static bool search_last_line = FALSE;
/* Have we gone past the last line while searching? */
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
static bool history_changed = FALSE;
/* Have any of the history lists changed? */
#endif
int regexp_init(const char *regexp)
{
int rc = regcomp(&search_regexp, regexp, REG_EXTENDED
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
| (ISSET(CASE_SENSITIVE) ? 0 : REG_ICASE)
#endif
);
void search_abort(void)
{
display_main_list();
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (openfile->mark_set)
edit_refresh();
#endif
/* This is now one simple call. It just does a lot. */
i = do_prompt(FALSE, replacing ? replace_list : whereis_list,
backupstring,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
&search_history,
#endif
"%s%s%s%s%s%s", _("Search"),
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* This string is just a modifier for the search prompt; no
* grammar is implied. */
ISSET(CASE_SENSITIVE) ? _(" [Case Sensitive]") :
#endif
"",
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* This string is just a modifier for the search prompt; no
* grammar is implied. */
ISSET(BACKWARDS_SEARCH) ? _(" [Backwards]") :
"",
replacing ?
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
openfile->mark_set ? _(" (to replace) in selection") :
#endif
_(" (to replace)") : "",
return -1;
#endif
break;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
case TOGGLE_CASE_KEY:
TOGGLE(CASE_SENSITIVE);
backupstring = mallocstrcpy(backupstring, answer);
* rev_start will be properly set when the search continues on the
* previous or next line. */
rev_start =
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
ISSET(BACKWARDS_SEARCH) ?
fileptr->data + (openfile->current_x - 1) :
#endif
return FALSE;
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (ISSET(BACKWARDS_SEARCH)) {
fileptr = fileptr->prev;
current_y_find--;
#endif
fileptr = fileptr->next;
current_y_find++;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
}
#endif
if (!can_display_wrap)
return FALSE;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (ISSET(BACKWARDS_SEARCH)) {
fileptr = openfile->filebot;
current_y_find = editwinrows - 1;
#endif
fileptr = openfile->fileage;
current_y_find = 0;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
}
#endif
search_last_line = TRUE;
rev_start = fileptr->data;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (ISSET(BACKWARDS_SEARCH))
rev_start += strlen(fileptr->data);
#endif
/* Ensure we haven't wrapped around again! */
if (search_last_line &&
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
((!ISSET(BACKWARDS_SEARCH) && current_x_find > begin_x) ||
(ISSET(BACKWARDS_SEARCH) && current_x_find < begin_x))
#else
search_abort();
else if (i == -2) /* Replace. */
do_replace();
-#if !defined(NANO_SMALL) || defined(HAVE_REGEX_H)
+#if !defined(NANO_TINY) || defined(HAVE_REGEX_H)
else if (i == 1) /* Case Sensitive, Backwards, or Regexp search
* toggle. */
do_search();
else
last_search = mallocstrcpy(last_search, answer);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If answer is not "", add this search string to the search history
* list. */
if (answer[0] != '\0')
search_abort();
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Search for the next string without prompting. */
void do_research(void)
{
/* The starting-line match and bol/eol regex flags. */
bool begin_line = FALSE, bol_or_eol = FALSE;
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
bool old_mark_set = openfile->mark_set;
filestruct *edittop_save = openfile->edittop, *top, *bot;
size_t top_x, bot_x;
length_change = strlen(copy) -
strlen(openfile->current->data);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If the mark was on and (mark_begin, mark_begin_x) was the
* top of it, don't change mark_begin_x. */
if (!old_mark_set || !right_side_up) {
match_len;
*real_current_x += length_change;
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
}
#endif
* text, so searching will resume after the replacement
* text. Note that current_x might be set to (size_t)-1
* here. */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (!ISSET(BACKWARDS_SEARCH))
#endif
openfile->current_x += match_len + length_change - 1;
}
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (old_mark_set) {
/* If the mark was on, unpartition the filestruct so that it
* contains all the text again, set edittop back to what it was
/* If answer is not "", add answer to the search history list and
* copy answer into last_search. */
if (answer[0] != '\0') {
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
update_history(&search_history, answer);
#endif
last_search = mallocstrcpy(last_search, answer);
last_replace = mallocstrcpy(last_replace, "");
i = do_prompt(FALSE, replace_list_2, last_replace,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
&replace_history,
#endif
_("Replace with"));
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Add this replace string to the replace history list. i == 0
* means that the string is not "". */
if (i == 0)
/* Ask for it. */
int i = do_prompt(FALSE, gotoline_list, use_answer ? ans : "",
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
NULL,
#endif
_("Enter line number, column number"));
}
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
#ifdef HAVE_REGEX_H
void do_find_bracket(void)
{
return (char *)s;
}
#endif /* !DISABLE_TABCOMP */
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
#include <errno.h>
#include "proto.h"
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
static pid_t pid = -1;
/* The PID of the newly forked process in execute_command(), for
* use with the cancel_command() signal handler. */
/* Pointer to the end of the justify buffer. */
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void do_mark(void)
{
openfile->mark_set = !openfile->mark_set;
edit_refresh();
}
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
void do_delete(void)
{
null_at(&openfile->current->data, openfile->current_x +
line_len - char_buf_len);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (openfile->mark_set && openfile->mark_begin ==
openfile->current && openfile->current_x <
openfile->mark_begin_x)
openfile->current_x + strlen(foo->data) + 1);
strcpy(openfile->current->data + openfile->current_x,
foo->data);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (openfile->mark_set && openfile->mark_begin ==
openfile->current->next) {
openfile->mark_begin = openfile->current;
void do_tab(void)
{
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (ISSET(TABS_TO_SPACES)) {
char *output;
size_t output_len = 0, new_pww = xplustabs();
} else {
#endif
do_output("\t", 1, TRUE);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
}
#endif
}
assert(openfile->current != NULL && openfile->current->data != NULL);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Do auto-indenting, like the neolithic Turbo Pascal editor. */
if (ISSET(AUTOINDENT)) {
/* If we are breaking the line in the indentation, the new
openfile->current_x) + extra + 1);
strcpy(&newnode->data[extra], openfile->current->data +
openfile->current_x);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (ISSET(AUTOINDENT)) {
strncpy(newnode->data, openfile->current->data, extra);
openfile->totsize += mbstrlen(newnode->data);
}
#endif
null_at(&openfile->current->data, openfile->current_x);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (openfile->mark_set && openfile->current ==
openfile->mark_begin && openfile->current_x <
openfile->mark_begin_x) {
edit_refresh();
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
void cancel_command(int signal)
{
if (kill(pid, SIGKILL) == -1)
return TRUE;
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
#ifndef DISABLE_WRAPPING
void wrap_reset(void)
/* The length of the line we wrap. */
ssize_t wrap_loc;
/* The index of line->data where we wrap. */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const char *indent_string = NULL;
/* Indentation to prepend to the new line. */
size_t indent_len = 0;
if (line->data[wrap_loc] == '\0')
return FALSE;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If autoindent is turned on, and we're on the character just after
* the indentation, we don't wrap. */
if (ISSET(AUTOINDENT)) {
* the text of the next line. */
new_line_len += after_break_len;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (ISSET(AUTOINDENT)) {
if (wrapping) {
/* If we're wrapping, the indentation will come from the
new_line = charalloc(new_line_len + 1);
new_line[0] = '\0';
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (ISSET(AUTOINDENT)) {
/* Copy the indentation. */
strncpy(new_line, indent_string, indent_len);
same_line_wrap = FALSE;
openfile->current = openfile->current->next;
openfile->current_x -= wrap_loc
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
- indent_len
#endif
;
openfile->placewewant = xplustabs();
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If the mark was on this line after the wrap point, we move it
* down. If it was on the next line and we wrapped onto that line,
* we move it right. */
}
#endif /* !DISABLE_HELP || !DISABLE_JUSTIFY || !DISABLE_WRAPPING */
-#if !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY)
+#if !defined(NANO_TINY) || !defined(DISABLE_JUSTIFY)
/* The "indentation" of a line is the whitespace between the quote part
* and the non-whitespace of the line. */
size_t indent_length(const char *line)
return len;
}
-#endif /* !NANO_SMALL || !DISABLE_JUSTIFY */
+#endif /* !NANO_TINY || !DISABLE_JUSTIFY */
#ifndef DISABLE_JUSTIFY
/* justify_format() replaces blanks with spaces and multiple spaces by 1
{
char *end, *new_end, *new_paragraph_data;
size_t shift = 0;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
size_t mark_shift = 0;
#endif
end += end_len;
shift += end_len;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Keep track of the change in the current line. */
if (openfile->mark_set && openfile->mark_begin ==
paragraph && openfile->mark_begin_x >= end -
end += end_len;
shift += end_len;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Keep track of the change in the current line. */
if (openfile->mark_set && openfile->mark_begin ==
paragraph && openfile->mark_begin_x >= end -
free(paragraph->data);
paragraph->data = new_paragraph_data;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Adjust the mark coordinates to compensate for the change in
* the current line. */
if (openfile->mark_set && openfile->mark_begin == paragraph) {
/* Case 2) or 5) or 4). */
if (foo->prev->data[quote_len + temp_id_len] == '\0' ||
(quote_len == 0 && indent_len > 0
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
&& !ISSET(AUTOINDENT)
#endif
) || !indents_match(foo->prev->data + quote_len, temp_id_len,
ssize_t fl_lineno_save = first_line->lineno;
ssize_t edittop_lineno_save = openfile->edittop->lineno;
ssize_t current_lineno_save = openfile->current->lineno;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
bool old_mark_set = openfile->mark_set;
ssize_t mb_lineno_save = 0;
size_t mark_begin_x_save = 0;
openfile->edittop = top;
if (top->lineno == current_lineno_save)
openfile->current = top;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (old_mark_set && top->lineno == mb_lineno_save) {
openfile->mark_begin = top;
openfile->mark_begin_x = mark_begin_x_save;
size_t pww_save = openfile->placewewant;
ssize_t current_y_save = openfile->current_y;
size_t totsize_save = openfile->totsize;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
filestruct *mark_begin_save = openfile->mark_begin;
size_t mark_begin_x_save = openfile->mark_begin_x;
#endif
if (next_line == openfile->filebot)
openfile->filebot = openfile->current;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Adjust the mark coordinates to compensate for the change
* in the next line. */
if (openfile->mark_set && openfile->mark_begin ==
* turned on, set the indentation length to zero so that the
* indentation is treated as part of the line. */
if (quote_len == 0
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
&& !ISSET(AUTOINDENT)
#endif
)
par_len++;
openfile->totsize += indent_len + 1;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Adjust the mark coordinates to compensate for the change
* in the current line. */
if (openfile->mark_set && openfile->mark_begin ==
openfile->placewewant = pww_save;
openfile->current_y = current_y_save;
openfile->totsize = totsize_save;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (openfile->mark_set) {
openfile->mark_begin = mark_begin_save;
openfile->mark_begin_x = mark_begin_x_save;
bool canceled = FALSE;
/* The return value. */
bool case_sens_set = ISSET(CASE_SENSITIVE);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
bool backwards_search_set = ISSET(BACKWARDS_SEARCH);
#endif
#ifdef HAVE_REGEX_H
bool regexp_set = ISSET(USE_REGEXP);
#endif
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
bool old_mark_set = openfile->mark_set;
bool added_magicline = FALSE;
/* Whether we added a magicline after filebot. */
/* Make sure spell-check is case sensitive. */
SET(CASE_SENSITIVE);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Make sure spell-check goes forward only. */
UNSET(BACKWARDS_SEARCH);
#endif
last_search = mallocstrcpy(NULL, word);
last_replace = mallocstrcpy(NULL, word);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (old_mark_set) {
/* If the mark is on, partition the filestruct so that it
* contains only the marked text; if the NO_NEWLINES flag isn't
/* Allow all instances of the word to be corrected. */
canceled = (do_prompt(FALSE, spell_list, word,
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
NULL,
#endif
_("Edit a replacement")) == -1);
}
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (old_mark_set) {
/* If the mark was on, the NO_NEWLINES flag isn't set, and we
* added a magicline, remove it now. */
if (!case_sens_set)
UNSET(CASE_SENSITIVE);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Restore search/replace direction. */
if (backwards_search_set)
SET(BACKWARDS_SEARCH);
char *ptr;
static int arglen = 3;
static char **spellargs = NULL;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
bool old_mark_set = openfile->mark_set;
bool added_magicline = FALSE;
/* Whether we added a magicline after filebot. */
if (pid_spell < 0)
return _("Could not fork");
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Don't handle a pending SIGWINCH until the alternate spell checker
* is finished and we've loaded the spell-checked file back in. */
allow_pending_sigwinch(FALSE);
char *altspell_error;
char *invoke_error = _("Error invoking \"%s\"");
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Turn the mark back on if it was on before. */
openfile->mark_set = old_mark_set;
#endif
return altspell_error;
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (old_mark_set) {
/* If the mark is on, partition the filestruct so that it
* contains only the marked text; if the NO_NEWLINES flag isn't
* text. */
replace_buffer(tempfile_name);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (old_mark_set) {
filestruct *top_save = openfile->fileage;
do_gotopos(lineno_save, current_x_save, current_y_save, pww_save);
set_modified();
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Handle a pending SIGWINCH again. */
allow_pending_sigwinch(TRUE);
#endif
return;
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (openfile->mark_set)
i = write_marked_file(temp, temp_file, TRUE, OVERWRITE);
else
}
#endif /* !DISABLE_SPELLER */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Our own version of "wc". Note that its character counts are in
* multibyte characters instead of single-byte characters. */
void do_wordlinechar_count(void)
_("In Selection: ") : "", (unsigned long)words, (long)lines,
(unsigned long)chars);
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
void do_verbatim_input(void)
{
* along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
#ifndef HAVE_GETLINE
/* This function is equivalent to getline(). */
ssize_t ngetline(char **lineptr, size_t *n, FILE *stream)
return (c == EOF && (indx - 1) == 0) ? -1 : indx - 1;
}
#endif
-#endif /* !NANO_SMALL && ENABLE_NANORC */
+#endif /* !NANO_TINY && ENABLE_NANORC */
#ifdef HAVE_REGEX_H
#ifdef BROKEN_REGEXEC
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP)) {
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (ISSET(BACKWARDS_SEARCH)) {
if (regexec(&search_regexp, haystack, 1, regmatches,
0) == 0 && haystack + regmatches[0].rm_so <= start) {
return retval;
}
} else
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
if (regexec(&search_regexp, start, 10, regmatches,
(start > haystack) ? REG_NOTBOL : 0) == 0) {
const char *retval = start + regmatches[0].rm_so;
return NULL;
}
#endif /* HAVE_REGEX_H */
-#if !defined(NANO_SMALL) || !defined(DISABLE_SPELLER)
+#if !defined(NANO_TINY) || !defined(DISABLE_SPELLER)
if (ISSET(CASE_SENSITIVE)) {
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (ISSET(BACKWARDS_SEARCH))
return revstrstr(haystack, needle, start);
else
#endif
return strstr(start, needle);
}
-#endif /* !DISABLE_SPELLER || !NANO_SMALL */
-#ifndef NANO_SMALL
+#endif /* !DISABLE_SPELLER || !NANO_TINY */
+#ifndef NANO_TINY
else if (ISSET(BACKWARDS_SEARCH))
return mbrevstrcasestr(haystack, needle, start);
#endif
openfile->totsize++;
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Remove the magicline from filebot, if there is one and it isn't the
* only line in the file. */
void remove_magicline(void)
* Note that Center (5) on the numeric keypad with NumLock off can also
* be the Begin key. */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* Reset all the input routines that rely on character sequences. */
void reset_kbinput(void)
{
return;
/* Read in the first character using blocking input. */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
allow_pending_sigwinch(TRUE);
#endif
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
allow_pending_sigwinch(FALSE);
#endif
nodelay(win, TRUE);
while (TRUE) {
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
allow_pending_sigwinch(TRUE);
#endif
sizeof(int));
key_buffer[key_buffer_len - 1] = input;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
allow_pending_sigwinch(FALSE);
#endif
}
* keystroke buffer. */
void unget_input(int *input, size_t input_len)
{
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
allow_pending_sigwinch(TRUE);
allow_pending_sigwinch(FALSE);
#endif
{
int *input;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
allow_pending_sigwinch(TRUE);
allow_pending_sigwinch(FALSE);
#endif
/* Read in a character and interpret it. Continue doing this until
* we get a recognized value or sequence. */
while ((kbinput = parse_kbinput(win, meta_key, func_key
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
, FALSE
#endif
)) == ERR);
* when we get a meta key sequence, and set func_key to TRUE when we get
* a function key. Assume nodelay(win) is FALSE. */
int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
, bool reset
#endif
)
static int escapes = 0, byte_digits = 0;
int *kbinput, retval = ERR;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (reset) {
escapes = 0;
byte_digits = 0;
escapes = 0;
}
break;
-#if !defined(NANO_SMALL) && defined(KEY_RESIZE)
+#if !defined(NANO_TINY) && defined(KEY_RESIZE)
/* Since we don't change the default SIGWINCH handler when
- * NANO_SMALL is defined, KEY_RESIZE is never generated. Also,
+ * NANO_TINY is defined, KEY_RESIZE is never generated. Also,
* Slang and SunOS 5.7-5.9 don't support KEY_RESIZE. */
case KEY_RESIZE:
break;
byte_digits++;
byte = get_byte_kbinput(*kbinput
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
, FALSE
#endif
);
/* Translate a byte sequence: turn a three-digit decimal number from
* 000 to 255 into its corresponding byte value. */
int get_byte_kbinput(int kbinput
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
, bool reset
#endif
)
static int byte_digits = 0, byte = 0;
int retval = ERR;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (reset) {
byte_digits = 0;
byte = 0;
* from 000000 to 10FFFF (case-insensitive) into its corresponding
* multibyte value. */
long get_unicode_kbinput(int kbinput
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
, bool reset
#endif
)
static long uni = 0;
long retval = ERR;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (reset) {
uni_digits = 0;
uni = 0;
/* Check whether the first keystroke is a hexadecimal digit. */
uni = get_unicode_kbinput(*kbinput
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
, FALSE
#endif
);
while ((kbinput = get_input(win, 1)) == NULL);
uni = get_unicode_kbinput(*kbinput
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
, FALSE
#endif
);
return NULL;
}
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
const toggle *get_toggle(int kbinput, bool meta_key)
{
const toggle *t = toggles;
return t;
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
/* Move to (x, y) in win, and display a line of n spaces with the
* current attributes. */
/* If buf contains a tab character, interpret it. */
if (*buf_mb == '\t') {
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
if (ISSET(WHITESPACE_DISPLAY)) {
int i;
free(ctrl_buf_mb);
/* If buf contains a space character, interpret it. */
} else if (*buf_mb == ' ') {
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
if (ISSET(WHITESPACE_DISPLAY)) {
int i;
va_list ap;
char *bar, *foo;
size_t start_x, foo_len;
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
bool old_whitespace;
#endif
/* Blank out the line. */
blank_statusbar();
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
old_whitespace = ISSET(WHITESPACE_DISPLAY);
UNSET(WHITESPACE_DISPLAY);
#endif
vsnprintf(bar, mb_cur_max() * (COLS - 3), msg, ap);
va_end(ap);
foo = display_string(bar, 0, COLS - 4, FALSE);
-#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
if (old_whitespace)
SET(WHITESPACE_DISPLAY);
#endif
* keystroke. Otherwise, blank it after twenty-five keystrokes,
* as Pico does. */
statusblank =
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
ISSET(QUICK_BLANK) && !ISSET(CONST_UPDATE) ? 1 :
#endif
25;
void edit_draw(const filestruct *fileptr, const char *converted, int
line, size_t start)
{
-#if !defined(NANO_SMALL) || defined(ENABLE_COLOR)
+#if !defined(NANO_TINY) || defined(ENABLE_COLOR)
size_t startpos = actual_x(fileptr->data, start);
/* The position in fileptr->data of the leftmost character
* that displays at least partially on the window. */
}
#endif /* ENABLE_COLOR */
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
/* If the mark is on, we need to display it. */
if (openfile->mark_set && (fileptr->lineno <=
openfile->mark_begin->lineno || fileptr->lineno <=
wattroff(edit, A_REVERSE);
}
}
-#endif /* !NANO_SMALL */
+#endif /* !NANO_TINY */
}
/* Just update one line in the edit buffer. This is basically a wrapper
bool need_horizontal_update(size_t old_pww)
{
return
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
openfile->mark_set ||
#endif
get_page_start(old_pww) !=
bool need_vertical_update(size_t old_pww)
{
return
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
openfile->mark_set ||
#endif
get_page_start(old_pww) !=
* between the original edittop and the current edittop, and
* then restore the original edittop. */
edit_update(
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
ISSET(SMOOTH_SCROLL) ? NONE :
#endif
CENTER);
if (do_redraw)
update_line(foo, 0);
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
if (!openfile->mark_set)
#endif
break;
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
foo = (foo->lineno > openfile->current->lineno) ? foo->prev :
foo->next;
#endif
/* Put the top line of the edit window in range of the current
* line. */
edit_update(
-#ifndef NANO_SMALL
+#ifndef NANO_TINY
ISSET(SMOOTH_SCROLL) ? NONE :
#endif
CENTER);