Cast to (const char *) in strrchr calls
[elinks.git] / src / session / history.h
blobed28bf4ae3e868f44f0bdb6f1677923b8c67ec99
1 #ifndef EL__SESSION_HISTORY_H
2 #define EL__SESSION_HISTORY_H
4 struct location;
5 struct session;
7 struct ses_history {
8 /** The first list item is the first visited location. The last list
9 * item is the last location in the unhistory. The #current location is
10 * included in this list. */
11 LIST_OF(struct location) history;
13 /** The current location. This is moveable pivot pointing somewhere at
14 * the middle of #history. */
15 struct location *current;
19 void create_history(struct ses_history *history);
20 void destroy_history(struct ses_history *history);
21 void clean_unhistory(struct ses_history *history);
23 void add_to_history(struct ses_history *history, struct location *loc);
24 void del_from_history(struct ses_history *history, struct location *loc);
27 /** Note that this function is dangerous, and its results are sort of
28 * unpredictable. If the document is cached and is permitted to be fetched from
29 * the cache, the effect of this function is immediate and you end up with the
30 * new location being cur_loc(). BUT if the cache entry cannot be used, the
31 * effect is delayed to the next main loop iteration, as the TASK_HISTORY
32 * session task (ses_history_move()) is executed not now but in the bottom-half
33 * handler. So, you MUST NOT depend on cur_loc() having an arbitrary value
34 * after call to this function (or the regents go_(un)back(), of course). */
35 void go_history(struct session *ses, struct location *loc);
37 /** Move back -@a n times if @a n is negative, forward @a n times if
38 * positive. */
39 void go_history_by_n(struct session *ses, int n);
41 void go_back(struct session *ses);
42 void go_unback(struct session *ses);
44 void ses_history_move(struct session *ses);
46 #endif