include/readline/readline.h File Reference

#include <readline/able_readline.h>

Include dependency graph for readline.h:

Go to the source code of this file.

Defines

#define _ABLE_CLIB_READLINE_H   1

Functions

char * readline (const char *prompt)
 Readline obtains input from a user.


Define Documentation

#define _ABLE_CLIB_READLINE_H   1


Function Documentation

char* readline ( const char *  prompt  ) 

Readline obtains input from a user.

This implementation uses the ABLE able_readline function to do its work.

Readline prints a prompt and then reads and returns a single line of text from the user. If prompt is NULL or the empty string, no prompt is displayed. The line returned is allocated with malloc the caller should free the line when it has finished with it.

If readline encounters an EOF while reading the line, and the line is empty at that point, then (char *)NULL is returned. Otherwise, the line is ended just as if a newline had been typed.

If you want the user to have access to the line later, (with C-p for example), you must call add_history to save the line away in a history list of such lines.

Parameters:
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.


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