17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5b0e06311Szk194757 * Common Development and Distribution License (the "License"). 6b0e06311Szk194757 * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22b0e06311Szk194757 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _MAIN_H 277c478bd9Sstevel@tonic-gate #define _MAIN_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #ifdef __cplusplus 327c478bd9Sstevel@tonic-gate extern "C" { 337c478bd9Sstevel@tonic-gate #endif 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate #include "device.h" 36b0e06311Szk194757 #include <hal/libhal.h> 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gate extern int debug; 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate extern int keep_disc_open; 417c478bd9Sstevel@tonic-gate extern int requested_speed; 427c478bd9Sstevel@tonic-gate extern int simulation; 437c478bd9Sstevel@tonic-gate extern int verbose; 447c478bd9Sstevel@tonic-gate extern char *image_file; 457c478bd9Sstevel@tonic-gate extern char *blanking_type; 467c478bd9Sstevel@tonic-gate extern int audio_type; 477c478bd9Sstevel@tonic-gate extern cd_device *target; /* Default target device */ 487c478bd9Sstevel@tonic-gate extern int extract_track_no; 497c478bd9Sstevel@tonic-gate extern char *extract_file; 507c478bd9Sstevel@tonic-gate extern char *alt_tmp_dir; 517c478bd9Sstevel@tonic-gate extern char *copy_src; 527c478bd9Sstevel@tonic-gate extern int vol_running; 537c478bd9Sstevel@tonic-gate extern int cflag, tflag; 547c478bd9Sstevel@tonic-gate extern uid_t ruid, cur_uid; 557c478bd9Sstevel@tonic-gate extern int device_type; 567c478bd9Sstevel@tonic-gate extern int write_mode; 577c478bd9Sstevel@tonic-gate 58b0e06311Szk194757 typedef enum {DBUS_CONNECTION, HAL_CONTEXT, HAL_PAIRED, 59b0e06311Szk194757 HAL_INITIALIZED} hal_state_t; 60b0e06311Szk194757 617c478bd9Sstevel@tonic-gate #define TAO_MODE 0 62b0e06311Szk194757 #define DAO_MODE 1 /* not implemented for CD yet only DVD */ 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate #define CD_RW 1 /* CD_RW/CD-R */ 657c478bd9Sstevel@tonic-gate #define DVD_MINUS 2 /* DVD-RW/DVD-R */ 667c478bd9Sstevel@tonic-gate 677c478bd9Sstevel@tonic-gate /* 687c478bd9Sstevel@tonic-gate * DVD+RW is listed differently from DVD+R since DVD+RW requires 69b0e06311Szk194757 * that we format the media prior to writing, this cannot be 707c478bd9Sstevel@tonic-gate * done for DVD+R since it is write once media, we treat the 717c478bd9Sstevel@tonic-gate * media as pre-formatted. 727c478bd9Sstevel@tonic-gate */ 737c478bd9Sstevel@tonic-gate #define DVD_PLUS 3 /* DVD+R */ 747c478bd9Sstevel@tonic-gate #define DVD_PLUS_W 4 /* DVD+RW */ 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate #define ALL 0 /* erase the complete media, slow */ 777c478bd9Sstevel@tonic-gate #define FAST 1 /* only erases the leadin and TOC */ 787c478bd9Sstevel@tonic-gate #define SESSION 6 /* erases the last session */ 797c478bd9Sstevel@tonic-gate #define LEADOUT 5 /* erases the leadout of the media */ 807c478bd9Sstevel@tonic-gate #define CLEAR 1 /* same as fast, used for fixing media */ 817c478bd9Sstevel@tonic-gate 82b0e06311Szk194757 #define HAL_RDSK_PROP "block.solaris.raw_device" 83b0e06311Szk194757 #define HAL_SYMDEV_PROP "storage.solaris.legacy.symdev" 84b0e06311Szk194757 85*aefd6f19Szk194757 #define ONE_MB_BASE2 1048576 /* Number of bytes in 1 MB */ 86*aefd6f19Szk194757 #define ONE_GB_BASE10 1000000000 /* Manufacturers use 1 GB = 10^9 B */ 87*aefd6f19Szk194757 887c478bd9Sstevel@tonic-gate int setup_target(int flag); 897c478bd9Sstevel@tonic-gate 90b0e06311Szk194757 int hald_running(void); 91b0e06311Szk194757 LibHalContext *attach_to_hald(void); 92b0e06311Szk194757 void detach_from_hald(LibHalContext *ctx, hal_state_t state); 93b0e06311Szk194757 947c478bd9Sstevel@tonic-gate void info(void); 957c478bd9Sstevel@tonic-gate void list(void); 967c478bd9Sstevel@tonic-gate void write_image(void); 977c478bd9Sstevel@tonic-gate void blank(void); 987c478bd9Sstevel@tonic-gate void write_audio(char **argv, int start_argc, int argc); 997c478bd9Sstevel@tonic-gate void extract_audio(void); 1007c478bd9Sstevel@tonic-gate void copy_cd(void); 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1037c478bd9Sstevel@tonic-gate } 1047c478bd9Sstevel@tonic-gate #endif 1057c478bd9Sstevel@tonic-gate 1067c478bd9Sstevel@tonic-gate #endif /* _MAIN_H */ 107