home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / Input / IFOParser / print_ifo_tmt.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-06  |  2.0 KB  |  84 lines

  1.  
  2. /*
  3.  * TIME MAP TABLE
  4.  *
  5.  * Copyright (C) 1998,1999  Thomas Mirlacher
  6.  *
  7.  * This program is free software; you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License as published by
  9.  * the Free Software Foundation; either version 2 of the License, or
  10.  * (at your option) any later version.
  11.  * 
  12.  * This program is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16.  * 
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with this program; if not, write to the Free Software
  19.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  * 
  21.  * The author may be reached as dent@cosy.sbg.ac.at, or
  22.  * Thomas Mirlacher, Jakob-Haringerstr. 2, A-5020 Salzburg,
  23.  * Austria
  24.  *
  25.  *------------------------------------------------------------
  26.  *
  27.  */
  28.  
  29.  
  30. #ifdef PARSER
  31. #include <stdio.h>
  32. #endif
  33. #include <sys/types.h>
  34. //#include <unistd.h>
  35. #include "ifo.h"
  36.  
  37. #include "misc.h"
  38. #include "decode.h"
  39.  
  40.  
  41. #ifdef PARSER
  42.  
  43. /**
  44.  *
  45.  */
  46.  
  47. void ifoPrintTMT (ifo_t *ifo)
  48. {
  49.     u_int32_t *ptr = (u_int32_t *) ifo->data[ID_TMT];
  50.     ifoq_hdr_t *hdr = (ifoq_hdr_t *) ifo->data[ID_TMT];
  51.     int i;
  52.  
  53.     if (!ifo->data[ID_TMT])
  54.         return;
  55.  
  56.     printf ("\nTIME MAP TABLE\n");
  57.     printf ("---\n");
  58.     printf ("number of maps: %d\n", hdr->num);    
  59.     printf ("length of table: %d\n", hdr->len);    
  60.     printf ("('*' specifies last entry in chapter)\n");
  61.  
  62.     ptr += IFOQ_HDR_LEN;
  63.  
  64.     for (i=0; i<hdr->num; i++)
  65.         printf ("%d start 0x%x\n", i, *(ptr++));
  66.  
  67.     {
  68.         ifoq_tmt_hdr_t *tmt_hdr = (ifoq_tmt_hdr_t *) ptr;
  69.  
  70.         printf ("time unit (in seconds): %d\n", tmt_hdr->tu);
  71.  
  72.         ptr += IFOQ_TMT_HDR_LEN;
  73.     }
  74.  
  75. /*    while (ptr < (((u_char *) hdr) + hdr->len)) {
  76.         printf ("0x%06x%c ", (*ptr)&0x7FFFFFFF,
  77.                 (*ptr)&0x80000000 ? '*' : ' ');
  78.         ptr++;
  79.     }
  80. */
  81. //DENT print all maps (not only the first)
  82. }    
  83. #endif
  84.