/[cvs]/joko/Uni/BSArch/04/bmp_fractal.c
ViewVC logotype

Diff of /joko/Uni/BSArch/04/bmp_fractal.c

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

revision 1.17 by joko, Sun Jul 2 12:33:35 2006 UTC revision 1.18 by joko, Sun Jul 2 12:41:56 2006 UTC
# Line 217  int main(int argc, char *argv[]) { Line 217  int main(int argc, char *argv[]) {
217    
218    // check command line arguments    // check command line arguments
219    if (argc < 2) {    if (argc < 2) {
220      fprintf(stderr, "Can not run without arguments!\nPlease specify '-t {number of threads}' or '-p {number of processes}' and an image filename.\n");      fprintf(stderr, "Error: Can not run without arguments!\nPlease specify '-t {number of threads}' or '-p {number of processes}' and an image filename.\n");
221      exit(EXIT_FAILURE);      exit(EXIT_FAILURE);
222    }    }
223    
# Line 233  int main(int argc, char *argv[]) { Line 233  int main(int argc, char *argv[]) {
233        
234    } else if (scan_argv(argc, argv, "-p", arg_value)) {    } else if (scan_argv(argc, argv, "-p", arg_value)) {
235      if (strlen(arg_value) == 0) {      if (strlen(arg_value) == 0) {
236        fprintf(stderr, "Please specify number of processes!\n");        fprintf(stderr, "Error: Please specify number of processes!\n");
237        exit(EXIT_FAILURE);        exit(EXIT_FAILURE);
238      }      }
239      use_processes = TRUE;      use_processes = TRUE;
# Line 241  int main(int argc, char *argv[]) { Line 241  int main(int argc, char *argv[]) {
241      workers = atoi(arg_value);      workers = atoi(arg_value);
242        
243    } else if (scan_argv(argc, argv, "-t", arg_value)) {    } else if (scan_argv(argc, argv, "-t", arg_value)) {
244      if (strlen(arg_value) == 0) {      
245        fprintf(stderr, "Please specify number of threads!\n");      if (strlen(arg_value) == 0)
246          fprintf(stderr, "Error: Please specify number of threads!\n"),
247        exit(EXIT_FAILURE);        exit(EXIT_FAILURE);
248      }      
249      use_processes = FALSE;      use_processes = FALSE;
250      is_worker_process = FALSE;      is_worker_process = FALSE;
251      workers = atoi(arg_value);      workers = atoi(arg_value);
252            
253    }    }
254      
255      if (!is_worker_process && workers < 1)
256        fprintf(stderr, "Error: Number of threads/processes must be >0!\n"),
257        exit(EXIT_FAILURE);
258        
259    if (VERBOSE && use_processes) {    if (VERBOSE && use_processes) {
260      fprintf(stdout, "===================================================== ");      fprintf(stdout, "===================================================== ");
# Line 265  int main(int argc, char *argv[]) { Line 269  int main(int argc, char *argv[]) {
269    if (!is_worker_process) {    if (!is_worker_process) {
270            
271      if (argc < 4) {      if (argc < 4) {
272        fprintf(stderr, "Must give filename of image as third argument!\n");        fprintf(stderr, "Error: Must give filename of image as third argument!\n");
273        exit(EXIT_FAILURE);        exit(EXIT_FAILURE);
274      }      }
275            

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed