libcdio  2.1.0
About: GNU libcdio is a library for CD-ROM and CD image access.
  Fossies Dox: libcdio-2.1.0.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

generic.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2004-2006, 2008-2009, 2012-2013
3  Rocky Bernstein <rocky@gnu.org>
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 /* Internal routines for CD I/O drivers. */
20 
21 
22 #ifndef CDIO_DRIVER_GENERIC_H_
23 #define CDIO_DRIVER_GENERIC_H_
24 
25 #if defined(HAVE_CONFIG_H) && !defined(LIBCDIO_CONFIG_H)
26 # include "config.h"
27 #endif
28 
29 #include <cdio/cdio.h>
30 #include <cdio/cdtext.h>
31 #include <cdio/iso9660.h>
32 
33 #ifdef HAVE_STDBOOL_H
34 # include <stdbool.h>
35 #endif
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40 
47  typedef struct {
48  char *source_name;
49  bool init;
50  bool toc_init;
55  /* Only one of data_source or fd is used; fd is for CD-ROM
56  devices and the data_source for stream reading (bincue, nrg, toc,
57  network).
58  */
60  int fd;
64  uint8_t u_joliet_level;
71 
72  /* Memorized sense reply of the most recent SCSI command.
73  Recorded by driver implementations of cdio_funcs_t.run_mmc_cmd().
74  Read by API function mmc_get_cmd_scsi_sense().
75  */
76  unsigned char scsi_mmc_sense[263]; /* See SPC-3 4.5.3 : 252 bytes legal
77  but 263 bytes possible */
78  int scsi_mmc_sense_valid; /* Number of valid sense bytes */
79 
80  /* Memorized eventual system specific SCSI address tuple text.
81  Empty text means that there is no such text defined for the drive.
82  NULL means that the driver does not support "scsi-tuple".
83  To be read by cdio_get_arg("scsi-tuple").
84  System specific suffixes to the key may demand and eventually
85  guarantee a further specified format.
86  E.g. "scsi-tuple-linux" guarantees either "Bus,Host,Channel,Target,Lun",
87  or empty text, or NULL. No other forms.
88  */
89  char *scsi_tuple;
91 
97 
104  cdio_generic_unimplemented_set_blocksize (void *p_user_data,
105  uint16_t i_blocksize);
106 
113  int i_speed);
114 
118  void cdio_generic_free (void *p_env);
119 
123  bool cdio_generic_init (void *p_env, int open_mode);
124 
130  off_t cdio_generic_lseek (void *p_env, off_t offset, int whence);
131 
137  ssize_t cdio_generic_read (void *p_env, void *p_buf, size_t size);
138 
143  int cdio_generic_read_form1_sector (void * user_data, void *data,
144  lsn_t lsn);
145 
149  void cdio_generic_stdio_free (void *env);
150 
155  bool cdio_is_device_win32(const char *source_name);
156 
161  bool cdio_is_device_os2(const char *source_name);
162 
163 
168  bool cdio_is_device_generic(const char *source_name);
169 
170 
174  bool cdio_is_device_quiet_generic(const char *source_name);
175 
183  cdtext_t *get_cdtext_generic (void *p_user_data);
184 
189  track_t get_first_track_num_generic(void *p_user_data);
190 
194  track_t get_num_tracks_generic(void *p_user_data);
195 
199  discmode_t get_discmode_generic (void *p_user_data );
200 
204  discmode_t get_discmode_cd_generic (void *p_user_data );
205 
210  int get_track_channels_generic(const void *p_user_data, track_t i_track);
211 
216  track_t i_track);
217 
223  track_flag_t get_track_preemphasis_generic(const void *p_user_data,
224  track_t i_track);
225 
232  uint8_t * read_cdtext_generic (void *p_env);
233 
234  void set_track_flags(track_flags_t *p_track_flag, uint8_t flag);
235 
238  void *p_buf, lsn_t i_lsn,
239  uint16_t i_blocksize,
240  uint32_t i_blocks);
241 #ifdef __cplusplus
242 }
243 #endif /* __cplusplus */
244 
245 #endif /* CDIO_DRIVER_GENERIC_H_ */
246 
247 
248 /*
249  * Local variables:
250  * c-file-style: "gnu"
251  * tab-width: 8
252  * indent-tabs-mode: nil
253  * End:
254  */
_CdioDataSource
Definition: _cdio_stream.c:48
generic_img_private_t::i_first_track
track_t i_first_track
Definition: generic.h:61
cdio_generic_unimplemented_eject_media
driver_return_code_t cdio_generic_unimplemented_eject_media(void *p_env)
Definition: _cdio_generic.c:73
cdio_generic_read_form1_sector
int cdio_generic_read_form1_sector(void *user_data, void *data, lsn_t lsn)
Definition: _cdio_generic.c:157
cdio.h
The top-level header for libcdio: the CD Input and Control library. Applications include this for any...
generic_img_private_t::source_name
char * source_name
Definition: generic.h:48
lsn_t
int32_t lsn_t
Definition: types.h:266
driver_return_code_t
driver_return_code_t
Definition: device.h:205
cdio_is_device_generic
bool cdio_is_device_generic(const char *source_name)
Definition: _cdio_generic.c:209
get_num_tracks_generic
track_t get_num_tracks_generic(void *p_user_data)
Definition: _cdio_generic.c:439
generic_img_private_t::toc_init
bool toc_init
Definition: generic.h:50
get_discmode_generic
discmode_t get_discmode_generic(void *p_user_data)
Definition: _cdio_generic.c:314
cdio_generic_free
void cdio_generic_free(void *p_env)
Definition: _cdio_generic.c:102
track_t
uint8_t track_t
Definition: types.h:276
generic_img_private_t::init
bool init
Definition: generic.h:49
cdio_generic_unimplemented_set_speed
driver_return_code_t cdio_generic_unimplemented_set_speed(void *p_user_data, int i_speed)
Definition: _cdio_generic.c:92
cdio_generic_read
ssize_t cdio_generic_read(void *p_env, void *p_buf, size_t size)
Definition: _cdio_generic.c:182
cdio_generic_unimplemented_set_blocksize
driver_return_code_t cdio_generic_unimplemented_set_blocksize(void *p_user_data, uint16_t i_blocksize)
Definition: _cdio_generic.c:82
generic_img_private_t::ioctls_debugged
int ioctls_debugged
Definition: generic.h:53
_CdIo
Definition: cdio_private.h:472
discmode_t
discmode_t
Definition: disc.h:37
generic_img_private_t::svd
iso9660_svd_t svd
Definition: generic.h:67
cdio_is_device_win32
bool cdio_is_device_win32(const char *source_name)
Definition: win32.c:904
cdio_is_device_quiet_generic
bool cdio_is_device_quiet_generic(const char *source_name)
Definition: _cdio_generic.c:224
generic_img_private_t::i_tracks
track_t i_tracks
Definition: generic.h:62
cdio_is_device_os2
bool cdio_is_device_os2(const char *source_name)
iso9660_svd_s
ISO-9660 Supplementary Volume Descriptor.
Definition: iso9660.h:400
generic_img_private_t::pvd
iso9660_pvd_t pvd
Definition: generic.h:66
read_data_sectors_generic
driver_return_code_t read_data_sectors_generic(void *p_user_data, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, uint32_t i_blocks)
Definition: _cdio_generic.c:511
generic_img_private_t::cdtext
cdtext_t * cdtext
Definition: generic.h:69
cdtext.h
The top-level header for CD-Text information. Applications include this for CD-Text access.
generic_img_private_t::scsi_mmc_sense_valid
int scsi_mmc_sense_valid
Definition: generic.h:78
CDIO_CD_MAX_TRACKS
Definition: track.h:77
get_first_track_num_generic
track_t get_first_track_num_generic(void *p_user_data)
Definition: _cdio_generic.c:424
generic_img_private_t::scsi_tuple
char * scsi_tuple
Definition: generic.h:89
generic_img_private_t::u_joliet_level
uint8_t u_joliet_level
Definition: generic.h:64
get_track_channels_generic
int get_track_channels_generic(const void *p_user_data, track_t i_track)
Definition: _cdio_generic.c:469
iso9660.h
The top-level interface header for libiso9660: the ISO-9660 filesystem library; applications include ...
set_track_flags
void set_track_flags(track_flags_t *p_track_flag, uint8_t flag)
Definition: _cdio_generic.c:498
track_flags_t
Structure containing attributes associated with a track.
Definition: track.h:50
generic_img_private_t::data_source
CdioDataSource_t * data_source
Definition: generic.h:59
generic_img_private_t::fd
int fd
Definition: generic.h:60
generic_img_private_t
Definition: generic.h:47
config.h
generic_img_private_t::b_cdtext_error
bool b_cdtext_error
Definition: generic.h:51
iso9660_pvd_s
ISO-9660 Primary Volume Descriptor.
Definition: iso9660.h:291
generic_img_private_t::cdio
CdIo_t * cdio
Definition: generic.h:68
cdio_generic_lseek
off_t cdio_generic_lseek(void *p_env, off_t offset, int whence)
Definition: _cdio_generic.c:170
read_cdtext_generic
uint8_t * read_cdtext_generic(void *p_env)
Definition: _cdio_generic.c:458
cdio_generic_stdio_free
void cdio_generic_stdio_free(void *env)
Definition: _cdio_generic.c:192
get_track_preemphasis_generic
track_flag_t get_track_preemphasis_generic(const void *p_user_data, track_t i_track)
Definition: _cdio_generic.c:491
source_name
char * source_name
Definition: util.c:39
cdtext_s
Definition: cdtext_private.h:127
track_flag_t
track_flag_t
Definition: track.h:42
get_cdtext_generic
cdtext_t * get_cdtext_generic(void *p_user_data)
Definition: _cdio_generic.c:280
get_discmode_cd_generic
discmode_t get_discmode_cd_generic(void *p_user_data)
Definition: _cdio_generic.c:349
get_track_copy_permit_generic
track_flag_t get_track_copy_permit_generic(void *p_user_data, track_t i_track)
Definition: _cdio_generic.c:479
cdio_generic_init
bool cdio_generic_init(void *p_env, int open_mode)
Definition: _cdio_generic.c:127