+int main(int argc, char ** args){
+
+ string infile, outfile;
+ int infile_set, outfile_set;
+ int help_wanted;
+
+ int greet_want;
+ string greetings;
+
+ int in_fd, out_fd;
+
+ in_fd=0; //stdin {O _ \
+ out_fd=1; //stdout {O ^ /
+
+ argument_reader ar("ldc2");
+ ar.add_param("h","help","Output this help text.",&help_wanted);
+ ar.add_param("g","greet","Wonderful bla bla. It is here only to test the output\
+capabilities of the arg_reader.",&greet_want);
+
+ ar.add_argument("<input-file>","File from where data is read",&infile_set,&infile);
+ ar.add_argument("<output-file>","File to where output is redirected",&outfile_set,&outfile);
+
+
+ if((dump_vector(ar.read_args(argc,args))||help_wanted)){
+ dump_vector(ar.get_help());
+ exit(1);
+ }
+ if(greet_want)printf("Hallo!\n");
+
+ if (infile_set==1){
+ printf("Opening file for input:%s\n",infile.c_str());
+ in_fd=open(infile.c_str(),O_RDONLY);
+ if (in_fd<0){
+ printf("Error: could not open file:%s\n",infile.c_str());
+ exit (3);
+ }
+ }
+
+ vector<tape_block*> tape;
+
+
+ tape_block * block=0;
+ while(1){
+ block=tape_block::gen_from_fd(in_fd);
+ if (block->get_state()==tape_block::TBS_OK){
+ tape.insert(tape.end(),block);
+ dump_vector(block->get_description());
+ }
+ else break;
+ }