-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisprdl.cpp
More file actions
115 lines (100 loc) · 2.55 KB
/
Copy pathDisprdl.cpp
File metadata and controls
115 lines (100 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*-------------------------------------------------------------------------
Dieter Neubacher Vers.: 1.0 Wuhu, 22-06-94
Vers.: 2.0 29-01-97
Version 2.0 : WIN32
-------------------------------------------------------------------------
*/
#include <string.h>
#include "rameau.h"
#include "rdl.h"
#include "global.h"
#include "version.h"
#define PROG_NAME "dispRdl"
#define INP_FILE "rdlFile"
#define MAX_CHANNEL 16
/*---------------------------------------------------------------------
-----------------------------------------------------------------------
*/
void
disprdl_usage ()
{
fprintf (stderr, "usage : %s [flags] [%s]\n", PROG_NAME, INP_FILE);
fprintf (stderr, "\n");
fprintf (stderr, "flags : -? this output\n");
fprintf (stderr, " : -h this output\n");
fprintf (stderr, " : -ch= channel order\n");
fprintf (stderr, "\n");
return;
}
/*---------------------------------------------------------------------
-----------------------------------------------------------------------
*/
int main (int argc, char *argv[])
{
int i, *UseChannels = NULL;
FILE *in_stream = NULL;
FILE *out_stream = NULL;
FILE *err_stream = stderr;
Rdl rdl;
/*----------------------------------------------------------
programm flags setting und validation
------------------------------------------------------------*/
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '-') /* program flags */
{
switch (argv[i][1])
{
case '?':
case 'h':
case 'H':
disprdl_usage ();
return (0);
break;
case 'i':
in_stream = stdin;
break;
case 'v':
rameau_version (err_stream);
return (0);
break;
case 'c':
if (argv[i][2] == 'h' && argv[i][3] == '=')
{
if( (UseChannels = GetChParam( argv[i] + 4, MAX_CHANNEL )) == NULL )
{
disprdl_usage ();
return (0);
}
}
else
{
disprdl_usage ();
return (0);
}
break;
default:
disprdl_usage ();
return (0);
break;
}
}
else
/* first parameter is input file */
{
char buf[_MAX_PATH];
strcpy (buf, argv[i]);
rdl.OpenInFile(buf);
if( UseChannels == NULL )
{
rdl.Disp(); // no channel order
}
else
{
rdl.Disp( UseChannels ); // new channel order
}
return 0;
}
}
return 0;
}