35 |
|
char *rec[1]; /* record array (extends struct) */ |
36 |
|
} RECINDEX; |
37 |
|
|
38 |
+ |
int warnings = 1; /* report warnings? */ |
39 |
+ |
|
40 |
|
/* free loaded file */ |
41 |
|
static void |
42 |
|
free_load(MEMLOAD *mp) |
385 |
|
putc('\t', stdout); |
386 |
|
} while (--records2go); /* expected EOD? */ |
387 |
|
done: |
388 |
< |
if (columns2go != no_columns) |
388 |
> |
if (warnings && columns2go != no_columns) |
389 |
|
fprintf(stderr, "Warning -- incomplete final row\n"); |
390 |
< |
if (fget_word(word, fp) != NULL) |
391 |
< |
fprintf(stderr, "Warning -- data beyond expected EOF\n"); |
390 |
> |
if (warnings && fget_word(word, fp) != NULL) |
391 |
> |
fprintf(stderr, "Warning -- characters beyond expected EOD\n"); |
392 |
|
return(1); |
393 |
|
} |
394 |
|
|
471 |
|
record_width *= atoi(argv[i]+3); |
472 |
|
} |
473 |
|
break; |
474 |
+ |
case 'w': /* warnings on/off */ |
475 |
+ |
warnings = !warnings; |
476 |
+ |
break; |
477 |
|
default: |
478 |
|
goto userr; |
479 |
|
} |
493 |
|
/* check for no-op */ |
494 |
|
if (!transpose && (record_width < 0 || |
495 |
|
(no_columns == ni_columns) & (no_rows == ni_rows))) { |
496 |
< |
fprintf(stderr, "%s: no-op -- copying input verbatim\n", |
496 |
> |
if (warnings) |
497 |
> |
fprintf(stderr, "%s: no-op -- copying input verbatim\n", |
498 |
|
argv[0]); |
499 |
|
if (!output_stream(stdin)) |
500 |
|
return(1); |
528 |
|
return(0); |
529 |
|
userr: |
530 |
|
fprintf(stderr, |
531 |
< |
"Usage: %s [-h][-f[afdb][N]][-t][-ic in_col][-ir in_row][-oc out_col][-or out_row] [input.dat]\n", |
531 |
> |
"Usage: %s [-h][-w][-f[afdb][N]][-t][-ic in_col][-ir in_row][-oc out_col][-or out_row] [input.dat]\n", |
532 |
|
argv[0]); |
533 |
|
return(1); |
534 |
|
} |