Esempio n. 1
0
int main()
{
   printf ( "Opening Book Translator - Don Cross, February 1994\n" );

   FILE *infile = fopen ( inFilename, "rt" );
   if ( !infile )
   {
      fprintf ( stderr, "Error opening file '%s' for read\n", inFilename );
      return 1;
   }

   FILE *outfile = fopen ( outFilename, "wt" );
   if ( !outfile )
   {
      fprintf ( stderr, "Error opening file '%s' for write\n", outFilename );
      fclose(infile);
      return 1;
   }

   LList<BranchPtr> library;

   ReadData ( inFilename, infile, library );
   fclose ( infile );

   WriteLibrary ( outFilename, outfile, library );
   fclose ( outfile );

   printf ( "Done!\n" );

   return 0;  // Success
}
Esempio n. 2
0
bool DefFile::Write()
{
    stream = new std::fstream(fileName.c_str(), std::ios::out);
    //if (stream != NULL)
    {
        WriteName();
        WriteLibrary();
        WriteExports();
        WriteImports();
        WriteDescription();
        WriteStacksize();
        WriteHeapsize();
        WriteCode();
        WriteData();
        WriteSections();
        delete stream;
    }
    return true;
}