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 5b0e06311Szk * Common Development and Distribution License (the "License"). 6b0e06311Szk * 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 /* 22b0e06311Szk * 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 #ifdef __cplusplus 307c478bd9Sstevel@tonic-gate extern "C" { 317c478bd9Sstevel@tonic-gate #endif 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #include "device.h" 34b0e06311Szk #include <hal/libhal.h> 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate extern int debug; 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gate extern int keep_disc_open; 397c478bd9Sstevel@tonic-gate extern int requested_speed; 407c478bd9Sstevel@tonic-gate extern int simulation; 417c478bd9Sstevel@tonic-gate extern int verbose; 427c478bd9Sstevel@tonic-gate extern char *image_file; 437c478bd9Sstevel@tonic-gate extern char *blanking_type; 447c478bd9Sstevel@tonic-gate extern int audio_type; 457c478bd9Sstevel@tonic-gate extern cd_device *target; /* Default target device */ 467c478bd9Sstevel@tonic-gate extern int extract_track_no; 477c478bd9Sstevel@tonic-gate extern char *extract_file; 487c478bd9Sstevel@tonic-gate extern char *alt_tmp_dir; 497c478bd9Sstevel@tonic-gate extern char *copy_src; 507c478bd9Sstevel@tonic-gate extern int vol_running; 517c478bd9Sstevel@tonic-gate extern int cflag, tflag; 527c478bd9Sstevel@tonic-gate extern uid_t ruid, cur_uid; 537c478bd9Sstevel@tonic-gate extern int device_type; 547c478bd9Sstevel@tonic-gate extern int write_mode; 557c478bd9Sstevel@tonic-gate 56b0e06311Szk typedef enum {DBUS_CONNECTION, HAL_CONTEXT, HAL_PAIRED, 57b0e06311Szk HAL_INITIALIZED} hal_state_t; 58b0e06311Szk 597c478bd9Sstevel@tonic-gate #define TAO_MODE 0 60b0e06311Szk #define DAO_MODE 1 /* not implemented for CD yet only DVD */ 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gate #define CD_RW 1 /* CD_RW/CD-R */ 637c478bd9Sstevel@tonic-gate #define DVD_MINUS 2 /* DVD-RW/DVD-R */ 647c478bd9Sstevel@tonic-gate 657c478bd9Sstevel@tonic-gate /* 667c478bd9Sstevel@tonic-gate * DVD+RW is listed differently from DVD+R since DVD+RW requires 67b0e06311Szk * that we format the media prior to writing, this cannot be 687c478bd9Sstevel@tonic-gate * done for DVD+R since it is write once media, we treat the 697c478bd9Sstevel@tonic-gate * media as pre-formatted. 707c478bd9Sstevel@tonic-gate */ 717c478bd9Sstevel@tonic-gate #define DVD_PLUS 3 /* DVD+R */ 727c478bd9Sstevel@tonic-gate #define DVD_PLUS_W 4 /* DVD+RW */ 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gate #define ALL 0 /* erase the complete media, slow */ 757c478bd9Sstevel@tonic-gate #define FAST 1 /* only erases the leadin and TOC */ 767c478bd9Sstevel@tonic-gate #define SESSION 6 /* erases the last session */ 777c478bd9Sstevel@tonic-gate #define LEADOUT 5 /* erases the leadout of the media */ 787c478bd9Sstevel@tonic-gate #define CLEAR 1 /* same as fast, used for fixing media */ 797c478bd9Sstevel@tonic-gate 80b0e06311Szk #define HAL_RDSK_PROP "block.solaris.raw_device" 81b0e06311Szk #define HAL_SYMDEV_PROP "storage.solaris.legacy.symdev" 82b0e06311Szk 83*aefd6f19Szk #define ONE_MB_BASE2 1048576 /* Number of bytes in 1 MB */ 84*aefd6f19Szk #define ONE_GB_BASE10 1000000000 /* Manufacturers use 1 GB = 10^9 B */ 85*aefd6f19Szk 867c478bd9Sstevel@tonic-gate int setup_target(int flag); 877c478bd9Sstevel@tonic-gate 88b0e06311Szk int hald_running(void); 89b0e06311Szk LibHalContext *attach_to_hald(void); 90b0e06311Szk void detach_from_hald(LibHalContext *ctx, hal_state_t state); 91b0e06311Szk 927c478bd9Sstevel@tonic-gate void info(void); 937c478bd9Sstevel@tonic-gate void list(void); 947c478bd9Sstevel@tonic-gate void write_image(void); 957c478bd9Sstevel@tonic-gate void blank(void); 967c478bd9Sstevel@tonic-gate void write_audio(char **argv, int start_argc, int argc); 977c478bd9Sstevel@tonic-gate void extract_audio(void); 987c478bd9Sstevel@tonic-gate void copy_cd(void); 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1017c478bd9Sstevel@tonic-gate } 1027c478bd9Sstevel@tonic-gate #endif 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate #endif /* _MAIN_H */ 105