isocline
Readline

The basic readline interface. More...

Macros

#define IC_VERSION
 Isocline version: 102 = 1.0.2. More...
 

Functions

char * ic_readline (const char *prompt_text)
 Read input from the user using rich editing abilities. More...
 
char * ic_readline_ex (const char *prompt_text, ic_completer_fun_t *completer, void *completer_arg, ic_highlight_fun_t *highlighter, void *highlighter_arg)
 Read input from the user using rich editing abilities, using a particular completion function and highlighter for this call only. More...
 

Detailed Description

The basic readline interface.

Macro Definition Documentation

◆ IC_VERSION

#define IC_VERSION

Isocline version: 102 = 1.0.2.

Function Documentation

◆ ic_readline()

char* ic_readline ( const char *  prompt_text)

Read input from the user using rich editing abilities.

Parameters
prompt_textThe prompt text, can be NULL for the default (""). The displayed prompt becomes prompt_text followed by the prompt_marker ("> ").
Returns
the heap allocated input on succes, which should be freed by the caller.
Returns NULL on error, or if the user typed ctrl+d or ctrl+c.

If the standard input (stdin) has no editing capability (like a dumb terminal (e.g. TERM=dumb), running in a debuggen, a pipe or redirected file, etc.) the input is read directly from the input stream up to the next line without editing capability. See also ic_set_prompt_marker(), ic_style_def()

See also
ic_set_prompt_marker(), ic_style_def()

◆ ic_readline_ex()

char* ic_readline_ex ( const char *  prompt_text,
ic_completer_fun_t completer,
void *  completer_arg,
ic_highlight_fun_t highlighter,
void *  highlighter_arg 
)

Read input from the user using rich editing abilities, using a particular completion function and highlighter for this call only.

both can be NULL in which case the defaults are used.

See also
ic_readline(), ic_set_prompt_marker(), ic_set_default_completer(), ic_set_default_highlighter().