File: HTHistory.h

package info (click to toggle)
cern-httpd 3.0A-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 5,392 kB
  • ctags: 6,554
  • sloc: ansic: 37,902; makefile: 1,746; perl: 535; csh: 167; sh: 143
file content (123 lines) | stat: -rw-r--r-- 3,429 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*                                                                  History module for libwww
                                        HTHISTORY
                                             
   This is a simple history module for a WWW client.  It keeps a linear history, with
   destructive backtrack, and list sequencing (previous, next) operations.
   
   If you are building a client, you don't have to use this: just don't call it.  This
   module is not used by any other modules in the libwww, so if you don't refer to it you
   don't get it in your linked application.
   
 */
#ifndef HTHISTORY_H
#define HTHISTORY_H

#include "HTFormat.h"
#include "HTAnchor.h"

#ifdef SHORT_NAMES
#define HTHistory_record                HTHiReco
#define HTHistory_backtrack             HTHiBack
#define HTHistory_canBacktrack          HTHiCaBa
#define HTHistory_moveBy                HTHiMoBy
#define HTHistory_canMoveBy             HTHiCaMo
#define HTHistory_read                  HTHiRead
#define HTHistory_recall                HTHiReca
#define HTHistory_count                 HTHiCoun
#define HTHistory_leavingFrom           HTHiLeFr
#endif

/*                              Navigation
**                              ==========
*/

/*              Record the jump to an anchor
**              ----------------------------
*/

extern void HTHistory_record
  PARAMS(
    (HTAnchor * destination)
  );

/*              Go back in history (find the last visited node)
**              ------------------
*/

extern HTAnchor * HTHistory_backtrack
  NOPARAMS;  /* FIXME: Should we add a `sticky' option ? */

extern BOOL HTHistory_canBacktrack
  NOPARAMS;

/*              Browse through references in the same parent node
**              -------------------------------------------------
**
**      Take the n-th child's link after or before the one we took to get here.
**      Positive offset means go towards most recently added children.
*/

extern HTAnchor * HTHistory_moveBy
  PARAMS(
     (int offset)
     );

extern BOOL HTHistory_canMoveBy
  PARAMS(
     (int offset)
     );

#define HTHistory_next (HTHistory_moveBy (+1))
#define HTHistory_canNext (HTHistory_canMoveBy (+1))
#define HTHistory_previous (HTHistory_moveBy (-1))
#define HTHistory_canPrevious (HTHistory_canMoveBy (-1))


/*                              Retrieval
**                              =========
*/

/*              Read numbered visited anchor (1 is the oldest)
**              ----------------------------
*/

extern HTAnchor * HTHistory_read
  PARAMS(
    (int number)
  );

/*              Recall numbered visited anchor (1 is the oldest)
**              ------------------------------
**      This reads the anchor and stores it again in the list, except if last.
*/

extern HTAnchor * HTHistory_recall
  PARAMS(
    (int number)
  );

/*              Number of Anchors stored
**              ------------------------
**
**      This is needed in order to check the validity of certain commands
**      for menus, etc.
(not needed for now. Use canBacktrack, etc.)
extern int HTHistory_count NOPARAMS;
*/

/*              Change last history entry
**              -------------------------
**
**      Sometimes we load a node by one anchor but leave by a different
**      one, and it is the one we left from which we want to remember.
*/
extern void HTHistory_leavingFrom
  PARAMS(
    (HTAnchor * anchor)
  );

#endif /* HTHISTORY_H */

/*

    */