/[imapfilter]/imapfilter/imapfilter.c
ViewVC logotype

Diff of /imapfilter/imapfilter.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by lefcha, Sat Aug 11 15:52:52 2001 UTC revision 1.2 by lefcha, Sat Aug 11 15:54:57 2001 UTC
# Line 15  extern int sock; Line 15  extern int sock;
15  extern account_data account;  extern account_data account;
16    
17    
18    /*
19     * In the begining there was main()...
20     */
21  int main(int argc, char **argv)  int main(int argc, char **argv)
22  {  {
23      char *config = NULL;        /* Configuration file. */      char *config = NULL;        /* Configuration file. */
# Line 24  int main(int argc, char **argv) Line 26  int main(int argc, char **argv)
26      options = OPTION_DETAILS_NORMAL;      options = OPTION_DETAILS_NORMAL;
27      account.logfile[0] = 0;      account.logfile[0] = 0;
28    
29      while ((c = getopt(argc, argv, "l:qtvc:L")) != -1) {      while ((c = getopt(argc, argv, "hl:qtvc:L")) != -1) {
30          switch (c) {          switch (c) {
31            case 'h':
32                usage();
33                exit(1);
34                break;
35          case 'l':          case 'l':
36              strncpy(account.logfile, optarg, FILENAME_MAX);              strncpy(account.logfile, optarg, FILENAME_MAX);
37              break;              break;
# Line 47  int main(int argc, char **argv) Line 53  int main(int argc, char **argv)
53              options |= OPTION_LOGGING_DISABLED;              options |= OPTION_LOGGING_DISABLED;
54              break;              break;
55          default:          default:
56              fprintf(stderr,              usage();
                     "usage: imapfilter [-hqtvL] [-c configfile] [-l logfile]\n");  
57              exit(1);              exit(1);
58              break;              break;
59          }          }
60      }      }
61    
62      if (read_config(config) || open_logfile())      if (read_config(config) || open_logfile())
63          exit(1);          exit(2);
64    
65      if (establish_connection()) {      if (establish_connection()) {
66          close_logfile();          close_logfile();
67          exit(2);          exit(3);
68      }      }
69    
70      clear_stream();      clear_stream();
# Line 99  void apply_filters(void) Line 104  void apply_filters(void)
104              imap_expunge();              imap_expunge();
105      }      }
106  }  }
107    
108    
109    /*
110     * Prints a summary of prorgam's options.
111     */
112    void usage(void)
113    {
114        fprintf(stderr,
115                "usage: imapfilter [-hqtvL] [-c configfile] [-l logfile]\n");
116    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26