1 /*!
2    \file vcdinf.h
3 
4     Copyright (C) 2002,2003 Rocky Bernstein <rocky@gnu.org>
5 
6  \verbatim
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 Foundation
19     Software, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20 
21     Like vcdinfo but exposes more of the internal structure. It is probably
22     better to use vcdinfo, when possible.
23  \endverbatim
24 */
25 
26 #ifndef _VCD_INFO_PRIVATE_H
27 #define _VCD_INFO_PRIVATE_H
28 /* We don't want to pull in cdio's config */
29 #define __CDIO_CONFIG_H__
30 
31 #ifdef HAVE_CONFIG_H
32 # include "config.h"
33 #endif
34 
35 #include <cdio/cdio.h>
36 
37 #include <cdio/ds.h>
38 #include <cdio/iso9660.h>
39 #include <libvcd/types.h>
40 #include <libvcd/files_private.h>
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif /* __cplusplus */
45 
46   struct _VcdInfo {
47     vcd_type_t vcd_type;
48 
49     CdIo_t *img;
50 
51     iso9660_pvd_t pvd;
52 
53     InfoVcd_t info;
54     EntriesVcd_t entries;
55 
56     CdioList_t *offset_list;
57     CdioList_t *offset_x_list;
58     uint32_t *seg_sizes;
59     lsn_t   first_segment_lsn;
60 
61     LotVcd_t *lot;
62     LotVcd_t *lot_x;
63     uint8_t *psd;
64     uint8_t *psd_x;
65     unsigned int psd_x_size;
66     bool extended;
67 
68     bool has_xa;           /* True if has extended attributes (XA) */
69 
70     void *tracks_buf;
71     void *search_buf;
72     void *scandata_buf;
73 
74     char *source_name; /* VCD device or file currently open */
75 
76   };
77 
78   /*!  Return the starting MSF (minutes/secs/frames) for sequence
79     entry_num in obj.  NULL is returned if there is no entry.
80     The first entry number is 0.
81   */
82   const msf_t * vcdinf_get_entry_msf(const EntriesVcd_t *entries,
83 				     unsigned int entry_num);
84 
85   struct _vcdinf_pbc_ctx {
86     unsigned int psd_size;
87     lid_t maximum_lid;
88     unsigned offset_mult;
89     CdioList_t *offset_x_list;
90     CdioList_t *offset_list;
91 
92     LotVcd_t *lot;
93     LotVcd_t *lot_x;
94     uint8_t *psd;
95     uint8_t *psd_x;
96     unsigned int psd_x_size;
97     bool extended;
98   };
99 
100   /*!
101      Calls recursive routine to populate obj->offset_list or obj->offset_x_list
102      by going through LOT.
103 
104      Returns false if there was some error.
105   */
106   bool vcdinf_visit_lot (struct _vcdinf_pbc_ctx *obj);
107 
108   /*!
109      Recursive routine to populate obj->offset_list or obj->offset_x_list
110      by reading playback control entries referred to via lid.
111 
112      Returns false if there was some error.
113   */
114   bool vcdinf_visit_pbc (struct _vcdinf_pbc_ctx *obj, lid_t lid,
115 			 unsigned int offset, bool in_lot);
116 
117 #ifdef __cplusplus
118 }
119 #endif /* __cplusplus */
120 
121 #endif /*_VCD_INFO_PRIVATE_H*/
122