10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
12 /** A readline history entry */
13 struct readline_history_entry {
14 /** Persistent copy of string */
16 /** Temporary copy of string
18 * The temporary copy exists only during the call to
24 /** Maximum depth of a readline history buffer
26 * Must be one less than a power of two.
28 #define READLINE_HISTORY_MAX_DEPTH ( ( 1 << 3 ) - 1 )
30 /** A readline history buffer */
31 struct readline_history {
34 * This is a circular buffer, with entries in chronological
35 * order. The "next" entry is always empty except during a
38 struct readline_history_entry entries[READLINE_HISTORY_MAX_DEPTH + 1];
39 /** Position of next entry within buffer
41 * This is incremented monotonically each time an entry is
42 * added to the buffer.
45 /** Current depth within history buffer
47 * This is valid only during the call to readline()
52 extern void history_free ( struct readline_history *history );
53 extern int readline_history ( const char *prompt, const char *prefill,
54 struct readline_history *history, char **line );
55 extern char * __malloc readline ( const char *prompt );
57 #endif /* _READLINE_H */