summaryrefslogtreecommitdiffstats
path: root/src/LYCookie.h
blob: ecbf930165b386b27c3395baffe7ad5a558af07a (plain)
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
/* $LynxId: LYCookie.h,v 1.20 2011/06/07 08:29:39 tom Exp $ */
#ifndef LYCOOKIES_H
#define LYCOOKIES_H

#ifndef HTUTILS_H
#include <HTUtils.h>
#endif

#include <HTList.h>

#ifdef __cplusplus
extern "C" {
#endif
    typedef enum {
	ACCEPT_ALWAYS = 0
	,REJECT_ALWAYS
	,QUERY_USER
    } behaviour_t;

    typedef enum {
	INVCHECK_QUERY = 0
	,INVCHECK_STRICT
	,INVCHECK_LOOSE
    } invcheck_behaviour_t;

    typedef enum {
	FLAG_ACCEPT_ALWAYS = 0
	,FLAG_REJECT_ALWAYS
	,FLAG_QUERY_USER
	,FLAG_FROM_FILE
	,FLAG_INVCHECK_QUERY
	,FLAG_INVCHECK_STRICT
	,FLAG_INVCHECK_LOOSE
    } cookie_domain_flags;

    struct _domain_entry {
	char *domain;		/* Domain for which these cookies are valid */
	char *ddomain;		/* Domain without leading "." */
	behaviour_t bv;
	invcheck_behaviour_t invcheck_bv;
	HTList *cookie_list;
    };
    typedef struct _domain_entry domain_entry;

    extern void LYSetCookie(const char *SetCookie,
			    const char *SetCookie2,
			    const char *address);
    extern char *LYAddCookieHeader(char *hostname,
				   char *partialpath,
				   int port,
				   int secure);
    extern void LYStoreCookies(char *cookie_file);
    extern void LYLoadCookies(char *cookie_file);
    extern void LYConfigCookies(void);

#ifdef __cplusplus
}
#endif
#endif				/* LYCOOKIES_H */