1 /*
2  *    wmmaiload - A dockapp to monitor mails numbers
3  *    Copyright (C) 2002  Thomas Nemeth <tnemeth@free.fr>
4  *
5  *    Based on work by Seiichi SATO <ssato@sh.rim.or.jp>
6  *    Copyright (C) 2001,2002  Seiichi SATO <ssato@sh.rim.or.jp>
7  *    and on work by Mark Staggs <me@markstaggs.net>
8  *    Copyright (C) 2002  Mark Staggs <me@markstaggs.net>
9 
10  *    This program is free software; you can redistribute it and/or modify
11  *    it under the terms of the GNU General Public License as published by
12  *    the Free Software Foundation; either version 2 of the License, or
13  *    (at your option) any later version.
14 
15  *    This program is distributed in the hope that it will be useful,
16  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *    GNU General Public License for more details.
19 
20  *    You should have received a copy of the GNU General Public License
21  *    along with this program; if not, write to the Free Software
22  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  *
24  */
25 
26 
27 #ifndef MAIN_H
28 #define MAIN_H
29 
30 #include <sys/types.h>
31 #include <sys/stat.h>
32 #include "dockapp.h"
33 
34 
35 #define SET_STRING(str, val) {if (str) free(str); str = xstrdup(val);}
36 
37 #define DEFAULT_CFGFILE ".wmmailoadrc"
38 #define SIZE            58
39 #define MAXSTRLEN       512
40 #define WINDOWED_BG     ". c #AEAAAE"
41 #define MAX_HISTORY     16
42 #define CPUNUM_NONE     -1
43 
44 #define MTIME 1
45 #define ATIME 2
46 #define CTIME 3
47 
48 
49 typedef enum { LIGHTOFF = 0, LIGHTON } light;
50 typedef enum { NOALARM = 0, NEWGLOB, NEWHERE, NEWBOTH } MailAlarm;
51 typedef enum { MBOX, MAILDIR, MH, POP3, HOTMAIL, IMAP } BoxType;
52 
53 typedef struct MailBox
54 {
55         char*           entry;
56         time_t          time;
57         off_t           size;
58         int             new;
59         int             total;
60         int             updated;
61         int             changed;
62         int             in_thread;
63         BoxType         type;
64         char*           username;
65         char*           password;
66         char*           folder;
67         int             port;
68         struct MailBox* next;
69 }
70 MailBox;
71 
72 MailBox * get_mailbox(int box_num);
73 Bool fexist(const char *filename);
74 Bool filetime(const char *filename, time_t *time, int mode);
75 Bool filesize(const char *filename, off_t *fsize);
76 Bool load_cfgfile(Bool wait);
77 
78 
79 #endif /* MAIN_H */
80 
81