1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/drivers/cdrom/drive.h Sat Feb 25 21:30:49 2012 +1000
1.7 + * Host CD/DVD drive support.
1.9 + * This module supplies functions to enumerate the physical drives in the
1.10 + * host system, and open them as a cdrom disc.
1.12 + * Note that cdrom_disc_t objects bound to a physical drive may update their
1.13 + * TOC at any time, including setting disc_type to CDROM_DISC_NONE (to indicate
1.14 + * no media present).
1.16 + * Copyright (c) 2009 Nathan Keynes.
1.18 + * This program is free software; you can redistribute it and/or modify
1.19 + * it under the terms of the GNU General Public License as published by
1.20 + * the Free Software Foundation; either version 2 of the License, or
1.21 + * (at your option) any later version.
1.23 + * This program is distributed in the hope that it will be useful,
1.24 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.25 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.26 + * GNU General Public License for more details.
1.29 +#ifndef cdrom_drive_H
1.30 +#define cdrom_drive_H 1
1.32 +#include <glib/glist.h>
1.34 +#include "drivers/cdrom/defs.h"
1.41 +typedef struct cdrom_drive *cdrom_drive_t;
1.43 +typedef cdrom_disc_t (*cdrom_drive_open_fn_t)(cdrom_drive_t, ERROR *);
1.46 + * A cdrom_device is a placeholder for a physical CD/DVD drive in the host
1.49 +struct cdrom_drive {
1.51 + * System name for the device
1.55 + * Human-readable name of the device - normally the device's vendor
1.56 + * and product name as returned by an Inquiry request.
1.58 + const char *display_name;
1.61 + * Implementation specific function to open the drive, returning a new
1.64 + cdrom_drive_open_fn_t open;
1.67 +typedef gboolean (*cdrom_drive_list_change_hook_t)( GList *drive_list, void *user_data );
1.68 +DECLARE_HOOK(cdrom_drive_list_change_hook, cdrom_drive_list_change_hook_t);
1.72 + * Native CD-ROM API - provided by drivers/cd_*.c
1.74 + * A device name is either a system special file (most unixes) or a url of the
1.75 + * form dvd://<identifier> or cd://<identifier>, where <identifier> is a system
1.76 + * defined string that uniquely identifies a particular device.
1.80 + * Return a list of cdrom_drive_t defining all CD/DVD drives in the host system.
1.82 +GList *cdrom_drive_get_list();
1.87 +cdrom_drive_t cdrom_drive_find( const char *name );
1.90 + * Open a cdrom_drive_t previously obtained from the system.
1.92 + * @return NULL on failure, otherwise a valid cdrom_disc_t that can be mounted.
1.94 +cdrom_disc_t cdrom_drive_open( cdrom_drive_t drive, ERROR *err );
1.100 +#endif /* !cdrom_drive_H */