From: hachti Date: Mon, 20 Nov 2006 01:19:00 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://gitweb.hachti.de/?a=commitdiff_plain;h=fd9632c025ce5974aaa8737721180fecd8d7a1c6;p=h316.git *** empty log message *** --- diff --git a/pc-tools/ldc2/src/data_block_0.cpp b/pc-tools/ldc2/src/data_block_0.cpp index f43c016..84e630f 100644 --- a/pc-tools/ldc2/src/data_block_0.cpp +++ b/pc-tools/ldc2/src/data_block_0.cpp @@ -1,7 +1,7 @@ #include "data_block_0.hh" /*! - *\brief Parent class copy constructor. + *\brief Specialisation constructor. */ data_block_0::data_block_0(data_block & org) :data_block(org) diff --git a/pc-tools/ldc2/src/data_block_0.hh b/pc-tools/ldc2/src/data_block_0.hh index 61b2b7a..86756b2 100644 --- a/pc-tools/ldc2/src/data_block_0.hh +++ b/pc-tools/ldc2/src/data_block_0.hh @@ -14,7 +14,7 @@ class data_block_0 { friend tape_block * tape_block::gen_from_fd(int,void(*)(void*), void(*)(void*),void*); -private: +protected: data_block_0(data_block&); public: diff --git a/pc-tools/ldc2/src/data_block_0_0.cpp b/pc-tools/ldc2/src/data_block_0_0.cpp index 815d33f..ece243d 100644 --- a/pc-tools/ldc2/src/data_block_0_0.cpp +++ b/pc-tools/ldc2/src/data_block_0_0.cpp @@ -3,10 +3,10 @@ #include /*! - *\brief Parent class copy constructor. + *\brief Specialisation constructor. */ data_block_0_0::data_block_0_0(data_block_0 & org) - :data_block_0_label_extractor(org),data_block_0(org) + :data_block_0_label_extractor(org) {} /*! diff --git a/pc-tools/ldc2/src/data_block_0_0.hh b/pc-tools/ldc2/src/data_block_0_0.hh index a74dd54..c0f50ed 100644 --- a/pc-tools/ldc2/src/data_block_0_0.hh +++ b/pc-tools/ldc2/src/data_block_0_0.hh @@ -19,7 +19,6 @@ public: protected: data_block_0_0(data_block_0&); - }; diff --git a/pc-tools/ldc2/src/data_block_0_1.cpp b/pc-tools/ldc2/src/data_block_0_1.cpp index 1b590bd..33b3f28 100644 --- a/pc-tools/ldc2/src/data_block_0_1.cpp +++ b/pc-tools/ldc2/src/data_block_0_1.cpp @@ -15,7 +15,7 @@ data_block_0_1::data_block_0_1(data_block_0 & org) */ vector data_block_0_1::get_description(){ vector result; - result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block"); + result.insert(result.end()," "+get_typestring()+"Turn off non-load flag"); return result; } diff --git a/pc-tools/ldc2/src/data_block_0_14.cpp b/pc-tools/ldc2/src/data_block_0_14.cpp index 3dc139f..7fbfdd2 100644 --- a/pc-tools/ldc2/src/data_block_0_14.cpp +++ b/pc-tools/ldc2/src/data_block_0_14.cpp @@ -15,7 +15,7 @@ data_block_0_14::data_block_0_14(data_block_0 & org) */ vector data_block_0_14::get_description(){ vector result; - result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block"); + result.insert(result.end()," "+get_typestring()+"End"); return result; } diff --git a/pc-tools/ldc2/src/data_block_0_2.cpp b/pc-tools/ldc2/src/data_block_0_2.cpp index f95f905..9320a77 100644 --- a/pc-tools/ldc2/src/data_block_0_2.cpp +++ b/pc-tools/ldc2/src/data_block_0_2.cpp @@ -15,7 +15,7 @@ data_block_0_2::data_block_0_2(data_block_0 & org) */ vector data_block_0_2::get_description(){ vector result; - result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block"); + result.insert(result.end()," "+get_typestring()+"Turn on chain flag"); return result; } diff --git a/pc-tools/ldc2/src/data_block_0_24.cpp b/pc-tools/ldc2/src/data_block_0_24.cpp index e164358..7f62292 100644 --- a/pc-tools/ldc2/src/data_block_0_24.cpp +++ b/pc-tools/ldc2/src/data_block_0_24.cpp @@ -15,7 +15,7 @@ data_block_0_24::data_block_0_24(data_block_0 & org) */ vector data_block_0_24::get_description(){ vector result; - result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block"); + result.insert(result.end()," "+get_typestring()+"Switch to relocatable mode"); return result; } diff --git a/pc-tools/ldc2/src/data_block_0_3.cpp b/pc-tools/ldc2/src/data_block_0_3.cpp index fc751e4..0652862 100644 --- a/pc-tools/ldc2/src/data_block_0_3.cpp +++ b/pc-tools/ldc2/src/data_block_0_3.cpp @@ -15,7 +15,7 @@ data_block_0_3::data_block_0_3(data_block_0 & org) */ vector data_block_0_3::get_description(){ vector result; - result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block"); + result.insert(result.end()," "+get_typestring()+"End of Job"); return result; } diff --git a/pc-tools/ldc2/src/data_block_0_30.cpp b/pc-tools/ldc2/src/data_block_0_30.cpp index 2df9232..140ef37 100644 --- a/pc-tools/ldc2/src/data_block_0_30.cpp +++ b/pc-tools/ldc2/src/data_block_0_30.cpp @@ -15,7 +15,7 @@ data_block_0_30::data_block_0_30(data_block_0 & org) */ vector data_block_0_30::get_description(){ vector result; - result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block"); + result.insert(result.end()," "+get_typestring()+"Switch to absolute mode"); return result; } diff --git a/pc-tools/ldc2/src/data_block_0_4.cpp b/pc-tools/ldc2/src/data_block_0_4.cpp index 962a0ad..e02e28b 100644 --- a/pc-tools/ldc2/src/data_block_0_4.cpp +++ b/pc-tools/ldc2/src/data_block_0_4.cpp @@ -3,7 +3,7 @@ #include /*! - *\brief Parent class copy constructor. + *\brief Specialising constructor. */ data_block_0_4::data_block_0_4(data_block_0 & org) :data_block_0(org) @@ -15,7 +15,7 @@ data_block_0_4::data_block_0_4(data_block_0 & org) */ vector data_block_0_4::get_description(){ vector result; - result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block"); + result.insert(result.end()," "+get_typestring()+"Data"); return result; } diff --git a/pc-tools/ldc2/src/data_block_0_44.cpp b/pc-tools/ldc2/src/data_block_0_44.cpp index e07f342..b3bce3c 100644 --- a/pc-tools/ldc2/src/data_block_0_44.cpp +++ b/pc-tools/ldc2/src/data_block_0_44.cpp @@ -6,7 +6,7 @@ *\brief Parent class copy constructor. */ data_block_0_44::data_block_0_44(data_block_0 & org) - :data_block_0(org) + :data_block_0_label_extractor(org) {} /*! @@ -15,7 +15,8 @@ data_block_0_44::data_block_0_44(data_block_0 & org) */ vector data_block_0_44::get_description(){ vector result; - result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block"); + string label=get_labels()[0]; + result.insert(result.end(), + label+" "+get_typestring()+"Subprogram Call"); return result; } - diff --git a/pc-tools/ldc2/src/data_block_0_44.hh b/pc-tools/ldc2/src/data_block_0_44.hh index 64ac98b..4384e14 100644 --- a/pc-tools/ldc2/src/data_block_0_44.hh +++ b/pc-tools/ldc2/src/data_block_0_44.hh @@ -4,13 +4,13 @@ #include #include -#include "data_block_0.hh" +#include "data_block_0_label_extractor.hh" /*! *\brief Class for block type (0-0). */ class data_block_0_44 - : public data_block_0 + : public data_block_0_label_extractor { friend tape_block * tape_block::gen_from_fd(int,void(*)(void*), void(*)(void*),void*); diff --git a/pc-tools/ldc2/src/data_block_0_50.cpp b/pc-tools/ldc2/src/data_block_0_50.cpp index 753fe03..4954f83 100644 --- a/pc-tools/ldc2/src/data_block_0_50.cpp +++ b/pc-tools/ldc2/src/data_block_0_50.cpp @@ -6,7 +6,7 @@ *\brief Parent class copy constructor. */ data_block_0_50::data_block_0_50(data_block_0 & org) - :data_block_0(org) + :data_block_0_label_extractor(org) {} /*! @@ -15,7 +15,14 @@ data_block_0_50::data_block_0_50(data_block_0 & org) */ vector data_block_0_50::get_description(){ vector result; - result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block"); + vector labels=get_labels(); + for (int i=0; i #include -#include "data_block_0.hh" +#include "data_block_0_label_extractor.hh" /*! *\brief Class for block type (0-0). */ class data_block_0_50 - : public data_block_0 + : public data_block_0_label_extractor { friend tape_block * tape_block::gen_from_fd(int,void(*)(void*), void(*)(void*),void*); diff --git a/pc-tools/ldc2/src/data_block_0_54.cpp b/pc-tools/ldc2/src/data_block_0_54.cpp index 33a4b64..e8bed98 100644 --- a/pc-tools/ldc2/src/data_block_0_54.cpp +++ b/pc-tools/ldc2/src/data_block_0_54.cpp @@ -15,7 +15,7 @@ data_block_0_54::data_block_0_54(data_block_0 & org) */ vector data_block_0_54::get_description(){ vector result; - result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block"); + result.insert(result.end()," "+get_typestring()+"Enter extended-memory desectorizing"); return result; } diff --git a/pc-tools/ldc2/src/data_block_0_60.cpp b/pc-tools/ldc2/src/data_block_0_60.cpp index b342cb5..6bf2b61 100644 --- a/pc-tools/ldc2/src/data_block_0_60.cpp +++ b/pc-tools/ldc2/src/data_block_0_60.cpp @@ -15,7 +15,7 @@ data_block_0_60::data_block_0_60(data_block_0 & org) */ vector data_block_0_60::get_description(){ vector result; - result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block"); + result.insert(result.end()," "+get_typestring()+"Leave extended-memory desectorizing"); return result; } diff --git a/pc-tools/ldc2/src/data_block_0_label_extractor.cpp b/pc-tools/ldc2/src/data_block_0_label_extractor.cpp index cd53bb2..537099c 100644 --- a/pc-tools/ldc2/src/data_block_0_label_extractor.cpp +++ b/pc-tools/ldc2/src/data_block_0_label_extractor.cpp @@ -1,6 +1,6 @@ #include "data_block_0_label_extractor.hh" /*! - *\brief Constructor. + *\brief Specialisation constructor. */ data_block_0_label_extractor::data_block_0_label_extractor(data_block_0& org) : data_block_0(org) diff --git a/pc-tools/ldc2/src/data_block_0_label_extractor.hh b/pc-tools/ldc2/src/data_block_0_label_extractor.hh index bc42bd9..797c088 100644 --- a/pc-tools/ldc2/src/data_block_0_label_extractor.hh +++ b/pc-tools/ldc2/src/data_block_0_label_extractor.hh @@ -11,13 +11,13 @@ * This class cannot be instantiated.\n */ class data_block_0_label_extractor - : public virtual data_block_0 + : public data_block_0 { protected: data_block_0_label_extractor(data_block_0 &); -protected: +protected: vector get_labels(); }; diff --git a/pc-tools/ldc2/src/main.cpp b/pc-tools/ldc2/src/main.cpp index 36cb22e..3117746 100644 --- a/pc-tools/ldc2/src/main.cpp +++ b/pc-tools/ldc2/src/main.cpp @@ -1,4 +1,14 @@ +/* +r +$Id: main.cpp,v 1.4 2006/11/20 01:20:11 hachti Exp $ +$Log: main.cpp,v $ +Revision 1.4 2006/11/20 01:20:11 hachti +*** empty log message *** +Revision 1.3 2006-11-20 01:19:48 hachti +Another revision + +*/ #include #include @@ -18,22 +28,11 @@ int main(){ do{ if (myblock) delete myblock; myblock=tape_block::gen_from_fd(0); - + vector desc=myblock->get_description(); for (vector::iterator iter=desc.begin(); iter!=desc.end();iter++) printf("%s\n",(*iter).c_str()); - - -// if ((myblock->get_type()==0)&&(myblock->get_subtype()==050)){ -// data_block * dp=(data_block *)myblock; -// printf ("0-50 symbol name: %s\n",dp->extract_string(4).c_str()); -// printf ("0-50 symbol name: %s\n",dp->extract_string(11).c_str()); -// printf ("Block size:%i\n",dp->get_word_size()); -// } } while (myblock->get_state()==tape_block::TBS_OK); - printf("---"); - printf("State:%i\n",myblock->get_state()); - printf("raw size:%i\n",myblock->get_raw_size()); return 0; } diff --git a/pc-tools/ldc2/src/tape_block.cpp b/pc-tools/ldc2/src/tape_block.cpp index 0d011eb..abba1d6 100644 --- a/pc-tools/ldc2/src/tape_block.cpp +++ b/pc-tools/ldc2/src/tape_block.cpp @@ -19,6 +19,14 @@ #include "data_block_0_54.hh" #include "data_block_0_60.hh" #include "data_block_0_50.hh" +#include "data_block_0_64.hh" +#include "data_block_1.hh" +#include "data_block_2.hh" +#include "data_block_3.hh" +#include "data_block_4.hh" +#include "data_block_5.hh" +#include "data_block_6.hh" +#include "data_block_7.hh" #include "eot_block.hh" #include "discard_block.hh" @@ -176,6 +184,7 @@ unsigned char * tape_block::get_raw_data(){ * - data_block_0_50 * - data_block_0_54 * - data_block_0_60 + * - data_block_0_64 * - data_block_1 * - data_block_2 * - data_block_3 @@ -199,75 +208,75 @@ tape_block * tape_block::gen_from_fd(int fd, void (*input_stop)(void *), void * start_stop_arg) { - tape_block * res_block; - res_block=new tape_block(fd,input_start,input_stop,start_stop_arg); - data_block * d_block; - data_block_0 * d0_block; - eot_block * e_block; - discard_block * di_block; - - // Retype to data_block if possible - switch(res_block->get_type()){ - case tape_block::TBT_DATA: // Make pointer a data block - d_block=new data_block(*res_block); - delete res_block; - res_block=d_block; + tape_block * n_tape_block=0; + data_block * n_data_block=0; + data_block * n_data_block_x=0; + data_block_0 * n_data_block_0=0; + data_block_0 * n_data_block_0_x=0; + eot_block * n_eot_block=0; + discard_block * n_discard_block=0; + + n_tape_block=new tape_block(fd,input_start,input_stop,start_stop_arg); + + // Retype to data_block, eot_block, discard_block - if possible + switch(n_tape_block->get_type()){ + case tape_block::TBT_DATA: + n_data_block = new data_block(*n_tape_block); break; case tape_block::TBT_EOT: - e_block=new eot_block(*res_block); - delete res_block; - res_block=e_block; - break; + n_eot_block=new eot_block(*n_tape_block); + delete n_tape_block; + return n_eot_block; case tape_block::TBT_DISCARD: - di_block=new discard_block(*res_block); - delete res_block; - res_block=di_block; - break; - default: // All other cases - return res_block; + n_discard_block = new discard_block(*n_tape_block); + delete n_tape_block; + return n_discard_block; + default: + return n_tape_block; } - - // Retype again, if it's a data_block now - - switch(res_block->get_type()){ - case 00: - d0_block=new data_block_0(*d_block); - d_block=d0_block; - break; -// case 01: d_block=new data_block_1(*d_block); break; -// case 02: d_block=new data_block_2(*d_block); break; -// case 03: d_block=new data_block_3(*d_block); break; -// case 04: d_block=new data_block_4(*d_block); break; -// case 05: d_block=new data_block_5(*d_block); break; -// case 06: d_block=new data_block_6(*d_block); break; -// case 07: d_block=new data_block_7(*d_block); break; + delete n_tape_block; + + // Now only data blocks are left + + switch(n_data_block->get_type()){ + case 00: n_data_block_0=new data_block_0(*n_data_block); break; + case 01: n_data_block_x=new data_block_1(*n_data_block); break; + case 02: n_data_block_x=new data_block_2(*n_data_block); break; + case 03: n_data_block_x=new data_block_3(*n_data_block); break; + case 04: n_data_block_x=new data_block_4(*n_data_block); break; + case 05: n_data_block_x=new data_block_5(*n_data_block); break; + case 06: n_data_block_x=new data_block_6(*n_data_block); break; + case 07: n_data_block_x=new data_block_7(*n_data_block); break; default: - return res_block; + return n_data_block; + } + if (n_data_block_0==0){ // So we must have found another one + delete n_data_block; + return n_data_block_x; } - delete res_block; - res_block=d_block; - if (res_block->get_type()==0) switch(d0_block->get_subtype()){ - case 000: d0_block=new data_block_0_0(*d0_block); break; - case 001: d0_block=new data_block_0_1(*d0_block); break; - case 002: d0_block=new data_block_0_2(*d0_block); break; - case 003: d0_block=new data_block_0_3(*d0_block); break; - case 004: d0_block=new data_block_0_4(*d0_block); break; - case 010: d0_block=new data_block_0_10(*d0_block); break; - case 014: d0_block=new data_block_0_14(*d0_block); break; - case 024: d0_block=new data_block_0_24(*d0_block); break; - case 044: d0_block=new data_block_0_44(*d0_block); break; - case 030: d0_block=new data_block_0_30(*d0_block); break; - case 054: d0_block=new data_block_0_54(*d0_block); break; - case 060: d0_block=new data_block_0_60(*d0_block); break; - case 050: d0_block=new data_block_0_50(*d0_block); break; + // Here only type 0 left + + switch(n_data_block_0->get_subtype()){ + case 000: n_data_block_0_x=new data_block_0_0(*n_data_block_0); break; + case 001: n_data_block_0_x=new data_block_0_1(*n_data_block_0); break; + case 002: n_data_block_0_x=new data_block_0_2(*n_data_block_0); break; + case 003: n_data_block_0_x=new data_block_0_3(*n_data_block_0); break; + case 004: n_data_block_0_x=new data_block_0_4(*n_data_block_0); break; + case 010: n_data_block_0_x=new data_block_0_10(*n_data_block_0); break; + case 014: n_data_block_0_x=new data_block_0_14(*n_data_block_0); break; + case 024: n_data_block_0_x=new data_block_0_24(*n_data_block_0); break; + case 044: n_data_block_0_x=new data_block_0_44(*n_data_block_0); break; + case 030: n_data_block_0_x=new data_block_0_30(*n_data_block_0); break; + case 054: n_data_block_0_x=new data_block_0_54(*n_data_block_0); break; + case 060: n_data_block_0_x=new data_block_0_60(*n_data_block_0); break; + case 064: n_data_block_0_x=new data_block_0_64(*n_data_block_0); break; + case 050: n_data_block_0_x=new data_block_0_50(*n_data_block_0); break; default: - return res_block; + return n_data_block_0; } - delete res_block; - res_block=d0_block; - - return res_block; + delete n_data_block_0; + return n_data_block_0_x; } /***************************************************************/