To use the readline functions, you need to install libreadline. You can find libreadline on the home page of the GNU Readline project, at » https://tiswww.case.edu/php/chet/readline/rltop.html. It's maintained by Chet Ramey, who's also the author of Bash.
You can also use these functions with the libedit library, a non-GPL replacement for the readline library. The libedit library is BSD licensed and available for download from » http://www.thrysoee.dk/editline/.
The two libraries do not provide the same features, so some functions are
absent from some builds. The functions driving the callback interface,
readline_callback_handler_install(),
readline_callback_handler_remove(),
readline_callback_read_char(),
readline_redisplay() and
readline_on_new_line(), are only present when the
underlying library provides them, and are absent on Windows. Calling an
absent function throws an Error.
function_exists() tests for a given function, and the
READLINE_LIB constant reports which library is in use.