Revision: 55665
http://sourceforge.net/p/brlcad/code/55665
Author: carlmoore
Date: 2013-06-04 20:28:02 +0000 (Tue, 04 Jun 2013)
Log Message:
-----------
implement -h and -? for help, specify usage of files (not stdin/stdout), and
change old h to H
Modified Paths:
--------------
brlcad/trunk/src/sig/dwin.c
Modified: brlcad/trunk/src/sig/dwin.c
===================================================================
--- brlcad/trunk/src/sig/dwin.c 2013-06-04 20:05:46 UTC (rev 55664)
+++ brlcad/trunk/src/sig/dwin.c 2013-06-04 20:28:02 UTC (rev 55665)
@@ -67,9 +67,10 @@
void coswin(double *data, int length, double percent);
static const char usage[] = "\
-Usage: dwin [options] [width (1024)] [step (width)] [start]\n\
+Usage: dwin [options] [width (1024)] [step (width)] [start] <inputfile
>outputfile\n\
+ Options:\n\
-w apply window (80%% split Cosine)\n\
- -h apply Hamming window\n\
+ -H apply Hamming window\n\
-b apply Bartlett window (triangle)\n\
-B apply bias window (half triangle)\n\
-e start first sample at end of buffer\n\
@@ -81,14 +82,13 @@
int L, step;
size_t ret;
- if (isatty(fileno(stdin)) || isatty(fileno(stdout))) {
+ if (isatty(fileno(stdin)) || isatty(fileno(stdout)))
bu_exit(1, "%s", usage);
- }
while (argc > 1) {
if (BU_STR_EQUAL(argv[1], "-w")) {
window++;
- } else if (BU_STR_EQUAL(argv[1], "-h")) {
+ } else if (BU_STR_EQUAL(argv[1], "-H")) {
window++;
hamming++;
} else if (BU_STR_EQUAL(argv[1], "-B")) {
@@ -101,8 +101,11 @@
endwin++;
} else if (BU_STR_EQUAL(argv[1], "-m")) {
midwin++;
- } else
- break;
+ } else {
+ if ( ! BU_STR_EQUAL(argv[1], "-h") && ! BU_STR_EQUAL(argv[1], "-?")
)
+ fprintf(stderr,"dwin: illegal option %s\n",argv[1]);
+ bu_exit(1, "%s", usage);
+ }
argc--;
argv++;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits