CLISH  0.7.3
history.h
1 
9 #ifndef _tinyrl_history_h
10 #define _tinyrl_history_h
11 
12 #include "lub/c_decl.h"
13 #include "lub/types.h"
14 
15 _BEGIN_C_DECL
16 
17 /**************************************
18  * tinyrl_history_entry class interface
19  ************************************** */
20 typedef struct _tinyrl_history_entry tinyrl_history_entry_t;
21 
22 extern const char *
23  tinyrl_history_entry__get_line(const tinyrl_history_entry_t *instance);
24 extern unsigned
25  tinyrl_history_entry__get_index(const tinyrl_history_entry_t *instance);
26 
27 /**************************************
28  * tinyrl_history class interface
29  ************************************** */
30 typedef struct _tinyrl_history tinyrl_history_t;
31 
40 {
41  const tinyrl_history_t *history;
42  unsigned offset;
43 };
44 
45 
46 extern tinyrl_history_t *
47  tinyrl_history_new(unsigned stifle);
48 
49 extern void
50  tinyrl_history_delete(tinyrl_history_t *instance);
51 
52 extern void
53  tinyrl_history_add (tinyrl_history_t *instance,
54  const char *line);
55 
56 extern tinyrl_history_entry_t *
57  tinyrl_history_getfirst (const tinyrl_history_t *instance,
59 extern tinyrl_history_entry_t *
60  tinyrl_history_getlast (const tinyrl_history_t *instance,
62 
63 extern tinyrl_history_entry_t *
64  tinyrl_history_getnext(tinyrl_history_iterator_t *iter);
65 
66 extern tinyrl_history_entry_t *
67  tinyrl_history_getprevious(tinyrl_history_iterator_t *iter);
68 
69 
70 
71 
72 /*
73 HISTORY LIST MANAGEMENT
74 */
75 extern tinyrl_history_entry_t *
76  tinyrl_history_remove(tinyrl_history_t *instance,
77  unsigned offset);
78 extern void
79  tinyrl_history_clear(tinyrl_history_t *instance);
80 extern void
81  tinyrl_history_stifle(tinyrl_history_t *instance,
82  unsigned stifle);
83 extern unsigned
84  tinyrl_history_unstifle(tinyrl_history_t *instance);
85 extern bool_t
86  tinyrl_history_is_stifled(const tinyrl_history_t *instance);
87 
88  /*
89 INFORMATION ABOUT THE HISTORY LIST
90 */
91 extern tinyrl_history_entry_t **
92  tinyrl_history_list(const tinyrl_history_t *instance);
93 extern tinyrl_history_entry_t *
94  tinyrl_history_get(const tinyrl_history_t *instance,
95  unsigned offset);
96 
97 /*
98  * HISTORY EXPANSION
99  */
100 typedef enum
101 {
102  tinyrl_history_NO_EXPANSION,
103  tinyrl_history_EXPANDED
104 } tinyrl_history_expand_t;
105 
106 extern tinyrl_history_expand_t
107  tinyrl_history_expand(const tinyrl_history_t *instance,
108  const char *string,
109  char **output);
110 
111 _END_C_DECL
112 
113 #endif /* _tinyrl_history_h */
114 
bool_t
Definition: types.h:18
Definition: history.h:39