*** empty log message ***
[h316.git] / pc-tools / ldc2 / src / main.cpp
1 /* ldc2 preliminary main program */
2
3 #include <vector>
4 #include <string>
5
6 #include <stdio.h>
7 #include <unistd.h>
8
9 #include "tape_block.hh"
10 #include "data_block.hh"
11
12 #include "argread.hh"
13
14 using namespace std;
15
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
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);
53 tape_block * myblock=0;
54 do{
55 if (myblock) delete myblock;
56 myblock=tape_block::gen_from_fd(0);
57
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());
62 } while (myblock->get_state()==tape_block::TBS_OK);
63 return 0;
64 }
65