TheGNUGeneralPublicLicenseisoftenshippedwithGNUsoftware,and isgenerallykeptinafilecalledCOPYINGorLICENSE.Ifyoudonot haveacopyofthelicense,writetotheFreeSoftwareFoundation,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA. */ #define READLINE_LIBRARY
#ifdefined (HAVE_CONFIG_H) # include "config_readline.h" #endif
#include <sys/types.h>
#ifdefined (HAVE_UNISTD_H) # include <unistd.h> /* for _POSIX_VERSION */ #endif/* HAVE_UNISTD_H */
#ifdefined (HAVE_STDLIB_H) # include <stdlib.h> #else # include "ansi_stdlib.h" #endif/* HAVE_STDLIB_H */
#include <stdio.h>
/* System-specific feature definitions and include files. */ #include"rldefs.h"
/* Some standard library routines. */ #include"readline.h" #include"history.h"
list = head; new = 0; while (list)
{
c = _rl_copy_undo_entry (list); if (new == 0)
roving = new = c; else
{
roving->next = c;
roving = roving->next;
}
list = list->next;
}
roving->next = 0; returnnew;
}
/* Undo the next thing in the list. Return 0 if there
is nothing to undo, or non-zero if there was. */ int
rl_do_undo ()
{
UNDO_LIST *release; int waiting_for_begin, start, end;
/* To better support vi-mode, a start or end value of -1 means
rl_point, and a value of -2 means rl_end. */ if (rl_undo_list->what == UNDO_DELETE || rl_undo_list->what == UNDO_INSERT)
{
start = TRANS (rl_undo_list->start);
end = TRANS (rl_undo_list->end);
}
switch (rl_undo_list->what)
{ /* Undoing deletes means inserting some text. */ case UNDO_DELETE:
rl_point = start;
rl_insert_text (rl_undo_list->text);
free (rl_undo_list->text); break;
/* Undoing inserts means deleting some text. */ case UNDO_INSERT:
rl_delete_text (start, end);
rl_point = start; break;
/* Undoing an END means undoing everything 'til we get to a BEGIN. */ case UNDO_END:
waiting_for_begin++; break;
/* Undoing a BEGIN means that we are done with this group. */ case UNDO_BEGIN: if (waiting_for_begin)
waiting_for_begin--; else
rl_ding (); break;
}
/* Begin a group. Subsequent undos are undone as an atomic operation. */ int
rl_begin_undo_group ()
{
rl_add_undo (UNDO_BEGIN, 0, 0, 0);
_rl_undo_group_level++; return0;
}
/* End an undo group started with rl_begin_undo_group (). */ int
rl_end_undo_group ()
{
rl_add_undo (UNDO_END, 0, 0, 0);
_rl_undo_group_level--; return0;
}
/* Save an undo entry for the text from START to END. */ int
rl_modifying (start, end) int start, end;
{ if (start > end)
{
SWAP (start, end);
}
/* Revert the current line to its previous state. */ int
rl_revert_line (count, key) int count __attribute__((unused)), key __attribute__((unused));
{ if (!rl_undo_list)
rl_ding (); else
{ while (rl_undo_list)
rl_do_undo (); #ifdefined (VI_MODE) if (rl_editing_mode == vi_mode)
rl_point = rl_mark = 0; /* rl_end should be set correctly */ #endif
}
return0;
}
/* Do some undoing of things that were done. */ int
rl_undo_command (count, key) int count, key __attribute__((unused));
{ if (count < 0) return0; /* Nothing to do. */
while (count)
{ if (rl_do_undo ())
count--; else
{
rl_ding (); break;
}
} return0;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.