~ubuntu-branches/ubuntu/warty/lynx/warty-security

« back to all changes in this revision

Viewing changes to src/LYStructs.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-09-16 12:14:10 UTC
  • Revision ID: james.westby@ubuntu.com-20040916121410-cz1gu92c4nqfeyrg
Tags: upstream-2.8.5
ImportĀ upstreamĀ versionĀ 2.8.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef LYSTRUCTS_H
 
2
#define LYSTRUCTS_H
 
3
 
 
4
#ifndef HTANCHOR_H
 
5
#include <HTAnchor.h>
 
6
#endif /* HTANCHOR_H */
 
7
 
 
8
typedef struct {
 
9
    char *hl_text;
 
10
    short hl_x;
 
11
} HiliteInfo;
 
12
 
 
13
typedef struct {
 
14
    HiliteInfo *hl_info;
 
15
    HiliteInfo hl_base;
 
16
    short hl_len;              /* number of strings in this struct */
 
17
} HiliteList;
 
18
 
 
19
typedef struct {
 
20
    char *lname;
 
21
    char *target;
 
22
    char *l_hightext;
 
23
    char *l_hightext2;
 
24
    int l_hightext2_offset;
 
25
    BOOL inUnderline;   /* TRUE when this link is in underlined context. */
 
26
    int lx;
 
27
    int ly;
 
28
    int type;           /* Type of link, Forms, WWW, etc. */
 
29
    int anchor_number;  /* The anchor number within the HText structure.  */
 
30
    int anchor_line_num;/* The anchor line number in the HText structure. */
 
31
    HiliteList list;
 
32
    struct _FormInfo *l_form;   /* Pointer to form info. */
 
33
} LinkInfo;
 
34
extern LinkInfo links[MAXLINKS];
 
35
extern int nlinks;
 
36
 
 
37
typedef struct {
 
38
    /* FIXME: see DocAddress */
 
39
    char * title;
 
40
    char * address;
 
41
    bstring * post_data;
 
42
    char * post_content_type;
 
43
    char * bookmark;
 
44
    BOOL   isHEAD;
 
45
    BOOL   safe;
 
46
 
 
47
    int    link;
 
48
    int    line;
 
49
    BOOL   internal_link;       /* whether doc was reached via an internal
 
50
                                 (fragment) link. - kw */
 
51
#ifdef USE_COLOR_STYLE
 
52
    char * style;
 
53
#endif
 
54
} DocInfo;
 
55
 
 
56
#ifndef HTFORMS_H
 
57
#include <HTForms.h>
 
58
#endif /* HTFORMS_H */
 
59
 
 
60
typedef struct {
 
61
    DocInfo hdoc;
 
62
    int    intern_seq_start;    /* indicates which element on the history
 
63
                                   is the start of this sequence of
 
64
                                   "internal links", otherwise -1 */
 
65
} HistInfo;
 
66
 
 
67
#define HDOC(n) history[n].hdoc
 
68
 
 
69
extern int Visited_Links_As;
 
70
 
 
71
#define VISITED_LINKS_AS_FIRST_V 0
 
72
#define VISITED_LINKS_AS_TREE    1
 
73
#define VISITED_LINKS_AS_LATEST  2
 
74
#define VISITED_LINKS_REVERSE    4
 
75
 
 
76
typedef struct _VisitedLink {
 
77
    char * title;
 
78
    char * address;
 
79
    int level;
 
80
    struct _VisitedLink *next_tree;
 
81
    struct _VisitedLink *prev_latest;
 
82
    struct _VisitedLink *next_latest;
 
83
    struct _VisitedLink *prev_first;
 
84
} VisitedLink;
 
85
 
 
86
extern HistInfo history[MAXHIST];
 
87
extern int nhist;
 
88
 
 
89
/******************************************************************************/
 
90
 
 
91
typedef struct _lynx_list_item_type {
 
92
    struct _lynx_list_item_type *next;  /* the next item in the linked list */
 
93
    char *name;                         /* a description of the item */
 
94
    char *command;                      /* the command to execute */
 
95
    int  always_enabled;                /* a constant to tell whether or
 
96
                                        * not to disable the printer
 
97
                                        * when the no_print option is on
 
98
                                        */
 
99
    /* HTML lists: */
 
100
    BOOL override_primary_action;       /* whether primary action will be
 
101
                                        * overridden by this - e.g. this allows
 
102
                                        * invoking user's MUA when mailto: link
 
103
                                        * is activated using normal "activate"
 
104
                                        * command. This field is only examined
 
105
                                        * by code that handles EXTERNAL command.
 
106
                                        */
 
107
    /* PRINTER lists: */
 
108
    int pagelen;                        /* an integer to store the printer's
 
109
                                        * page length
 
110
                                        */
 
111
} lynx_list_item_type;
 
112
 
 
113
extern lynx_list_item_type *printers;
 
114
 
 
115
/* for download commands */
 
116
extern lynx_list_item_type *downloaders;
 
117
 
 
118
/* for upload commands */
 
119
extern lynx_list_item_type *uploaders;
 
120
 
 
121
#ifdef USE_EXTERNALS
 
122
/* for external commands */
 
123
extern lynx_list_item_type *externals;
 
124
#endif
 
125
 
 
126
/******************************************************************************/
 
127
 
 
128
typedef struct
 
129
{
 
130
    CONST char *name;
 
131
    int value;
 
132
}
 
133
Config_Enum;
 
134
 
 
135
typedef int (*ParseFunc) PARAMS((char *));
 
136
 
 
137
#define ParseUnionMembers \
 
138
        lynx_list_item_type** add_value; \
 
139
        BOOLEAN * set_value; \
 
140
        int *     int_value; \
 
141
        char **   str_value; \
 
142
        ParseFunc fun_value; \
 
143
        long      def_value
 
144
 
 
145
typedef union {
 
146
        ParseUnionMembers;
 
147
} ParseUnion;
 
148
 
 
149
#ifdef  PARSE_DEBUG
 
150
#define ParseUnionPtr Config_Type *
 
151
#define ParseUnionOf(tbl) tbl
 
152
#define ParseData ParseUnionMembers
 
153
#define UNION_ADD(v) &v,  0,  0,  0,  0,  0
 
154
#define UNION_SET(v)  0, &v,  0,  0,  0,  0
 
155
#define UNION_INT(v)  0,  0, &v,  0,  0,  0
 
156
#define UNION_STR(v)  0,  0,  0, &v,  0,  0
 
157
#define UNION_ENV(v)  0,  0,  0,  v,  0,  0
 
158
#define UNION_FUN(v)  0,  0,  0,  0,  v,  0
 
159
#define UNION_DEF(v)  0,  0,  0,  0,  0,  v
 
160
#else
 
161
#define ParseUnionPtr ParseUnion *
 
162
#define ParseUnionOf(tbl) (ParseUnionPtr)(&(tbl->value))
 
163
#define ParseData long value
 
164
#define UNION_ADD(v) (long)&(v)
 
165
#define UNION_SET(v) (long)&(v)
 
166
#define UNION_INT(v) (long)&(v)
 
167
#define UNION_STR(v) (long)&(v)
 
168
#define UNION_ENV(v) (long) (v)
 
169
#define UNION_FUN(v) (long) (v)
 
170
#define UNION_DEF(v) (long) (v)
 
171
#endif
 
172
 
 
173
#endif /* LYSTRUCTS_H */