Updated libedit to NetBSD upstream
Note: This unconditionally assumes wchar_t support. May need revision if some platforms prove problematic.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: histedit.h,v 1.47 2010/08/28 15:44:59 christos Exp $ */
|
||||
/* $NetBSD: histedit.h,v 1.56 2016/04/19 19:50:53 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@@ -43,10 +43,6 @@
|
||||
#define LIBEDIT_MAJOR 2
|
||||
#define LIBEDIT_MINOR 11
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -88,6 +84,8 @@ typedef struct lineinfo {
|
||||
* Initialization, cleanup, and resetting
|
||||
*/
|
||||
EditLine *el_init(const char *, FILE *, FILE *, FILE *);
|
||||
EditLine *el_init_fd(const char *, FILE *, FILE *, FILE *,
|
||||
int, int, int);
|
||||
void el_end(EditLine *);
|
||||
void el_reset(EditLine *);
|
||||
|
||||
@@ -143,8 +141,8 @@ unsigned char _el_fn_complete(EditLine *, int);
|
||||
#define EL_ECHOTC 7 /* , const Char *, ..., NULL); set */
|
||||
#define EL_SETTY 8 /* , const Char *, ..., NULL); set */
|
||||
#define EL_ADDFN 9 /* , const Char *, const Char, set */
|
||||
/* el_func_t); */
|
||||
#define EL_HIST 10 /* , hist_fun_t, const ptr_t); set */
|
||||
/* el_func_t); */
|
||||
#define EL_HIST 10 /* , hist_fun_t, const void *); set */
|
||||
#define EL_EDITMODE 11 /* , int); set/get */
|
||||
#define EL_RPROMPT 12 /* , prompt_func); set/get */
|
||||
#define EL_GETCFN 13 /* , el_rfunc_t); set/get */
|
||||
@@ -158,6 +156,7 @@ unsigned char _el_fn_complete(EditLine *, int);
|
||||
#define EL_PROMPT_ESC 21 /* , prompt_func, Char); set/get */
|
||||
#define EL_RPROMPT_ESC 22 /* , prompt_func, Char); set/get */
|
||||
#define EL_RESIZE 23 /* , el_zfunc_t, void *); set */
|
||||
#define EL_ALIAS_TEXT 24 /* , el_afunc_t, void *); set */
|
||||
|
||||
#define EL_BUILTIN_GETCFN (NULL)
|
||||
|
||||
@@ -226,6 +225,7 @@ int history(History *, HistEvent *, int, ...);
|
||||
#define H_NEXT_EVDATA 23 /* , const int, histdata_t *); */
|
||||
#define H_DELDATA 24 /* , int, histdata_t *);*/
|
||||
#define H_REPLACE 25 /* , const char *, histdata_t); */
|
||||
#define H_SAVE_FP 26 /* , FILE *); */
|
||||
|
||||
|
||||
|
||||
@@ -249,20 +249,9 @@ int tok_str(Tokenizer *, const char *,
|
||||
/*
|
||||
* Begin Wide Character Support
|
||||
*/
|
||||
#ifdef __linux__
|
||||
/* Apparently we need _GNU_SOURCE defined to get access to wcsdup on Linux */
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <wchar.h>
|
||||
#include <wctype.h>
|
||||
|
||||
/*
|
||||
* Wide character versions
|
||||
*/
|
||||
|
||||
/*
|
||||
* ==== Editing ====
|
||||
*/
|
||||
@@ -272,6 +261,8 @@ typedef struct lineinfow {
|
||||
const wchar_t *lastchar;
|
||||
} LineInfoW;
|
||||
|
||||
typedef int (*el_rfunc_t)(EditLine *, wchar_t *);
|
||||
|
||||
const wchar_t *el_wgets(EditLine *, int *);
|
||||
int el_wgetc(EditLine *, wchar_t *);
|
||||
void el_wpush(EditLine *, const wchar_t *);
|
||||
@@ -281,6 +272,7 @@ int el_wparse(EditLine *, int, const wchar_t **);
|
||||
int el_wset(EditLine *, int, ...);
|
||||
int el_wget(EditLine *, int, ...);
|
||||
|
||||
int el_cursor(EditLine *, int);
|
||||
const LineInfoW *el_wline(EditLine *);
|
||||
int el_winsertstr(EditLine *, const wchar_t *);
|
||||
#define el_wdeletestr el_deletestr
|
||||
|
Reference in New Issue
Block a user