1 /*
2  This file is part of SLRN.
3 
4  Copyright (c) 1994, 1999, 2007-2016 John E. Davis <jed@jedsoft.org>
5  Copyright (c) 2001-2006 Thomas Schultz <tststs@gmx.de>
6 
7  This program is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the Free
9  Software Foundation; either version 2 of the License, or (at your option)
10  any later version.
11 
12  This program is distributed in the hope that it will be useful, but WITHOUT
13  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15  more details.
16 
17  You should have received a copy of the GNU General Public License along
18  with this program; if not, write to the Free Software Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 */
21 
22 #include "ranges.h"
23 
24 extern int slrn_select_group_mode (void);
25 extern void slrn_group_quit (void);
26 extern int slrn_add_group (char *);
27 extern void slrn_select_next_group (void);
28 extern void slrn_select_prev_group (void);
29 extern int slrn_group_select_group (void);
30 extern void slrn_list_all_groups (int);
31 extern void slrn_hide_groups (int);
32 extern int slrn_read_newsrc (int);
33 extern int slrn_write_newsrc (int);
34 extern void slrn_mark_articles_as_read (char *, NNTP_Artnum_Type, NNTP_Artnum_Type);
35 extern int slrn_get_new_groups (int);
36 extern void slrn_init_group_mode (void);
37 extern void slrn_get_group_descriptions (void);
38 extern int slrn_read_group_descriptions (void);
39 extern int slrn_set_group_format (unsigned int, char *);
40 extern SLKeyMap_List_Type *Slrn_Group_Keymap;
41 extern void slrn_post_cmd (void);
42 extern unsigned int slrn_group_up_n (unsigned int);
43 extern unsigned int slrn_group_down_n (unsigned int);
44 extern int slrn_group_search (char *, int);
45 extern void slrn_catchup_group (void);
46 extern void slrn_uncatchup_group (void);
47 extern void slrn_hide_current_group (void);
48 
49 extern void slrn_intr_get_group_order (void);
50 extern void slrn_intr_set_group_order (void);
51 
52 typedef struct Slrn_Group_Type
53 {
54    struct Slrn_Group_Type *next;
55    struct Slrn_Group_Type *prev;
56    unsigned int flags;
57 #define GROUP_UNSUBSCRIBED		0x0001
58 #define GROUP_NEW_GROUP_FLAG		0x0002
59 #define GROUP_HARMLESS_FLAGS_MASK 	0x00FF
60 #define GROUP_HIDDEN			0x0100
61 #define GROUP_TOUCHED			0x0200
62 #define GROUP_PROCESSED			0x0400
63 
64    char *group_name;
65    unsigned long hash;
66    struct Slrn_Group_Type *hash_next;
67 
68    Slrn_Range_Type range;		       /* the first range corresponds to
69 						* what the server has.  next ranges
70 						* correspond to what has been read.
71 						*/
72    Slrn_Range_Type *requests; /* body requests for true offline mode
73 			       * note that the first one is also malloced here! */
74    int requests_loaded;	/* We load these each time we enter article mode in case
75 			 * slrnpull ran in the background */
76 
77    NNTP_Artnum_Type unread;
78    char *descript;		       /* description of the group -- malloced, could be NULL */
79 }
80 Slrn_Group_Type;
81 
82 extern Slrn_Group_Type *Slrn_Group_Current_Group;
83 extern void slrn_group_recount_unread (Slrn_Group_Type *);
84 
85 extern char *Slrn_Group_Help_Line;
86 extern char *Slrn_Group_Status_Line;
87 
88 extern int Slrn_Groups_Dirty;
89 extern int *Slrn_Prefix_Arg_Ptr;
90 extern int Slrn_No_Backups;
91 extern int Slrn_No_Autosave;
92 extern int Slrn_Unsubscribe_New_Groups;
93 extern int Slrn_Check_New_Groups;
94 extern int Slrn_List_Active_File;
95 extern int Slrn_Query_Group_Cutoff;
96 extern int Slrn_Write_Newsrc_Flags;
97 extern int Slrn_Display_Cursor_Bar;
98 extern int Slrn_Drop_Bogus_Groups;
99 extern int Slrn_Max_Queued_Groups;
100