libcdio  2.1.0
device.h
Go to the documentation of this file.
1 /* -*- c -*-
2 
3  Copyright (C) 2005-2006, 2008-2013 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 
25 #ifndef CDIO_DEVICE_H_
26 #define CDIO_DEVICE_H_
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31 
32 #include <cdio/types.h>
33 #include <cdio/cdio.h>
34 
36  typedef uint32_t cdio_drive_read_cap_t;
37  typedef uint32_t cdio_drive_write_cap_t;
38  typedef uint32_t cdio_drive_misc_cap_t;
39 
46  typedef enum {
65 
67  typedef enum {
85 
87  typedef enum {
111 
113  typedef enum {
118 
119 
122  typedef struct cdio_hwinfo
123  {
127  } cdio_hwinfo_t;
128 
129 
131  typedef enum {
137 
138 
151  typedef enum {
170  } driver_id_t;
171 
176  extern const driver_id_t cdio_drivers[];
177 
182  extern const driver_id_t cdio_device_drivers[];
183 
190  extern const driver_id_t cdio_os_driver;
191 
192 
205  typedef enum {
232 
243  driver_return_code_t cdio_close_tray (const char *psz_drive,
244  /*in/out*/ driver_id_t *p_driver_id);
245 
251  const char *cdio_driver_errmsg(driver_return_code_t drc);
252 
260 
267  driver_return_code_t cdio_eject_media_drive (const char *psz_drive);
268 
279  void cdio_free_device_list (char * device_list[]);
280 
295  char * cdio_get_default_device (const CdIo_t *p_cdio);
296 
304  char * cdio_get_default_device_driver (/*in/out*/ driver_id_t *p_driver_id);
305 
317  char ** cdio_get_devices (driver_id_t driver_id);
318 
355  char ** cdio_get_devices_with_cap (/*in*/ char *ppsz_search_devices[],
356  cdio_fs_anal_t capabilities, bool b_any);
357 
364  char ** cdio_get_devices_with_cap_ret (/*in*/ char* ppsz_search_devices[],
365  cdio_fs_anal_t capabilities,
366  bool b_any,
367  /*out*/ driver_id_t *p_driver_id);
368 
377  char ** cdio_get_devices_ret (/*in/out*/ driver_id_t *p_driver_id);
378 
391  void cdio_get_drive_cap (const CdIo_t *p_cdio,
392  cdio_drive_read_cap_t *p_read_cap,
393  cdio_drive_write_cap_t *p_write_cap,
394  cdio_drive_misc_cap_t *p_misc_cap);
395 
405  void cdio_get_drive_cap_dev (const char *device,
406  cdio_drive_read_cap_t *p_read_cap,
407  cdio_drive_write_cap_t *p_write_cap,
408  cdio_drive_misc_cap_t *p_misc_cap);
409 
418  const char * cdio_get_driver_name (const CdIo_t *p_cdio);
419 
423  const char * cdio_get_driver_name_from_id (driver_id_t driver_id);
424 
425 
435  driver_id_t cdio_get_driver_id (const CdIo_t *p_cdio);
436 
441  bool cdio_get_hwinfo ( const CdIo_t *p_cdio,
442  /*out*/ cdio_hwinfo_t *p_hw_info );
443 
444 
453  /*out*/ lsn_t *i_last_session);
454 
463  int cdio_get_media_changed(CdIo_t *p_cdio);
464 
467 
469  bool cdio_have_driver (driver_id_t driver_id);
470 
477  void cdio_destroy (CdIo_t *p_cdio);
478 
485  const char *cdio_driver_describe (driver_id_t driver_id);
486 
497  CdIo_t * cdio_open (const char *psz_source, driver_id_t driver_id);
498 
511  CdIo_t * cdio_open_am (const char *psz_source,
512  driver_id_t driver_id, const char *psz_access_mode);
513 
520  CdIo_t * cdio_open_bincue (const char *psz_cue_name);
521 
528  CdIo_t * cdio_open_am_bincue (const char *psz_cue_name,
529  const char *psz_access_mode);
530 
536  CdIo_t * cdio_open_cdrdao (const char *psz_toc_name);
537 
543  CdIo_t * cdio_open_am_cdrdao (const char *psz_toc_name,
544  const char *psz_access_mode);
545 
552  char * cdio_get_default_device_bincue(void);
553 
554  char **cdio_get_devices_bincue(void);
555 
561  char * cdio_get_default_device_cdrdao(void);
562 
563  char **cdio_get_devices_cdrdao(void);
564 
572  CdIo_t * cdio_open_cd (const char *device_name);
573 
581  CdIo_t * cdio_open_am_cd (const char *psz_device,
582  const char *psz_access_mode);
583 
590  CdIo_t * cdio_open_cue (const char *cue_name);
591 
601  CdIo_t * cdio_open_am_aix (const char *psz_source,
602  const char *psz_access_mode);
603 
613  CdIo_t * cdio_open_aix (const char *psz_source);
614 
624  char * cdio_get_default_device_aix(void);
625 
634  char **cdio_get_devices_aix(void);
635 
644  CdIo_t * cdio_open_freebsd (const char *paz_psz_source);
645 
654  CdIo_t * cdio_open_am_freebsd (const char *psz_source,
655  const char *psz_access_mode);
656 
663  char * cdio_get_default_device_freebsd(void);
664 
669  char **cdio_get_devices_freebsd(void);
670 
682  CdIo_t * cdio_open_linux (const char *psz_source);
683 
691  CdIo_t * cdio_open_am_linux (const char *psz_source,
692  const char *access_mode);
693 
707  char * cdio_get_default_device_linux(void);
708 
713  char **cdio_get_devices_linux(void);
714 
722  CdIo_t * cdio_open_solaris (const char *psz_source);
723 
731  CdIo_t * cdio_open_am_solaris (const char *psz_source,
732  const char *psz_access_mode);
733 
747  char * cdio_get_default_device_solaris(void);
748 
753  char **cdio_get_devices_solaris(void);
754 
767  CdIo_t * cdio_open_osx (const char *psz_source);
768 
777  CdIo_t * cdio_open_am_osx (const char *psz_source,
778  const char *psz_access_mode);
779 
789  char * cdio_get_default_device_osx(void);
790 
795  char **cdio_get_devices_osx(void);
796 
805  CdIo_t * cdio_open_win32 (const char *psz_source);
806 
813  CdIo_t * cdio_open_am_win32 (const char *psz_source,
814  const char *psz_access_mode);
815 
827  char * cdio_get_default_device_win32(void);
828 
829  char **cdio_get_devices_win32(void);
830 
837  CdIo_t * cdio_open_nrg (const char *psz_source);
838 
845  CdIo_t * cdio_open_am_nrg (const char *psz_source,
846  const char *psz_access_mode);
847 
856  char * cdio_get_default_device_nrg(void);
857 
858  char **cdio_get_devices_nrg(void);
859 
868  char *cdio_is_binfile(const char *bin_name);
869 
876  char *cdio_is_cuefile(const char *cue_name);
877 
885  bool cdio_is_nrg(const char *psz_nrg);
886 
894  bool cdio_is_tocfile(const char *psz_toc);
895 
905  bool cdio_is_device(const char *psz_source, driver_id_t driver_id);
906 
911  int i_blocksize );
912 
930  int i_drive_speed );
931 
939  const char * cdio_get_arg (const CdIo_t *p_cdio, const char key[]);
940 
948  driver_return_code_t cdio_set_arg (CdIo_t *p_cdio, const char key[],
949  const char value[]);
950 
954  bool cdio_init(void);
955 
956 #ifdef __cplusplus
957 }
958 #endif /* __cplusplus */
959 
970 
971 #endif /* CDIO_DEVICE_H_ */
CdIo_t * cdio_open_am_nrg(const char *psz_source, const char *psz_access_mode)
const char * cdio_get_driver_name_from_id(driver_id_t driver_id)
Definition: device.h:96
CdIo_t * cdio_open_osx(const char *psz_source)
CdIo_t * cdio_open_am_linux(const char *psz_source, const char *access_mode)
cdio_drive_cap_read_t
Definition: device.h:67
Definition: device.h:94
char ** cdio_get_devices_linux(void)
Common type definitions used pervasively in libcdio.
Definition: device.h:82
const driver_id_t cdio_os_driver
CdIo_t * cdio_open_am_cd(const char *psz_device, const char *psz_access_mode)
Definition: device.h:206
int cdio_fs_anal_t
Definition: types.h:322
char * cdio_get_default_device_solaris(void)
cdio_drive_cap_read_t debug_cdio_drive_cap_read_t
Definition: device.h:211
driver_return_code_t
Definition: device.h:205
Definition: device.h:55
Definition: device.h:56
Definition: device.h:132
CdIo_t * cdio_open_cd(const char *device_name)
CdIo_t * cdio_open_linux(const char *psz_source)
Definition: device.h:89
char * cdio_get_default_device_nrg(void)
Definition: device.h:62
Definition: device.h:165
Definition: device.h:97
int32_t lsn_t
Definition: types.h:266
char * cdio_get_default_device_cdrdao(void)
Definition: device.h:91
char * cdio_get_default_device_bincue(void)
driver_return_code_t cdio_eject_media(CdIo_t **p_cdio)
Definition: device.h:69
char * cdio_get_default_device_aix(void)
CdIo_t * cdio_open_am_solaris(const char *psz_source, const char *psz_access_mode)
Definition: device.h:152
uint32_t cdio_drive_write_cap_t
Definition: device.h:37
CdIo_t * cdio_open_bincue(const char *psz_cue_name)
char psz_revision[CDIO_MMC_HW_REVISION_LEN+1]
Definition: device.h:126
Definition: device.h:79
char * cdio_is_binfile(const char *bin_name)
Definition: device.h:134
Definition: device.h:225
Definition: device.h:77
Definition: device.h:160
Definition: device.h:73
uint32_t cdio_drive_read_cap_t
Definition: device.h:36
CdIo_t * cdio_open_cue(const char *cue_name)
Definition: device.h:93
driver_return_code_t cdio_set_speed(const CdIo_t *p_cdio, int i_drive_speed)
struct cdio_hwinfo cdio_hwinfo_t
Structure to return CD vendor, model, and revision-level strings obtained via the INQUIRY command...
CdIo_t * cdio_open(const char *psz_source, driver_id_t driver_id)
int cdio_get_media_changed(CdIo_t *p_cdio)
Definition: device.h:83
Definition: device.h:158
Definition: device.h:92
driver_return_code_t cdio_set_arg(CdIo_t *p_cdio, const char key[], const char value[])
cdio_drive_cap_misc_t
Drive capability bits returned by cdio_get_drive_cap() NOTE: Setting a bit here means the presence of...
Definition: device.h:46
Definition: device.h:48
Definition: device.h:168
Definition: device.h:159
void cdio_get_drive_cap(const CdIo_t *p_cdio, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap)
char * cdio_is_cuefile(const char *cue_name)
Definition: device.h:116
bool cdio_have_driver(driver_id_t driver_id)
void cdio_destroy(CdIo_t *p_cdio)
bool cdio_is_tocfile(const char *psz_toc)
bool cdio_get_hwinfo(const CdIo_t *p_cdio, cdio_hwinfo_t *p_hw_info)
const driver_id_t cdio_drivers[]
cdio_src_category_mask_t debug_cdio_src_category_mask
Definition: device.h:60
void cdio_free_device_list(char *device_list[])
driver_return_code_t cdio_get_last_session(CdIo_t *p_cdio, lsn_t *i_last_session)
Definition: device.h:81
char * cdio_get_default_device(const CdIo_t *p_cdio)
Definition: device.h:221
Definition: device.h:157
char ** cdio_get_devices_solaris(void)
cdio_mmc_hw_len_t
Definition: device.h:113
Definition: device.h:90
bool cdio_is_device(const char *psz_source, driver_id_t driver_id)
CdIo_t * cdio_open_am_bincue(const char *psz_cue_name, const char *psz_access_mode)
Definition: device.h:169
Definition: device.h:226
bool cdio_is_nrg(const char *psz_nrg)
cdio_src_category_mask_t
Definition: device.h:131
const char * cdio_driver_describe(driver_id_t driver_id)
bool_3way_t cdio_have_atapi(CdIo_t *p_cdio)
const char * cdio_get_arg(const CdIo_t *p_cdio, const char key[])
Definition: device.h:70
char ** cdio_get_devices(driver_id_t driver_id)
Definition: device.h:212
char ** cdio_get_devices_cdrdao(void)
The top-level header for libcdio: the CD Input and Control library. Applications include this for any...
char ** cdio_get_devices_bincue(void)
Definition: device.h:59
char ** cdio_get_devices_osx(void)
Definition: device.h:47
CdIo_t * cdio_open_am_win32(const char *psz_source, const char *psz_access_mode)
const driver_id_t cdio_device_drivers[]
driver_id_t
Definition: device.h:151
CdIo_t * cdio_open_nrg(const char *psz_source)
Definition: device.h:68
Definition: device.h:217
Definition: device.h:156
char ** cdio_get_devices_win32(void)
Structure to return CD vendor, model, and revision-level strings obtained via the INQUIRY command...
Definition: device.h:122
CdIo_t * cdio_open_win32(const char *psz_source)
struct _CdIo CdIo_t
Definition: cdio.h:47
CdIo_t * cdio_open_am_freebsd(const char *psz_source, const char *psz_access_mode)
Definition: device.h:74
Definition: device.h:88
Definition: device.h:78
CdIo_t * cdio_open_aix(const char *psz_source)
char * cdio_get_default_device_driver(driver_id_t *p_driver_id)
CdIo_t * cdio_open_am(const char *psz_source, driver_id_t driver_id, const char *psz_access_mode)
CdIo_t * cdio_open_solaris(const char *psz_source)
Definition: device.h:95
Definition: device.h:227
char * cdio_get_default_device_linux(void)
Definition: device.h:155
Definition: device.h:72
Definition: device.h:114
Definition: device.h:80
char psz_model[CDIO_MMC_HW_MODEL_LEN+1]
Definition: device.h:125
CdIo_t * cdio_open_am_osx(const char *psz_source, const char *psz_access_mode)
Definition: device.h:75
Definition: device.h:101
bool_3way_t
Definition: types.h:236
Definition: device.h:57
CdIo_t * cdio_open_freebsd(const char *paz_psz_source)
const char * cdio_get_driver_name(const CdIo_t *p_cdio)
char ** cdio_get_devices_freebsd(void)
Definition: device.h:52
Definition: device.h:76
char ** cdio_get_devices_nrg(void)
CdIo_t * cdio_open_am_aix(const char *psz_source, const char *psz_access_mode)
char ** cdio_get_devices_aix(void)
cdio_drive_cap_write_t
Definition: device.h:87
void cdio_get_drive_cap_dev(const char *device, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap)
char * cdio_get_default_device_win32(void)
driver_return_code_t cdio_close_tray(const char *psz_drive, driver_id_t *p_driver_id)
Definition: device.h:61
Definition: device.h:54
cdio_drive_cap_misc_t debug_cdio_drive_cap_misc
char ** cdio_get_devices_ret(driver_id_t *p_driver_id)
char psz_vendor[CDIO_MMC_HW_VENDOR_LEN+1]
Definition: device.h:124
driver_return_code_t cdio_eject_media_drive(const char *psz_drive)
Definition: device.h:229
Definition: device.h:133
driver_id_t cdio_get_driver_id(const CdIo_t *p_cdio)
bool cdio_init(void)
uint32_t cdio_drive_misc_cap_t
Definition: device.h:38
Definition: device.h:162
CdIo_t * cdio_open_cdrdao(const char *psz_toc_name)
driver_return_code_t cdio_set_blocksize(const CdIo_t *p_cdio, int i_blocksize)
char ** cdio_get_devices_with_cap_ret(char *ppsz_search_devices[], cdio_fs_anal_t capabilities, bool b_any, driver_id_t *p_driver_id)
Definition: device.h:154
Definition: device.h:71
const char * cdio_driver_errmsg(driver_return_code_t drc)
char ** cdio_get_devices_with_cap(char *ppsz_search_devices[], cdio_fs_anal_t capabilities, bool b_any)
char * cdio_get_default_device_freebsd(void)
cdio_mmc_hw_len_t debug_cdio_mmc_hw_len
CdIo_t * cdio_open_am_cdrdao(const char *psz_toc_name, const char *psz_access_mode)
Definition: device.h:107
cdio_drive_cap_write_t debug_drive_cap_write_t
char * cdio_get_default_device_osx(void)
Definition: device.h:115
Definition: device.h:135