Skip to main content

Crate libedit_sys

Crate libedit_sys 

Source
Expand description

Low-level FFI bindings to the libedit line-editing library (also known as editline, the BSD alternative to GNU readline).

These are raw, unsafe bindings generated by bindgen. They provide direct access to the C API with no ergonomic wrappers.

§Variadic functions

Several core functions are C variadic (el_set, el_get, el_wset, el_wget, history, history_w). Calling C variadic functions from Rust is undefined behavior and may silently corrupt data.

Simple integer/pointer arguments often work by accident, but this is not guaranteed across platforms or compiler versions. To safely use the full libedit API, you have two options:

  1. Write a small C shim that wraps specific variadic call patterns with fixed-argument functions.

  2. Use the companion libedit crate, which provides safe wrappers and includes the necessary C shim.

This crate intentionally keeps the raw variadic bindings available so advanced users are not restricted, but they are use at your own risk.

Structs§

FILE
HistEvent
editline
histeventW
history
historyW
lineinfo
lineinfow
tokenizer
tokenizerW

Constants§

CC_ARGHACK
CC_CURSOR
CC_EOF
CC_ERROR
CC_FATAL
CC_NEWLINE
CC_NORM
CC_REDISPLAY
CC_REFRESH
CC_REFRESH_BEEP
EL_ADDFN
EL_ALIAS_TEXT
EL_BIND
EL_CLIENTDATA
EL_ECHOTC
EL_EDITMODE
EL_EDITOR
EL_GETCFN
EL_GETFP
EL_GETTC
EL_HIST
EL_PREP_TERM
EL_PROMPT
EL_PROMPT_ESC
EL_REFRESH
EL_RESIZE
EL_RPROMPT
EL_RPROMPT_ESC
EL_SAFEREAD
EL_SETFP
EL_SETTC
EL_SETTY
EL_SIGNAL
EL_TELLTC
EL_TERMINAL
EL_UNBUFFERED
H_ADD
H_APPEND
H_CLEAR
H_CURR
H_DEL
H_DELDATA
H_END
H_ENTER
H_FIRST
H_FUNC
H_GETSIZE
H_GETUNIQUE
H_LAST
H_LOAD
H_NEXT
H_NEXT_EVDATA
H_NEXT_EVENT
H_NEXT_STR
H_NSAVE_FP
H_PREV
H_PREV_EVENT
H_PREV_STR
H_REPLACE
H_SAVE
H_SAVE_FP
H_SET
H_SETSIZE
H_SETUNIQUE

Functions§

el_beep
el_cursor
el_deletestr
el_deletestr1
el_end
el_get
el_getc
el_gets
el_init
el_init_fd
el_insertstr
el_line
el_parse
el_push
el_replacestr
el_reset
el_resize
el_set
el_source
el_wget
el_wgetc
el_wgets
el_winsertstr
el_wline
el_wparse
el_wpush
el_wreplacestr
el_wset
history
history_end
history_init
history_w
history_wend
history_winit
tok_end
tok_init
tok_line
tok_reset
tok_str
tok_wend
tok_winit
tok_wline
tok_wreset
tok_wstr

Type Aliases§

EditLine
HistEventW
History
HistoryW
LineInfo
LineInfoW
Tokenizer
TokenizerW
wchar_t