Revision 18, 0.6 KB
(checked in by ahe, 16 years ago)
|
update cbr_create, cbr_free, cbr_print, cbr_add_row in cbr.c
|
Line | |
---|
1 | // |
---|
2 | // |
---|
3 | // |
---|
4 | |
---|
5 | #include <stdio.h> |
---|
6 | #include "cbr.h" |
---|
7 | |
---|
8 | int main() { |
---|
9 | unsigned int num_cols = 7; |
---|
10 | char * cols[] = { |
---|
11 | "BER", "throughput", |
---|
12 | "mod_scheme", "tx_power", |
---|
13 | "noise_power", "path_loss", |
---|
14 | "utility" |
---|
15 | }; |
---|
16 | float vals[num_cols]; |
---|
17 | unsigned int i; |
---|
18 | for (i=0; i<num_cols; i++) |
---|
19 | vals[i] = 0.0f; |
---|
20 | int rc; |
---|
21 | |
---|
22 | // create cbr database/table |
---|
23 | cbr mycbr = cbr_create("ex1", "data", cols, num_cols); |
---|
24 | |
---|
25 | // add row here |
---|
26 | rc = cbr_add_row(mycbr, cols, vals, num_cols); |
---|
27 | |
---|
28 | // print |
---|
29 | cbr_print(mycbr); |
---|
30 | |
---|
31 | // clean up |
---|
32 | cbr_free(mycbr); |
---|
33 | |
---|
34 | printf("done.\n"); |
---|
35 | return 0; |
---|
36 | } |
---|
37 | |
---|