798b0c1d |
1 | /* ldc2 preliminary main program */ |
2 | |
3 | #include <vector> |
4 | #include <string> |
f9d603d2 |
5 | |
97b26985 |
6 | #include <stdio.h> |
7 | #include <unistd.h> |
8 | |
9 | #include "tape_block.hh" |
6c06db96 |
10 | #include "data_block.hh" |
97b26985 |
11 | |
798b0c1d |
12 | #include "argread.hh" |
13 | |
14 | using namespace std; |
15 | |
97b26985 |
16 | void tape_start(void* m){ |
17 | printf("tape_start\n"); |
18 | } |
19 | |
20 | void tape_stop(void* m){ |
21 | printf("tape_stop\n"); |
22 | } |
23 | |
798b0c1d |
24 | |
25 | |
26 | |
27 | void dump_vector(vector<string> arguments){ |
28 | for (vector<string>::iterator iter=arguments.begin();iter<arguments.end();iter++){ |
29 | printf("%s\n",(*iter).c_str()); |
30 | } |
31 | } |
32 | |
33 | int main(int argc, char ** args){ |
34 | int help_needed; |
35 | int name_set; |
36 | int file_set; |
37 | string name="Philipp"; |
38 | string filename; |
39 | |
40 | argreader ar("ldc2"); |
41 | ar.add_param("n","name=","Enter other name",&name_set,&name,"<name>"); |
42 | ar.add_param("h","help","Give help",&help_needed); |
43 | ar.add_free_param("<file>","File to read data from",&file_set,&filename); |
44 | |
45 | |
46 | |
47 | dump_vector(ar.read_args(argc,args)); |
48 | |
49 | if (help_needed==1) dump_vector(ar.get_help()); |
50 | |
51 | printf("Hallo %s!\n",name.c_str()); |
52 | exit(0); |
97b26985 |
53 | tape_block * myblock=0; |
54 | do{ |
55 | if (myblock) delete myblock; |
0ec6e042 |
56 | myblock=tape_block::gen_from_fd(0); |
fd9632c0 |
57 | |
6c06db96 |
58 | vector<string> desc=myblock->get_description(); |
59 | for (vector<string>::iterator iter=desc.begin(); |
60 | iter!=desc.end();iter++) |
61 | printf("%s\n",(*iter).c_str()); |
97b26985 |
62 | } while (myblock->get_state()==tape_block::TBS_OK); |
97b26985 |
63 | return 0; |
64 | } |
798b0c1d |
65 | |