include/readline/able_readline.h File Reference

#include <readline/able_history.h>

Include dependency graph for able_readline.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define _ABLE_CLIB_ABLE_READLINE_H   1

Functions

char * able_readline (able_history_t *history, const char *prompt)
 Reads input from user with emacs style line editing.
char * able_editline (struct able_history_s *history, const char *prompt, char *text)
 Reads input from user with emacs style line editing.
char * simple_readline (const char *prompt, int silent, int timeout, unsigned char delim, int max_len)
 Read a line of input from user.


Define Documentation

#define _ABLE_CLIB_ABLE_READLINE_H   1


Function Documentation

char* able_editline ( struct able_history_s history,
const char *  prompt,
char *  text 
)

Reads input from user with emacs style line editing.

Obtains input from the user with full emacs style editing, allowing for:

  • in place editing and deletion.
  • ctrl-u clears to line start.
  • ctrl-k clear to line end.
  • ctrl-a to move to line start.
  • ctrl-e to move to line end.
  • ctrl-l to redraw the line.
  • ctrl-p and ANSI up arrow sequence to go back through line history.
  • ctrl-n and ANSI down arrow to go forwards through history.

This interface allows for text to be given at the beginning of editing instead of an empty line.

Parameters:
history An ABLE history context if history is to be used or NULL to disable history processing.
prompt A string which will be used as the prompt or NULL if no prompt is required.
text A string to start editing or NULL if none is required. This string is manipulated by able_editline and must be a heap block returned by malloc or calloc. In a similar manner to realloc only the returned string may be relied upon and the passed in pointer should be discarded.
Returns:
The user's input in a string, the caller owns the storage and is responsible for freeing the string.

char* able_readline ( able_history_t history,
const char *  prompt 
)

Reads input from user with emacs style line editing.

Obtains input from the user with full emacs style editing, allowing for:

  • in place editing and deletion.
  • ctrl-u clears to line start.
  • ctrl-k clear to line end.
  • ctrl-a to move to line start.
  • ctrl-e to move to line end.
  • ctrl-l to redraw the line.
  • ctrl-p and ANSI up arrow sequence to go back through line history.
  • ctrl-n and ANSI down arrow to go forwards through history.

Parameters:
history An ABLE history context if history is to be used or NULL to disable history processing.
prompt A string which will be used as the prompt or NULL if no prompt is required.
Returns:
The user's input in a string, the caller owns the storage and is responsible for freeing the string.

char* simple_readline ( const char *  prompt,
int  silent,
int  timeout,
unsigned char  delim,
int  max_len 
)

Read a line of input from user.

Obtains input from the user with delete support but no fancy editing or history. The display of user input and termination delimiter is selectable.

Parameters:
prompt The prompt to display to the user or NULL if no prompt is required.
silent A flag used to inhibit echoing of the user input. Non zero to inhibit.
timeout An input timeout in seconds.
delim The character used to terminate input. Typically '
'
max_len The maximum length of input accepted.
Returns:
A null terminated string of the user input or NULL for a timeout, the caller owns the storage and is responsible for freeing the string.


Generated on Tue Jan 20 14:28:57 2009 for ABLE LIBC by  doxygen 1.5.6