File: killfile.h

package info (click to toggle)
xrn 9.02-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,784 kB
  • ctags: 3,047
  • sloc: ansic: 24,689; makefile: 2,240; yacc: 888; sh: 274; lex: 92; perl: 35; awk: 31; csh: 13
file content (101 lines) | stat: -rw-r--r-- 2,425 bytes parent folder | download | duplicates (4)
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
#ifndef _KILLFILE_H
#define _KILLFILE_H

#define MAX_KILL_ENTRY_LENGTH	512
#define MAX_KILL_PATTERN_LENGTH (MAX_KILL_ENTRY_LENGTH- \
				 1-			/* first slash */ \
				 1-			/* second slash */ \
				 1-			/* "h" option */ \
				 20-			/* "t" option and value */ \
				 20-			/* "u" option and value */ \
				 1-			/* colon */ \
				 1-			/* command */ \
				 2)			/* newline and null */
#define MAX_KILL_PATTERN_VALUE_LENGTH (MAX_KILL_PATTERN_LENGTH- \
				       13) /* "^Newsgroups: " */

#define KILL_SESSION	-1
#define KILL_GLOBAL	0
#define KILL_LOCAL	1

#define KILL_ENTRY	(1<<0)
#define KILL_INCLUDE	(1<<1)
#define KILL_OTHER	(1<<2)

#define KILL_SUBJECT 	(1<<0)
#define KILL_AUTHOR  	(1<<1)
#define KILL_NEWSGROUPS	(1<<2)
#define KILL_DATE	(1<<3)
#define KILL_ID		(1<<4)
#define KILL_REFERENCES	(1<<5)
#define KILL_XREF	(1<<6)
#define KILL_APPROVED	(1<<7)

typedef unsigned int kill_check_flag_t;

#define KILL_JUNK	(1<<0)
#define KILL_MARK	(1<<1)
#define KILL_SAVE	(1<<2)
#define KILL_SUBTHREAD	(1<<3)
#define KILL_THREAD	(1<<4)

typedef union _kill_entry  {
  char type;
  struct {
    char type;
    char *value;
  } any;
  struct {
    char type;
    char *value;
    char *pattern;
#ifdef POSIX_REGEX
    regex_t reStruct;
#else
    char *reStruct;
#endif /* POSIX_REGEX */
    kill_check_flag_t check_flags;
    char action_flags;
    int timeout;
    time_t last_used;
  } entry;
  struct {
    char type;
    char *value;
    char *operand;
    char is_ngfile;
    struct _kill_file *kf;
  } include;
  struct {
    char type;
    char *value;
  } other;
} kill_entry;

typedef struct _kill_file {
  time_t mod_time;
  char *file_name;
  art_num thru;
  int count;
  kill_entry *entries;
  struct _kill_file *cur_sub_kf;
  int cur_entry;
  char flags;
} kill_file;

typedef void *kill_file_iter_handle;

#define KF_SEEN		(1<<0)
#define KF_CHANGED	(1<<1)

void read_global_kill_file _ARGUMENTS((struct newsgroup *));
void read_local_kill_file _ARGUMENTS((struct newsgroup *));
kill_entry *kill_file_iter _ARGUMENTS((struct newsgroup *, int mode,
				       kill_file_iter_handle *handle));
void write_kill_file _ARGUMENTS((struct newsgroup *, int mode));
Boolean has_kill_files _ARGUMENTS((struct newsgroup *));
void add_kill_entry _ARGUMENTS((struct newsgroup *newsgroup, int mode,
				char *field, char *regexp));
void kill_update_last_used _ARGUMENTS((kill_file *, kill_entry *));

#endif /* ! _KILLFILE_H */