/[imapfilter]/imapfilter/imapfilter.h
ViewVC logotype

Annotation of /imapfilter/imapfilter.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (hide annotations)
Sun Sep 30 20:20:14 2001 UTC (22 years, 6 months ago) by lefcha
Branch: MAIN
Changes since 1.10: +36 -28 lines
File MIME type: text/plain
Error codes.

1 lefcha 1.9 #ifndef IMAPFILTER_H
2     #define IMAPFILTER_H
3    
4     #include <stdio.h>
5    
6     #ifndef DATA_H
7     #include "data.h"
8     #endif
9    
10 lefcha 1.11 /* Error codes returned by functions. */
11     #define ERROR_TRIVIAL 1
12     #define ERROR_FILE_OPEN 2
13     #define ERROR_CONFIG_PARSE 3
14     #define ERROR_MEMORY_ALLOCATION 4
15     #define ERROR_NETWORK 5
16     #define ERROR_UNDEFINED 6
17 lefcha 1.9
18     /* Flags that control the program's options. */
19     #define OPTION_DETAILS_QUITE 0x01
20     #define OPTION_DETAILS_NORMAL 0x02
21     #define OPTION_DETAILS_VERBOSE 0x04
22     #define OPTION_DETAILS_CLEAR 0xf8
23    
24 lefcha 1.11 /* Where to print information about program's actions. */
25     #define INFO_STDOUT 0x01
26     #define INFO_LOGFILE 0x02
27     #define INFO_ALL 0xff
28    
29 lefcha 1.9 /* Buffer size of the the IMAP command. */
30     #define SMALL_CMD 64
31     #define MEDIUM_CMD 256
32     #define BIG_CMD 8192
33    
34     /* Buffer size of server's response. */
35     #define RESPONSE_BUF 16384
36     #define RESULT_BUF 512
37    
38     /* Buffer size of message's headers. */
39     #define HEADERS_BUF 8192
40    
41     /* Buffer size of search results. */
42     #define SEARCH_MESSAGES_BUF 512
43    
44 lefcha 1.1
45     #define min(A, B) ((A) < (B) ? (A) : (B))
46    
47    
48 lefcha 1.9 /* connect.c */
49     int init_connection(char *serv, unsigned int port);
50     int close_connection(void);
51    
52     /* file.c */
53     int read_config(char *cfg);
54     #ifdef CHECK_PERMISSIONS
55     int check_permissions(char *cfg);
56     #endif
57     int parse_config(FILE * fp);
58 lefcha 1.10 void set_options(char *line, regmatch_t * match);
59 lefcha 1.1
60 lefcha 1.9 /* imapfilter.c */
61     void usage(void);
62 lefcha 1.1
63 lefcha 1.9 /* imap.c */
64     int send_command(char *cmd);
65     #ifdef DEBUG
66     int imap_noop(void);
67     #endif
68     int imap_logout(void);
69     int imap_login(char *user, char *pass);
70 lefcha 1.11 /* int imap_examine(char *mbox); */
71 lefcha 1.9 int imap_select(char *mbox);
72     int imap_status(char *mbox, char *items);
73     int imap_create(char *mbox);
74     int imap_search(char *search);
75 lefcha 1.11 int imap_fetch(int peek, char *mesg, char *headers);
76 lefcha 1.9 int imap_store(char *mesg, char *flags);
77     int imap_copy(char *mesg, char *mbox);
78     int imap_close(void);
79     int imap_expunge(void);
80    
81     /* log.c */
82     void info(const char *info, ...);
83 lefcha 1.11 void log_info(int flag, void *ptr);
84 lefcha 1.9 void verbose(const char *info, ...);
85     void error(const char *errmsg, ...);
86 lefcha 1.11 void fatal(unsigned int errnum, const char *fatal, ...);
87 lefcha 1.9 int open_logfile(void);
88     int create_logfile(void);
89     int close_logfile(void);
90 lefcha 1.11 char *get_time(void);
91 lefcha 1.9
92     /* request.c */
93     int test(void);
94     int login(char *user, char *pass);
95     int select_mailbox(char *mbox);
96 lefcha 1.11 int mailbox_status(char *mbox);
97 lefcha 1.9 int close_mailbox(void);
98     int logout(void);
99    
100     int apply_filters(filter_t ** filters, char *mbox);
101     int match_filter(filter_t * filter, char *mesgs);
102    
103     void empty_fifo(mask_t ** mfifo);
104 lefcha 1.11 void queue_fifo(mask_t ** mfifo, mask_t * mask);
105     mask_t *dequeue_fifo(mask_t ** mfifo);
106 lefcha 1.9
107 lefcha 1.11 char *generate_filter_and(mask_t * mask, unsigned int masknum, unsigned int masklen);
108     char *generate_filter_or(mask_t * mask, unsigned int masknum, unsigned int masklen);
109 lefcha 1.9
110 lefcha 1.11 int apply_action(char *mesgs, unsigned int *type, char *destmbox, char *args);
111 lefcha 1.9 int action_delete(char *mesgs, char *args);
112 lefcha 1.11 int action_copy(char *mesgs, char *destmbox, char *args);
113     int action_move(char *mesgs, char *destmbox, char *args);
114     int action_list(char *mesgs, char *args);
115 lefcha 1.9
116     unsigned int convert_messages(char *mesgs);
117    
118 lefcha 1.11 /* response.c */
119     int receive_response(char *buf);
120     int server_response(char *cmd);
121     int status_response(void);
122     int search_response(char *mesgs);
123     int fetch_response(void);
124     int copy_response(void);
125     int analyze_response(char *buf);
126    
127     #endif /* IMAPFILTER_H */

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26