filename | src/drivers/cdrom/drive.h |
changeset | 1097:d4807997e450 |
next | 1296:30ecee61f811 |
author | nkeynes |
date | Tue Feb 28 18:22:52 2012 +1000 (12 years ago) |
permissions | -rw-r--r-- |
last change | Add a GL-only video driver for android usage (since the Java code is responsible for creating the context) |
file | annotate | diff | log | raw |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00001.2 +++ b/src/drivers/cdrom/drive.h Tue Feb 28 18:22:52 2012 +10001.3 @@ -0,0 +1,97 @@1.4 +/**1.5 + * $Id$1.6 + *1.7 + * Host CD/DVD drive support.1.8 + *1.9 + * This module supplies functions to enumerate the physical drives in the1.10 + * host system, and open them as a cdrom disc.1.11 + *1.12 + * Note that cdrom_disc_t objects bound to a physical drive may update their1.13 + * TOC at any time, including setting disc_type to CDROM_DISC_NONE (to indicate1.14 + * no media present).1.15 + *1.16 + * Copyright (c) 2009 Nathan Keynes.1.17 + *1.18 + * This program is free software; you can redistribute it and/or modify1.19 + * it under the terms of the GNU General Public License as published by1.20 + * the Free Software Foundation; either version 2 of the License, or1.21 + * (at your option) any later version.1.22 + *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 of1.25 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1.26 + * GNU General Public License for more details.1.27 + */1.28 +1.29 +#ifndef cdrom_drive_H1.30 +#define cdrom_drive_H 11.31 +1.32 +#include <glib/glist.h>1.33 +#include "hook.h"1.34 +#include "drivers/cdrom/defs.h"1.35 +1.36 +#ifdef __cplusplus1.37 +extern "C" {1.38 +#endif1.39 +1.40 +1.41 +typedef struct cdrom_drive *cdrom_drive_t;1.42 +1.43 +typedef cdrom_disc_t (*cdrom_drive_open_fn_t)(cdrom_drive_t, ERROR *);1.44 +1.45 +/**1.46 + * A cdrom_device is a placeholder for a physical CD/DVD drive in the host1.47 + * system.1.48 + */1.49 +struct cdrom_drive {1.50 + /**1.51 + * System name for the device1.52 + */1.53 + const char *name;1.54 + /**1.55 + * Human-readable name of the device - normally the device's vendor1.56 + * and product name as returned by an Inquiry request.1.57 + */1.58 + const char *display_name;1.59 +1.60 + /**1.61 + * Implementation specific function to open the drive, returning a new1.62 + * cdrom_disc_t.1.63 + */1.64 + cdrom_drive_open_fn_t open;1.65 +};1.66 +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.69 +1.70 +1.71 +/**1.72 + * Native CD-ROM API - provided by drivers/cd_*.c1.73 + *1.74 + * A device name is either a system special file (most unixes) or a url of the1.75 + * form dvd://<identifier> or cd://<identifier>, where <identifier> is a system1.76 + * defined string that uniquely identifies a particular device.1.77 + */1.78 +1.79 +/**1.80 + * Return a list of cdrom_drive_t defining all CD/DVD drives in the host system.1.81 + */1.82 +GList *cdrom_drive_get_list();1.83 +1.84 +/**1.85 + *1.86 + */1.87 +cdrom_drive_t cdrom_drive_find( const char *name );1.88 +1.89 +/**1.90 + * Open a cdrom_drive_t previously obtained from the system.1.91 + *1.92 + * @return NULL on failure, otherwise a valid cdrom_disc_t that can be mounted.1.93 + */1.94 +cdrom_disc_t cdrom_drive_open( cdrom_drive_t drive, ERROR *err );1.95 +1.96 +#ifdef __cplusplus1.97 +}1.98 +#endif1.99 +1.100 +#endif /* !cdrom_drive_H */
.