-
Notifications
You must be signed in to change notification settings - Fork 0
/
cline.cc
executable file
·70 lines (67 loc) · 1.72 KB
/
cline.cc
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
/*
$Date: 1999/10/15 12:40:27 $
$Revision: 1.1.1.1 $
$Author: kise $
cline.c
$B0z?t$N2r@O(B analysis of arguments
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "const.h"
#include "extern.h"
#include "function.h"
namespace voronoi{
void analyze_cline(char **argv, int *ifargc, int *ofargc)
{
int i = 1;
int j = 0;
int argc_tmp[2];
while( argv[i] != NULL) {
if(strcmp(argv[i],"-sr")==0) {
i++;
if(argv[i] == NULL) usage();
sample_rate = atoi(argv[i]);
i++;
}
else if(strcmp(argv[i],"-nm")==0) {
i++;
if(argv[i] == NULL) usage();
noise_max = atoi(argv[i]);
i++;
}
else if(strcmp(argv[i],"-fr")==0) {
i++;
if(argv[i] == NULL) usage();
freq_rate = atof(argv[i]);
i++;
}
else if(strcmp(argv[i],"-ta")==0) {
i++;
if(argv[i] == NULL) usage();
Ta = atoi(argv[i]);
i++;
}
else if(strcmp(argv[i],"-sw")==0) {
i++;
if(argv[i] == NULL) usage();
smwind = atoi(argv[i]);
i++;
}
else if(strcmp(argv[i],"-dparam")==0) {
display_parameters = YES;
i++;
}
else {
argc_tmp[j] = i;
j++;
i++;
}
}
if( j != 2 ) usage();
else {
*ifargc = argc_tmp[0];
*ofargc = argc_tmp[1];
}
}
}