3
Copyright (C) 2011 Bob Mottram
6
This program is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
3
Copyright (C) 2012 Bob Mottram
6
This program is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
#include "emailgraph.h"
84
85
time_t current_time;
85
86
int stdin_data_exists=0;
88
char * plot_dates_data = "temp_dates.txt";
87
/* is tehre data to be read from stdin? */
90
/* is there data to be read from stdin? */
88
91
stdin_data_exists = stdin_has_data(1);
91
read_sentiment_file("sentiment.txt",1);
92
read_sentiment_file("sentiment.txt",0);
94
read_sentiment_file("sentiment.txt",1);
95
read_sentiment_file("sentiment.txt",0);
96
99
if (contact_list==NULL) {
385
if (strcmp(argv[i],"--plotdensity")==0) {
386
sprintf((char*)plot_dates,"%s",argv[i+1]);
387
fp_dates = fopen(plot_dates_data,"w");
381
391
if (strcmp(argv[i],"--end")==0) {
382
392
end_date = parse_date(argv[i+1]);
482
(char*)mailbox_filename, contact_list, start_date,
483
end_date, start_hour, end_hour,
484
(int*)month_histogram, (int*)year_histogram,
485
(int*)day_histogram, (int*)week_histogram, keywords, gender,corpus,sentence_dump,sentiment);
492
(char*)mailbox_filename, contact_list, start_date,
493
end_date, start_hour, end_hour,
494
(int*)month_histogram, (int*)year_histogram,
495
(int*)day_histogram, (int*)week_histogram, keywords, gender,corpus,sentence_dump,sentiment,
488
499
if (filenames!=NULL) {
489
500
next_filename = (filename_list*)(filenames->next);
490
501
while (next_filename!=NULL) {
492
(char*)(next_filename->filename), contact_list,
493
start_date, end_date, start_hour, end_hour,
494
(int*)month_histogram, (int*)year_histogram,
495
(int*)day_histogram, (int*)week_histogram, keywords, gender,corpus,sentence_dump,sentiment);
503
(char*)(next_filename->filename), contact_list,
504
start_date, end_date, start_hour, end_hour,
505
(int*)month_histogram, (int*)year_histogram,
506
(int*)day_histogram, (int*)week_histogram, keywords, gender,corpus,sentence_dump,sentiment,
496
508
next_filename = (filename_list*)(next_filename->next);
513
if (fp_dates!=NULL) fclose(fp_dates);
502
515
free_filename_list(filenames);
591
if (plot_dates[0]!='\0') {
592
if (title_str[0]=='\0') {
593
sprintf((char*)plot_title,"%s","Email Density Plot");
596
sprintf((char*)plot_title,"%s",title_str);
600
(char*)plot_title,NULL,
601
IMAGE_WIDTH,IMAGE_HEIGHT,
578
605
if (plot_daily[0]!='\0') {
579
606
if (title_str[0]=='\0') {
580
607
if (sentiment==0) {