1 /*
2  * $Id: remtype.h 764 2007-10-23 23:44:49Z hubert@u.washington.edu $
3  *
4  * ========================================================================
5  * Copyright 2013-2021 Eduardo Chappa
6  * Copyright 2006 University of Washington
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * ========================================================================
15  */
16 
17 #ifndef PITH_REMTYPE_INCLUDED
18 #define PITH_REMTYPE_INCLUDED
19 
20 #include "../pith/store.h"
21 
22 
23 typedef enum {Loc, RemImap} RemType;
24 
25 
26 typedef enum {ReadOnly, ReadWrite, MaybeRorW, NoAccess, NoExists} AccessType;
27 
28 
29 /* Remote data folder bookkeeping */
30 typedef struct remote_data {
31     RemType      type;
32     char        *rn;		/* remote name (name of folder)              */
33     char        *lf;		/* name of local file                        */
34     STORE_S	*sonofile;	/* storage object which takes place of lf    */
35     AccessType   access;	/* of remote folder                          */
36     time_t       last_use;	/* when remote was last accessed             */
37     time_t       last_valid_chk;/* when remote valid check was done          */
38     time_t       last_local_valid_chk;
39     STORE_S	*so;		/* storage object to use                     */
40     char         read_status;	/* R for readonly                            */
41     unsigned long flags;
42     unsigned long cookie;
43     union type_specific_data {
44       struct imap_remote_data {
45 	char         *special_hdr;	/* header name for this type folder  */
46 	MAILSTREAM   *stream;		/* stream to use for remote folder   */
47 	char	     *chk_date;		/* Date of last message              */
48 	unsigned long chk_nmsgs;	/* Number of messages in folder      */
49 	unsigned long shouldbe_nmsgs;	/* Number which should be in folder  */
50 	imapuid_t     uidvalidity;	/* UIDVALIDITY of folder             */
51 	imapuid_t     uidnext;		/* UIDNEXT of folder                 */
52 	imapuid_t     uid;		/* UID of last message in folder     */
53       }i;
54     }t;
55 } REMDATA_S;
56 
57 
58 /* exported prototypes */
59 
60 
61 #endif /* PITH_REMTYPE_INCLUDED */
62