1 /*
2  *	(c) Copyright 1990, Kim Fabricius Storm.  All rights reserved.
3  *      Copyright (c) 1996-2003 Michael T Pins.  All rights reserved.
4  *
5  *	Memory handling
6  */
7 
8 #ifndef _NN_ARTICLES_H
9 #define _NN_ARTICLES_H 1
10 
11 /* article headers */
12 
13 article_number  n_articles;
14 article_header **articles;
15 
16 
17 typedef struct thunk {
18     char           *this_thunk;
19     struct thunk   *next_thunk;
20     long            thunk_size;
21 }               thunk;
22 
23 
24 typedef struct {
25     thunk          *sm_cur_t;
26     int             sm_size;
27     char           *sm_next;
28 }               string_marker;
29 
30 
31 typedef struct {
32     string_marker   mm_string;
33     thunk          *mm_cur_t;
34     int             mm_size;
35     article_header *mm_next;
36     long            mm_nart;
37 }               memory_marker;
38 
39 
40 article_header *alloc_art(void);
41 char           *alloc_str(int);
42 void            free_memory(void);
43 void            mark_str(string_marker *);
44 void            release_str(string_marker *);
45 void            mark_memory(memory_marker *);
46 void            release_memory(memory_marker *);
47 void            merge_memory(void);
48 void            add_article(article_header *);
49 int             access_group(register group_header *, article_number, article_number, register flag_type, char *);
50 
51 
52 /* flags to access_group */
53 
54 #define	ACC_ALSO_CROSS_POSTINGS	FLAG(1)	/* */
55 #define	ACC_DONT_SORT_ARTICLES	FLAG(2)	/* */
56 #define	ACC_DONT_SPLIT_DIGESTS	FLAG(3)	/* only full digest */
57 #define	ACC_ALSO_FULL_DIGEST	FLAG(4)	/* also full digest */
58 #define ACC_EXTRA_ARTICLES	FLAG(5)	/* add to current menu */
59 #define ACC_ALSO_READ_ARTICLES	FLAG(6)	/* */
60 #define ACC_ONLY_READ_ARTICLES	FLAG(7)	/* unread are already collected */
61 #define ACC_MERGED_MENU		FLAG(8)	/* set a_group field */
62 #define ACC_ORIG_NEWSRC		FLAG(9)	/* get previously unread articles */
63 #define ACC_VALIDATE_ONLY	FLAG(10)	/* don't save articles */
64 #define ACC_SPEW_MODE		FLAG(11)	/* */
65 #define ACC_ON_SENDER		FLAG(12)	/* match on sender (only) */
66 #define ACC_ON_SUBJECT		FLAG(13)	/* match on subject (also) */
67 #define ACC_DO_KILL		FLAG(14)	/* do auto-kill/select */
68 #define	ACC_PARSE_VARIABLES	FLAG(15)	/* kill, split, etc. */
69 #define ACC_MERGED_NEWSRC	FLAG(16)	/* merge orig and cur .newsrc */
70 #define ACC_ALSO_UNSUB_GROUPS	FLAG(17)	/* kill x-posts based on
71 						 * unsub also */
72 
73 #ifdef ART_GREP
74 #define ACC_ON_GREP_UNREAD	FLAG(18)	/* grep article body, unread
75 						 * articles */
76 #define ACC_ON_GREP_ALL		FLAG(19)	/* grep article body, all
77 						 * articles */
78 #endif				/* ART_GREP */
79 
80 #endif				/* _NN_ARTICLES_H */
81