libcdio  0.93
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 {
172  } driver_id_t;
173 
178  extern const driver_id_t cdio_drivers[];
179 
184  extern const driver_id_t cdio_device_drivers[];
185 
192  extern const driver_id_t cdio_os_driver;
193 
194 
202 LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MIN_DRIVER, "please use cdio_drivers") = DRIVER_AIX;
203 LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MIN_DEVICE_DRIVER, "please use cdio_device_drivers") = DRIVER_AIX;
204 LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DRIVER, "please use cdio_drivers") = DRIVER_NRG;
205 LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use cdio_device_drivers") = DRIVER_WIN32;
206 
219  typedef enum {
246 
256  driver_return_code_t cdio_close_tray (const char *psz_drive,
257  /*in/out*/ driver_id_t *p_driver_id);
258 
263  const char *cdio_driver_errmsg(driver_return_code_t drc);
264 
272 
279  driver_return_code_t cdio_eject_media_drive (const char *psz_drive);
280 
291  void cdio_free_device_list (char * device_list[]);
292 
306  char * cdio_get_default_device (const CdIo_t *p_cdio);
307 
315  char * cdio_get_default_device_driver (/*in/out*/ driver_id_t *p_driver_id);
316 
328  char ** cdio_get_devices (driver_id_t driver_id);
329 
366  char ** cdio_get_devices_with_cap (/*in*/ char *ppsz_search_devices[],
367  cdio_fs_anal_t capabilities, bool b_any);
368 
375  char ** cdio_get_devices_with_cap_ret (/*in*/ char* ppsz_search_devices[],
376  cdio_fs_anal_t capabilities,
377  bool b_any,
378  /*out*/ driver_id_t *p_driver_id);
379 
388  char ** cdio_get_devices_ret (/*in/out*/ driver_id_t *p_driver_id);
389 
402  void cdio_get_drive_cap (const CdIo_t *p_cdio,
403  cdio_drive_read_cap_t *p_read_cap,
404  cdio_drive_write_cap_t *p_write_cap,
405  cdio_drive_misc_cap_t *p_misc_cap);
406 
416  void cdio_get_drive_cap_dev (const char *device,
417  cdio_drive_read_cap_t *p_read_cap,
418  cdio_drive_write_cap_t *p_write_cap,
419  cdio_drive_misc_cap_t *p_misc_cap);
420 
427  const char * cdio_get_driver_name (const CdIo_t *p_cdio);
428 
434  const char * cdio_get_driver_name_from_id (driver_id_t driver_id);
435 
436 
444  driver_id_t cdio_get_driver_id (const CdIo_t *p_cdio);
445 
450  bool cdio_get_hwinfo ( const CdIo_t *p_cdio,
451  /*out*/ cdio_hwinfo_t *p_hw_info );
452 
453 
462  /*out*/ lsn_t *i_last_session);
463 
470  int cdio_get_media_changed(CdIo_t *p_cdio);
471 
474 
476  bool cdio_have_driver (driver_id_t driver_id);
477 
484  void cdio_destroy (CdIo_t *p_cdio);
485 
492  const char *cdio_driver_describe (driver_id_t driver_id);
493 
504  CdIo_t * cdio_open (const char *psz_source, driver_id_t driver_id);
505 
517  CdIo_t * cdio_open_am (const char *psz_source,
518  driver_id_t driver_id, const char *psz_access_mode);
519 
526  CdIo_t * cdio_open_bincue (const char *psz_cue_name);
527 
534  CdIo_t * cdio_open_am_bincue (const char *psz_cue_name,
535  const char *psz_access_mode);
536 
542  CdIo_t * cdio_open_cdrdao (const char *psz_toc_name);
543 
549  CdIo_t * cdio_open_am_cdrdao (const char *psz_toc_name,
550  const char *psz_access_mode);
551 
558  char * cdio_get_default_device_bincue(void);
559 
560  char **cdio_get_devices_bincue(void);
561 
567  char * cdio_get_default_device_cdrdao(void);
568 
569  char **cdio_get_devices_cdrdao(void);
570 
578  CdIo_t * cdio_open_cd (const char *device_name);
579 
587  CdIo_t * cdio_open_am_cd (const char *psz_device,
588  const char *psz_access_mode);
589 
596  CdIo_t * cdio_open_cue (const char *cue_name);
597 
607  CdIo_t * cdio_open_am_aix (const char *psz_source,
608  const char *psz_access_mode);
609 
619  CdIo_t * cdio_open_aix (const char *psz_source);
620 
630  char * cdio_get_default_device_aix(void);
631 
640  char **cdio_get_devices_aix(void);
641 
652  CdIo_t * cdio_open_bsdi (const char *psz_source);
653 
663  CdIo_t * cdio_open_am_bsdi (const char *psz_source,
664  const char *psz_access_mode);
665 
675  char * cdio_get_default_device_bsdi(void);
676 
685  char **cdio_get_devices_bsdi(void);
686 
695  CdIo_t * cdio_open_freebsd (const char *paz_psz_source);
696 
705  CdIo_t * cdio_open_am_freebsd (const char *psz_source,
706  const char *psz_access_mode);
707 
714  char * cdio_get_default_device_freebsd(void);
715 
720  char **cdio_get_devices_freebsd(void);
721 
733  CdIo_t * cdio_open_linux (const char *psz_source);
734 
742  CdIo_t * cdio_open_am_linux (const char *psz_source,
743  const char *access_mode);
744 
758  char * cdio_get_default_device_linux(void);
759 
764  char **cdio_get_devices_linux(void);
765 
773  CdIo_t * cdio_open_solaris (const char *psz_source);
774 
782  CdIo_t * cdio_open_am_solaris (const char *psz_source,
783  const char *psz_access_mode);
784 
798  char * cdio_get_default_device_solaris(void);
799 
804  char **cdio_get_devices_solaris(void);
805 
818  CdIo_t * cdio_open_osx (const char *psz_source);
819 
828  CdIo_t * cdio_open_am_osx (const char *psz_source,
829  const char *psz_access_mode);
830 
840  char * cdio_get_default_device_osx(void);
841 
846  char **cdio_get_devices_osx(void);
847 
856  CdIo_t * cdio_open_win32 (const char *psz_source);
857 
864  CdIo_t * cdio_open_am_win32 (const char *psz_source,
865  const char *psz_access_mode);
866 
878  char * cdio_get_default_device_win32(void);
879 
880  char **cdio_get_devices_win32(void);
881 
894  CdIo_t * cdio_open_os2 (const char *psz_source);
895 
904  CdIo_t * cdio_open_am_os2 (const char *psz_source,
905  const char *psz_access_mode);
906 
916  char * cdio_get_default_device_os2(void);
917 
922  char **cdio_get_devices_os2(void);
923 
930  CdIo_t * cdio_open_nrg (const char *psz_source);
931 
938  CdIo_t * cdio_open_am_nrg (const char *psz_source,
939  const char *psz_access_mode);
940 
949  char * cdio_get_default_device_nrg(void);
950 
951  char **cdio_get_devices_nrg(void);
952 
961  char *cdio_is_binfile(const char *bin_name);
962 
969  char *cdio_is_cuefile(const char *cue_name);
970 
978  bool cdio_is_nrg(const char *psz_nrg);
979 
987  bool cdio_is_tocfile(const char *psz_toc);
988 
998  bool cdio_is_device(const char *psz_source, driver_id_t driver_id);
999 
1004  int i_blocksize );
1005 
1022  driver_return_code_t cdio_set_speed ( const CdIo_t *p_cdio,
1023  int i_drive_speed );
1024 
1033  const char * cdio_get_arg (const CdIo_t *p_cdio, const char key[]);
1034 
1042  driver_return_code_t cdio_set_arg (CdIo_t *p_cdio, const char key[],
1043  const char value[]);
1044 
1048  bool cdio_init(void);
1049 
1050 #ifdef __cplusplus
1051 }
1052 #endif /* __cplusplus */
1053 
1064 
1065 #endif /* CDIO_DEVICE_H_ */
LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MIN_DRIVER,"please use cdio_drivers")
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:220
int cdio_fs_anal_t
Definition: types.h:321
char * cdio_get_default_device_solaris(void)
cdio_drive_cap_read_t debug_cdio_drive_cap_read_t
Definition: device.h:225
driver_return_code_t
Definition: device.h:219
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:167
Definition: device.h:97
int32_t lsn_t
Definition: types.h:265
char * cdio_get_default_device_cdrdao(void)
Definition: device.h:91
Definition: device.h:160
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
CdIo_t * cdio_open_am_bsdi(const char *psz_source, const char *psz_access_mode)
char * cdio_is_binfile(const char *bin_name)
char * cdio_get_default_device_os2(void)
Definition: device.h:134
Definition: device.h:239
Definition: device.h:77
Definition: device.h:162
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:159
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:170
Definition: device.h:161
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:235
Definition: device.h:158
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:171
Definition: device.h:240
char * cdio_get_default_device_bsdi(void)
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)
CdIo_t * cdio_open_am_os2(const char *psz_source, const char *psz_access_mode)
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:226
char ** cdio_get_devices_cdrdao(void)
CdIo_t * cdio_open_os2(const char *psz_source)
The top-level header for libcdio: the CD Input and Control library. Applications include this for any...
char ** cdio_get_devices_bincue(void)
char ** cdio_get_devices_bsdi(void)
char ** cdio_get_devices_os2(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:155
Definition: device.h:231
Definition: device.h:157
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_bsdi(const char *psz_source)
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:241
char * cdio_get_default_device_linux(void)
Definition: device.h:156
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:235
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:243
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:164
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