Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

vundebuglog.C

Go to the documentation of this file.
00001 // Copyright (C) 2001, Compaq Computer Corporation
00002 // 
00003 // This file is part of Vesta.
00004 // 
00005 // Vesta is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 // 
00010 // Vesta is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with Vesta; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 // vundebuglog.C
00020 //
00021 // Blindly catenate the data fields from vdebuglog output into a
00022 // plain file, ignoring the block numbers, lengths, and version
00023 // numbers.  Obviously, you need to have sorted the blocks first for
00024 // this to be useful.
00025 
00026 // Raw dump of VestaLog format
00027 
00028 #include "VestaLog.H"
00029 #include "VestaLogPrivate.H"
00030 
00031 int main(int argc, char* argv[])
00032 {
00033     char xdata[2*DiskBlockSize];
00034     FILE* f = fopen(argv[1], "r");
00035 
00036     for (;;) {
00037         if (fscanf(f, "%*u %*u %*u %s", xdata) != 1) exit(0);
00038         char *p = xdata;
00039         for (int i = 0; i < 2*(DiskBlockSize - 6); i += 2) {
00040             int byte;
00041             sscanf(xdata + i, "%2x", &byte);
00042             putchar(byte);
00043         }
00044     }
00045 }

Generated on Mon May 8 00:48:42 2006 for Vesta by  doxygen 1.4.2