*** empty log message ***
authorhachti <hachti>
Mon, 26 Mar 2007 01:15:21 +0000 (01:15 +0000)
committerhachti <hachti>
Mon, 26 Mar 2007 01:15:21 +0000 (01:15 +0000)
pc-tools/ldc2/src/data_block_7.cpp
pc-tools/ldc2/src/main.cpp

index c14b060bda198c833434e133805cea542b2640dc..38e9d54f5d3cc9d0f88b3fe052cdcc2b2652e7b5 100644 (file)
@@ -2,27 +2,47 @@
  * 
  * LDC2 source code
  *
- * $Date: 2007/03/26 01:00:39 $
+ * $Date: 2007/03/26 01:15:21 $
  * $Author: hachti $
  *
  * $Log: data_block_7.cpp,v $
- * Revision 2.0  2007/03/26 01:00:39  hachti
+ * Revision 2.1  2007/03/26 01:15:21  hachti
  * *** empty log message ***
  *
  *
  ******************************************************************************/
-/******************************************************************************
- * 
- * LDC2 source code
- *
- * $Date: 2007/03/26 01:00:39 $
- * $Author: hachti $
- *
- * $Log: data_block_7.cpp,v $
- * Revision 2.0  2007/03/26 01:00:39  hachti
- * *** empty log message ***
- *
- *
- ******************************************************************************/
+
+#include "data_block_7.hh"
+
+/*!
+ *\brief Specialisation constructor.
+ */
+data_block_7::data_block_7(data_block & org)
+  :data_block(org)
+{
+  m_has_known_type=false;
+}
+
+/*!
+ *\brief Describe the block.
+ *\return A vector of text lines describing this block.
+ */
+vector<string> data_block_7::get_description(){
+  vector<string> result;
+  result.insert(result.end(),extract_label(3)+"     "+
+               get_typestring()+"Reference to Item In Common");
+  return result;
+}
+
+/******************************************************************************/
+/*!
+ *\brief Get called symbols.
+ *\return A vector containing the symbol names exported by this
+ *        block.
+ */
+vector<string> data_block_7::get_called_symbols(){
+  vector<string> result;
+  string rs=extract_label(3);
+  if (rs!="      ") result.insert(result.end(),rs);
+  return result;
+}
index eabe7fb8cca7d2c0ea78dba908910408c07368e8..dc2d12473ce6e5ccd2501f1b2d6b1baa6d8f3779 100644 (file)
@@ -2,25 +2,26 @@
  * 
  * LDC2 source code
  *
- * $Date: 2007/03/26 01:00:40 $
+ * $Date: 2007/03/26 01:15:21 $
  * $Author: hachti $
  *
  * $Log: main.cpp,v $
- * Revision 2.0  2007/03/26 01:00:40  hachti
+ * Revision 2.1  2007/03/26 01:15:21  hachti
+ * *** empty log message ***
+ *
+ * Revision 2.0  2007-03-26 01:00:40  hachti
  * *** empty log message ***
  *
  *
  ******************************************************************************/
  
-/* ldc2 preliminary main program */
-
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 
 #include <vector>
 #include <string>
-
+  
 #include "config.hh"
 #include "tool.hh"
 
@@ -51,7 +52,13 @@ static int errors=0;
 static int warnings=0;
 static int errcode=0;  //! Variable for error codes.
 
-
+/******************************************************************************/
+/*!
+ *\brief Error exit routine.
+ *
+ * This routine tests the global error counter and terminates the program
+ * if necessary.
+ */
 void exit_on_error(){
   if (errors){
     fprintf(stderr,"Failed. (%i)\n",errcode);
@@ -264,7 +271,9 @@ void process_tape(){
        if (fd<0){
          fprintf(stderr,"Error: could not open file \"%s\" for writing!\n",
                  filename);
-       exit (1);
+         errors++;
+         errcode=1;
+         return;
        }
       }
 
@@ -276,7 +285,9 @@ void process_tape(){
        if (fd_numbered<0){
          fprintf(stderr,"Error: could not open file \"%s\" for writing!\n",
                  filename_numbered);
-       exit (1);
+         errors++;
+         errcode=1;
+         return;
        }
       }
       in_object=true;
@@ -291,7 +302,9 @@ void process_tape(){
       catch (tape_block::io_error_exception e){
        fprintf(stderr,"Error: could write to file \"%s\"!\n",
                filename);
-       exit (1);
+       errors++;
+       errcode=1;
+       return;
       }
     } // if (cfg_split_objects)
 
@@ -303,7 +316,9 @@ void process_tape(){
       catch (tape_block::io_error_exception e){
        fprintf(stderr,"Error: could write to file \"%s\"!\n",
                filename_numbered);
-       exit (1);
+         errors++;
+         errcode=1;
+         return;
       }
     } // if (cfg_split_objects_numbered)
 
@@ -315,7 +330,9 @@ void process_tape(){
       if (fd_block<0){
          fprintf(stderr,"Error: could not open file \"%s\" for writing!\n",
                  fname);
-       exit (1);
+         errors++;
+         errcode=1;
+         return;
       }
       try{
        block->dump_to_fd(fd_block);
@@ -323,7 +340,9 @@ void process_tape(){
       catch (tape_block::io_error_exception e){
        fprintf(stderr,"Error: could write to file \"%s\"!\n",
                fname);
-       exit (1);
+       errors++;
+       errcode=1;
+       return;
       }
       close(fd_block);
     }
@@ -346,10 +365,12 @@ void process_tape(){
       return;
     }
   }
-   
-
 } // process_tape()
 
+/******************************************************************************/
+/*!
+ *\brief Everything that has to do with symbol listing.
+ */
 void process_called_imports(){
   vector<string>exported;
   vector<string>called;
@@ -399,6 +420,7 @@ void process_called_imports(){
 /******************************************************************************/
 /*!
  *\brief The main routine.
+ *
  */
 int main(int argc, char ** args){