1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Upgrade to libedit-2.9

BitKeeper/deleted/.del-readline.h~ac6080227e4b72fc:
  Delete: cmd-line-utils/libedit/readline/readline.h
This commit is contained in:
unknown
2005-04-21 12:06:46 +02:00
parent 7f0f4c5875
commit 948d88da93
42 changed files with 2857 additions and 1313 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: chared.c,v 1.18 2002/11/20 16:50:08 christos Exp $ */
/* $NetBSD: chared.c,v 1.22 2004/08/13 12:10:38 mycroft Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -15,11 +15,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -36,14 +32,7 @@
* SUCH DAMAGE.
*/
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
#if 0
static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: chared.c,v 1.18 2002/11/20 16:50:08 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
#include <config.h>
/*
* chared.c: Character editor utilities
@ -62,13 +51,13 @@ cv_undo(EditLine *el)
{
c_undo_t *vu = &el->el_chared.c_undo;
c_redo_t *r = &el->el_chared.c_redo;
int size;
uint size;
/* Save entire line for undo */
size = el->el_line.lastchar - el->el_line.buffer;
vu->len = size;
vu->cursor = el->el_line.cursor - el->el_line.buffer;
memcpy(vu->buf, el->el_line.buffer, (size_t)size);
memcpy(vu->buf, el->el_line.buffer, size);
/* save command info for redo */
r->count = el->el_state.doingarg ? el->el_state.argument : 0;
@ -139,6 +128,21 @@ c_delafter(EditLine *el, int num)
}
/* c_delafter1():
* Delete the character after the cursor, do not yank
*/
protected void
c_delafter1(EditLine *el)
{
char *cp;
for (cp = el->el_line.cursor; cp <= el->el_line.lastchar; cp++)
*cp = cp[1];
el->el_line.lastchar--;
}
/* c_delbefore():
* Delete num characters before the cursor
*/
@ -167,6 +171,21 @@ c_delbefore(EditLine *el, int num)
}
/* c_delbefore1():
* Delete the character before the cursor, do not yank
*/
protected void
c_delbefore1(EditLine *el)
{
char *cp;
for (cp = el->el_line.cursor - 1; cp <= el->el_line.lastchar; cp++)
*cp = cp[1];
el->el_line.lastchar--;
}
/* ce__isword():
* Return if p is part of a word according to emacs
*/
@ -460,8 +479,8 @@ ch_init(EditLine *el)
el->el_state.argument = 1;
el->el_state.lastcmd = ED_UNASSIGNED;
el->el_chared.c_macro.nline = NULL;
el->el_chared.c_macro.level = -1;
el->el_chared.c_macro.offset = 0;
el->el_chared.c_macro.macro = (char **) el_malloc(EL_MAXMACRO *
sizeof(char *));
if (el->el_chared.c_macro.macro == NULL)
@ -582,7 +601,7 @@ ch_enlargebufs(el, addlen)
return 0;
/* Safe to set enlarged buffer size */
el->el_line.limit = &newbuffer[newsz - EL_LEAVE];
el->el_line.limit = &el->el_line.buffer[newsz - EL_LEAVE];
return 1;
}