diff options
author | bapt <bapt@FreeBSD.org> | 2015-01-09 07:40:56 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-01-09 07:40:56 +0000 |
commit | 9092259f68a804406ade5c84b5ceb67aae8c8303 (patch) | |
tree | d33ef1b987208879e7fa795c6b8d9fb885b151a9 /lib/libedit/chared.h | |
parent | ced5b3dac1efcd02dc8fdf099780b1245832ae94 (diff) | |
download | FreeBSD-src-9092259f68a804406ade5c84b5ceb67aae8c8303.zip FreeBSD-src-9092259f68a804406ade5c84b5ceb67aae8c8303.tar.gz |
Synchronize libedit with NetBSD and activate UTF-8 support [1]
Differences with NetBSD
Reapply our local patches on top of it
Fix Unicode environement detection
Fix reading a line in unicode environment.
It allows /bin/sh to works in UTF-8 envs
Differential Revision: https://reviews.freebsd.org/D1455
Reviewed by: jilles, pfg
Obtained from: NetBSD [1]
MFC after: 1 month
Relnotes: yes
Diffstat (limited to 'lib/libedit/chared.h')
-rw-r--r-- | lib/libedit/chared.h | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/lib/libedit/chared.h b/lib/libedit/chared.h index 153fceb..909adac 100644 --- a/lib/libedit/chared.h +++ b/lib/libedit/chared.h @@ -1,3 +1,5 @@ +/* $NetBSD: chared.h,v 1.22 2014/06/18 18:12:28 christos Exp $ */ + /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -30,7 +32,6 @@ * SUCH DAMAGE. * * @(#)chared.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: chared.h,v 1.18 2009/02/15 21:55:23 christos Exp $ * $FreeBSD$ */ @@ -63,7 +64,7 @@ typedef struct c_macro_t { int level; int offset; - char **macro; + Char **macro; } c_macro_t; /* @@ -72,16 +73,16 @@ typedef struct c_macro_t { typedef struct c_undo_t { ssize_t len; /* length of saved line */ int cursor; /* position of saved cursor */ - char *buf; /* full saved text */ + Char *buf; /* full saved text */ } c_undo_t; /* redo for vi */ typedef struct c_redo_t { - char *buf; /* redo insert key sequence */ - char *pos; - char *lim; + Char *buf; /* redo insert key sequence */ + Char *pos; + Char *lim; el_action_t cmd; /* command to redo */ - char ch; /* char that invoked it */ + Char ch; /* char that invoked it */ int count; int action; /* from cv_action() */ } c_redo_t; @@ -91,18 +92,21 @@ typedef struct c_redo_t { */ typedef struct c_vcmd_t { int action; - char *pos; + Char *pos; } c_vcmd_t; /* * Kill buffer for emacs */ typedef struct c_kill_t { - char *buf; - char *last; - char *mark; + Char *buf; + Char *last; + Char *mark; } c_kill_t; +typedef void (*el_zfunc_t)(EditLine *, void *); +typedef const char *(*el_afunc_t)(void *, const char *); + /* * Note that we use both data structures because the user can bind * commands from both editors! @@ -113,13 +117,16 @@ typedef struct el_chared_t { c_redo_t c_redo; c_vcmd_t c_vcmd; c_macro_t c_macro; + el_zfunc_t c_resizefun; + el_afunc_t c_aliasfun; + void * c_resizearg; + void * c_aliasarg; } el_chared_t; #define STRQQ "\"\"" #define isglob(a) (strchr("*[]?", (a)) != NULL) -#define isword(a) (isprint(a)) #define NOP 0x00 #define DELETE 0x01 @@ -140,27 +147,29 @@ typedef struct el_chared_t { #include "fcns.h" -protected int cv__isword(int); -protected int cv__isWord(int); +protected int cv__isword(Int); +protected int cv__isWord(Int); protected void cv_delfini(EditLine *); -protected char *cv__endword(char *, char *, int, int (*)(int)); -protected int ce__isword(int); +protected Char *cv__endword(Char *, Char *, int, int (*)(Int)); +protected int ce__isword(Int); protected void cv_undo(EditLine *); -protected void cv_yank(EditLine *, const char *, int); -protected char *cv_next_word(EditLine*, char *, char *, int, int (*)(int)); -protected char *cv_prev_word(char *, char *, int, int (*)(int)); -protected char *c__next_word(char *, char *, int, int (*)(int)); -protected char *c__prev_word(char *, char *, int, int (*)(int)); +protected void cv_yank(EditLine *, const Char *, int); +protected Char *cv_next_word(EditLine*, Char *, Char *, int, int (*)(Int)); +protected Char *cv_prev_word(Char *, Char *, int, int (*)(Int)); +protected Char *c__next_word(Char *, Char *, int, int (*)(Int)); +protected Char *c__prev_word(Char *, Char *, int, int (*)(Int)); protected void c_insert(EditLine *, int); protected void c_delbefore(EditLine *, int); protected void c_delbefore1(EditLine *); protected void c_delafter(EditLine *, int); protected void c_delafter1(EditLine *); -protected int c_gets(EditLine *, char *, const char *); +protected int c_gets(EditLine *, Char *, const Char *); protected int c_hpos(EditLine *); protected int ch_init(EditLine *); protected void ch_reset(EditLine *, int); +protected int ch_resizefun(EditLine *, el_zfunc_t, void *); +protected int ch_aliasfun(EditLine *, el_afunc_t, void *); protected int ch_enlargebufs(EditLine *, size_t); protected void ch_end(EditLine *); |