123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- /**
- \ingroup tinyrl
- \defgroup tinyrl_history history
- @{
- \brief This class handles the maintenance of a historical list of command lines.
- */
- #ifndef _tinyrl_history_h
- #define _tinyrl_history_h
- #include "lub/c_decl.h"
- #include "lub/types.h"
- _BEGIN_C_DECL
- /**************************************
- * tinyrl_history_entry class interface
- ************************************** */
- typedef struct _tinyrl_history_entry tinyrl_history_entry_t;
- extern const char *
- tinyrl_history_entry__get_line(const tinyrl_history_entry_t *instance);
- extern unsigned
- tinyrl_history_entry__get_index(const tinyrl_history_entry_t *instance);
- /**************************************
- * tinyrl_history class interface
- ************************************** */
- typedef struct _tinyrl_history tinyrl_history_t;
- /**
- * This type is used for the iteration of history entries
- */
- typedef struct _tinyrl_history_iterator tinyrl_history_iterator_t;
- /**
- * CLIENTS MUST NOT USE THESE FIELDS DIRECTLY
- */
- struct _tinyrl_history_iterator
- {
- const tinyrl_history_t *history;
- unsigned offset;
- };
- extern tinyrl_history_t *
- tinyrl_history_new(unsigned stifle);
- extern void
- tinyrl_history_delete(tinyrl_history_t *instance);
- extern void
- tinyrl_history_add (tinyrl_history_t *instance,
- const char *line);
- extern tinyrl_history_entry_t *
- tinyrl_history_getfirst (const tinyrl_history_t *instance,
- tinyrl_history_iterator_t *iter);
- extern tinyrl_history_entry_t *
- tinyrl_history_getlast (const tinyrl_history_t *instance,
- tinyrl_history_iterator_t *iter);
- extern tinyrl_history_entry_t *
- tinyrl_history_getnext(tinyrl_history_iterator_t *iter);
- extern tinyrl_history_entry_t *
- tinyrl_history_getprevious(tinyrl_history_iterator_t *iter);
-
-
- /*
- HISTORY LIST MANAGEMENT
- */
- extern tinyrl_history_entry_t *
- tinyrl_history_remove(tinyrl_history_t *instance,
- unsigned offset);
- extern void
- tinyrl_history_clear(tinyrl_history_t *instance);
- extern void
- tinyrl_history_stifle(tinyrl_history_t *instance,
- unsigned stifle);
- extern unsigned
- tinyrl_history_unstifle(tinyrl_history_t *instance);
- extern bool_t
- tinyrl_history_is_stifled(const tinyrl_history_t *instance);
- /*
- INFORMATION ABOUT THE HISTORY LIST
- */
- extern tinyrl_history_entry_t **
- tinyrl_history_list(const tinyrl_history_t *instance);
- extern tinyrl_history_entry_t *
- tinyrl_history_get(const tinyrl_history_t *instance,
- unsigned offset);
- /*
- * HISTORY EXPANSION
- */
- typedef enum
- {
- tinyrl_history_NO_EXPANSION,
- tinyrl_history_EXPANDED
- } tinyrl_history_expand_t;
- extern tinyrl_history_expand_t
- tinyrl_history_expand(const tinyrl_history_t *instance,
- const char *string,
- char **output);
- _END_C_DECL
- #endif /* _tinyrl_history_h */
- /** @} tinyrl_history */
|