~fuzzgun/fin/trunk

« back to all changes in this revision

Viewing changes to src/main.c

  • Committer: Bob Mottram
  • Date: 2012-10-07 19:54:54 UTC
  • Revision ID: fuzzgun@gmail.com-20121007195454-xv6xvfye16d442ib
tidying

Show diffs side-by-side

added added

removed removed

Lines of Context:
759
759
                        return 0;
760
760
                }
761
761
 
762
 
                if (value != 0) {
763
 
                        if (strlen(value) > 0) {
764
 
                                command_run=1;
765
 
 
766
 
                                if (year == end_year) {
767
 
                                        /* single year */
768
 
                                        sprintf(titlestr,
769
 
                                                        get_text_from_identifier(TITLE_DISTRIBUTION),
770
 
                                                        year);
771
 
                                }
772
 
                                else {
773
 
                                        /* range of years */
774
 
                                        sprintf(titlestr,
775
 
                                                        get_text_from_identifier(TITLE_DISTRIBUTION_YEARS),
776
 
                                                        year, end_year);
777
 
                                }
778
 
                                /* subtitle with the name of the account */
779
 
                                sprintf(str,
780
 
                                                get_text_from_identifier(TITLE_ACCOUNT),
781
 
                                                account);
782
 
                                str[0] = toupper(str[0]); /* capital first letter */
783
 
 
784
 
                                /* if a custom title has been specified */
785
 
                                if (title!=0) {
786
 
                                        sprintf(titlestr,"%s",title);
787
 
                                }
788
 
 
789
 
                                /* create the plot image */
790
 
                                plot_distribution(titlestr, str,
791
 
                                                                  1024,480,
792
 
                                                                  value,
793
 
                                                                  distribution,
794
 
                                                                  maximum,
795
 
                                                                  DISTRIBUTION_SIZE);
796
 
 
797
 
                                printf(get_text_from_identifier(EXPORT_IMAGE),
798
 
                                           distribution_filename);
799
 
                                printf("\n");
800
 
                        }
 
762
                if (strlen(value) > 0) {
 
763
                        command_run=1;
 
764
 
 
765
                        if (year == end_year) {
 
766
                                /* single year */
 
767
                                sprintf(titlestr,
 
768
                                                get_text_from_identifier(TITLE_DISTRIBUTION),
 
769
                                                year);
 
770
                        }
 
771
                        else {
 
772
                                /* range of years */
 
773
                                sprintf(titlestr,
 
774
                                                get_text_from_identifier(TITLE_DISTRIBUTION_YEARS),
 
775
                                                year, end_year);
 
776
                        }
 
777
                        /* subtitle with the name of the account */
 
778
                        sprintf(str,
 
779
                                        get_text_from_identifier(TITLE_ACCOUNT),
 
780
                                        account);
 
781
                        str[0] = toupper(str[0]); /* capital first letter */
 
782
 
 
783
                        /* if a custom title has been specified */
 
784
                        if (title!=0) {
 
785
                                sprintf(titlestr,"%s",title);
 
786
                        }
 
787
 
 
788
                        /* create the plot image */
 
789
                        plot_distribution(titlestr, str,
 
790
                                                          1024,480,
 
791
                                                          value,
 
792
                                                          distribution,
 
793
                                                          maximum,
 
794
                                                          DISTRIBUTION_SIZE);
 
795
 
 
796
                        printf(get_text_from_identifier(EXPORT_IMAGE),
 
797
                                   distribution_filename);
 
798
                        printf("\n");
801
799
                }
802
800
                if (command_run==0) {
803
801
                        command_run=1;