xref: /titanic_51/usr/src/cmd/cdrw/main.h (revision a4673f2e068def55ca76a8c25b603630d96868c5)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_MAIN_H
27 #define	_MAIN_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 #include "device.h"
36 #include <hal/libhal.h>
37 
38 extern int debug;
39 
40 extern int		use_media_stated_capacity;
41 extern int		keep_disc_open;
42 extern int		requested_speed;
43 extern int		simulation;
44 extern int		verbose;
45 extern char		*image_file;
46 extern char		*blanking_type;
47 extern int		audio_type;
48 extern cd_device	*target;		/* Default target device */
49 extern int		extract_track_no;
50 extern char		*extract_file;
51 extern char		*alt_tmp_dir;
52 extern char		*copy_src;
53 extern int		vol_running;
54 extern int		cflag, tflag;
55 extern uid_t		ruid, cur_uid;
56 extern int		device_type;
57 extern int		write_mode;
58 
59 typedef enum {DBUS_CONNECTION, HAL_CONTEXT, HAL_PAIRED,
60     HAL_INITIALIZED} hal_state_t;
61 
62 #define	TAO_MODE	0
63 #define	DAO_MODE	1	/* not implemented for CD yet only DVD */
64 
65 #define	CD_RW		1		/* CD_RW/CD-R	*/
66 #define	DVD_MINUS	2		/* DVD-RW/DVD-R	*/
67 
68 /*
69  * DVD+RW is listed differently from DVD+R since DVD+RW requires
70  * that we format the media prior to writing, this cannot be
71  * done for DVD+R since it is write once media, we treat the
72  * media as pre-formatted.
73  */
74 #define	DVD_PLUS	3		/* DVD+R	*/
75 #define	DVD_PLUS_W	4		/* DVD+RW	*/
76 
77 #define	ALL		0	/* erase the complete media, slow */
78 #define	FAST		1	/* only erases the leadin and TOC */
79 #define	SESSION		6	/* erases the last session */
80 #define	LEADOUT		5	/* erases the leadout of the media */
81 #define	CLEAR		1	/* same as fast, used for fixing media */
82 
83 #define	HAL_RDSK_PROP	"block.solaris.raw_device"
84 #define	HAL_SYMDEV_PROP	"storage.solaris.legacy.symdev"
85 
86 int setup_target(int flag);
87 
88 int hald_running(void);
89 LibHalContext *attach_to_hald(void);
90 void detach_from_hald(LibHalContext *ctx, hal_state_t state);
91 
92 void info(void);
93 void list(void);
94 void write_image(void);
95 void blank(void);
96 void write_audio(char **argv, int start_argc, int argc);
97 void extract_audio(void);
98 void copy_cd(void);
99 
100 #ifdef	__cplusplus
101 }
102 #endif
103 
104 #endif /* _MAIN_H */
105