3124 Remove any existing references to utmp, use utmpx instead
[unleashed.git] / usr / src / cmd / cdrw / main.h
blob58337381fb3d15ab76a05e90464a1e6dce231522
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _MAIN_H
27 #define _MAIN_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
35 #include "device.h"
36 #include <hal/libhal.h>
38 extern int debug;
40 extern int keep_disc_open;
41 extern int requested_speed;
42 extern int simulation;
43 extern int verbose;
44 extern char *image_file;
45 extern char *blanking_type;
46 extern int audio_type;
47 extern cd_device *target; /* Default target device */
48 extern int extract_track_no;
49 extern char *extract_file;
50 extern char *alt_tmp_dir;
51 extern char *copy_src;
52 extern int vol_running;
53 extern int cflag, tflag;
54 extern uid_t ruid, cur_uid;
55 extern int device_type;
56 extern int write_mode;
58 typedef enum {DBUS_CONNECTION, HAL_CONTEXT, HAL_PAIRED,
59 HAL_INITIALIZED} hal_state_t;
61 #define TAO_MODE 0
62 #define DAO_MODE 1 /* not implemented for CD yet only DVD */
64 #define CD_RW 1 /* CD_RW/CD-R */
65 #define DVD_MINUS 2 /* DVD-RW/DVD-R */
68 * DVD+RW is listed differently from DVD+R since DVD+RW requires
69 * that we format the media prior to writing, this cannot be
70 * done for DVD+R since it is write once media, we treat the
71 * media as pre-formatted.
73 #define DVD_PLUS 3 /* DVD+R */
74 #define DVD_PLUS_W 4 /* DVD+RW */
76 #define ALL 0 /* erase the complete media, slow */
77 #define FAST 1 /* only erases the leadin and TOC */
78 #define SESSION 6 /* erases the last session */
79 #define LEADOUT 5 /* erases the leadout of the media */
80 #define CLEAR 1 /* same as fast, used for fixing media */
82 #define HAL_RDSK_PROP "block.solaris.raw_device"
83 #define HAL_SYMDEV_PROP "storage.solaris.legacy.symdev"
85 #define ONE_MB_BASE2 1048576 /* Number of bytes in 1 MB */
86 #define ONE_GB_BASE10 1000000000 /* Manufacturers use 1 GB = 10^9 B */
88 int setup_target(int flag);
90 int hald_running(void);
91 LibHalContext *attach_to_hald(void);
92 void detach_from_hald(LibHalContext *ctx, hal_state_t state);
94 void info(void);
95 void list(void);
96 void write_image(void);
97 void blank(void);
98 void write_audio(char **argv, int start_argc, int argc);
99 void extract_audio(void);
100 void copy_cd(void);
102 #ifdef __cplusplus
104 #endif
106 #endif /* _MAIN_H */