
Go to the source code of this file.
Data Structures | |
| struct | able_history_s |
| The ABLE history context. More... | |
| struct | line_hist_s |
| ABLE readline history entry. More... | |
Defines | |
| #define | _ABLE_CLIB_ABLE_HISTORY_H 1 |
Typedefs | |
| typedef void * | histdata_t |
| ABLE readline history entry application data. | |
| typedef struct able_history_s | able_history_t |
| ABLE readline history context. | |
| typedef struct line_hist_s | line_hist_t |
| ABLE readline history entry. | |
Functions | |
| able_history_t * | able_history_init (int max_entries) |
| Create a new ABLE history. | |
| void | able_history_free (able_history_t *history) |
| Free an ABLE history context. | |
| line_hist_t * | able_history_add (able_history_t *history, const char *line) |
| Add a string to a history. | |
| void | able_history_limit (able_history_t *history, int age) |
| Remove history entries beyond a certain depth. | |
| line_hist_t * | able_history_next (able_history_t *history, line_hist_t *cur) |
| Obtain the next history entry. | |
| line_hist_t * | able_history_prev (able_history_t *history, line_hist_t *cur) |
| Obtain the previous history entry. | |
| #define _ABLE_CLIB_ABLE_HISTORY_H 1 |
| typedef struct able_history_s able_history_t |
ABLE readline history context.
| typedef void* histdata_t |
ABLE readline history entry application data.
| typedef struct line_hist_s line_hist_t |
ABLE readline history entry.
| line_hist_t* able_history_add | ( | able_history_t * | history, | |
| const char * | line | |||
| ) |
Add a string to a history.
Add a string to a history ensuring that the number of entries in the history does not exceed a maximum depth.
| history | The history to add to. | |
| line | The string to add to the history. |
| void able_history_free | ( | able_history_t * | history | ) |
Free an ABLE history context.
Free a history context and all associated storage.
| history | The history to free. |
| able_history_t* able_history_init | ( | int | max_entries | ) |
Create a new ABLE history.
Create a new ABLE history with the given maximum number of entries.
| max_entries | The maximum number of lines in the history. Positive values limit the depth the history should extend to, 0 disables adding new entries to the history (old entries may be accessed) and a negative value indicates no limit should be placed. |
| void able_history_limit | ( | able_history_t * | history, | |
| int | age | |||
| ) |
Remove history entries beyond a certain depth.
Iterate through a shell history list and remove any entries that are too old.
| history | The history to limit. | |
| age | The maximum age, in entries, to limit to. |
| line_hist_t* able_history_next | ( | able_history_t * | history, | |
| line_hist_t * | cur | |||
| ) |
Obtain the next history entry.
Get the next oldest history entry after the current one. If the current entry is the oldest return that.
| history | The history context of the entry. | |
| cur | The current history entry or NULL to start at the first entry. |
| line_hist_t* able_history_prev | ( | able_history_t * | history, | |
| line_hist_t * | cur | |||
| ) |
Obtain the previous history entry.
Get the next youngest history entry before the current one. If the current entry is the youngest return NULL.
| history | The history context of the entry. | |
| cur | The current history entry. |
1.5.6