4 * Host CD/DVD drive support.
6 * This module supplies functions to enumerate the physical drives in the
7 * host system, and open them as a cdrom disc.
9 * Note that cdrom_disc_t objects bound to a physical drive may update their
10 * TOC at any time, including setting disc_type to CDROM_DISC_NONE (to indicate
13 * Copyright (c) 2009 Nathan Keynes.
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
27 #define cdrom_drive_H 1
29 #include <glib/glist.h>
31 #include "drivers/cdrom/defs.h"
38 typedef struct cdrom_drive *cdrom_drive_t;
40 typedef cdrom_disc_t (*cdrom_drive_open_fn_t)(cdrom_drive_t, ERROR *);
43 * A cdrom_device is a placeholder for a physical CD/DVD drive in the host
48 * System name for the device
52 * Human-readable name of the device - normally the device's vendor
53 * and product name as returned by an Inquiry request.
55 const char *display_name;
58 * Implementation specific function to open the drive, returning a new
61 cdrom_drive_open_fn_t open;
64 typedef gboolean (*cdrom_drive_list_change_hook_t)( GList *drive_list, void *user_data );
65 DECLARE_HOOK(cdrom_drive_list_change_hook, cdrom_drive_list_change_hook_t);
69 * Native CD-ROM API - provided by drivers/cd_*.c
71 * A device name is either a system special file (most unixes) or a url of the
72 * form dvd://<identifier> or cd://<identifier>, where <identifier> is a system
73 * defined string that uniquely identifies a particular device.
77 * Return a list of cdrom_drive_t defining all CD/DVD drives in the host system.
79 GList *cdrom_drive_get_list();
84 cdrom_drive_t cdrom_drive_find( const char *name );
87 * Open a cdrom_drive_t previously obtained from the system.
89 * @return NULL on failure, otherwise a valid cdrom_disc_t that can be mounted.
91 cdrom_disc_t cdrom_drive_open( cdrom_drive_t drive, ERROR *err );
97 #endif /* !cdrom_drive_H */
.