a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/*
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * CDDL HEADER START
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * The contents of this file are subject to the terms of the
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Common Development and Distribution License (the "License").
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * You may not use this file except in compliance with the License.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * or http://www.opensolaris.org/os/licensing.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * See the License for the specific language governing permissions
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * and limitations under the License.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * When distributing Covered Code, include this CDDL HEADER in each
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * If applicable, add the following below this CDDL HEADER, with the
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * fields enclosed by brackets "[]" replaced with your own identifying
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * information: Portions Copyright [yyyy] [name of copyright owner]
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * CDDL HEADER END
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/*
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Use is subject to license terms.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#ifndef _BSTREAM_H
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define _BSTREAM_H
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#pragma ident "%Z%%M% %I% %E% SMI"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#ifdef __cplusplus
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncextern "C" {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#endif
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#include <sys/types.h>
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct _bstr_hndl {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync int bstr_fd;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync int (*bstr_read)(struct _bstr_hndl *h, uchar_t *buf, off_t size);
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync int (*bstr_write)(struct _bstr_hndl *h, uchar_t *buf, off_t size);
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync int (*bstr_close)(struct _bstr_hndl *h);
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync int (*bstr_size)(struct _bstr_hndl *h, off_t *size);
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync void (*bstr_rewind)(struct _bstr_hndl *h);
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync void *bstr_private;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync};
typedef struct _bstr_hndl *bstreamhandle;
extern int str_errno;
/*
* str_errno values
*/
#define STR_ERR_NO_ERR 0
#define STR_ERR_NO_REG_FILE 1
#define STR_ERR_NO_READ_STDIN 2
#define STR_ERR_AU_READ_ERR 3
#define STR_ERR_AU_UNSUPPORTED_FORMAT 4
#define STR_ERR_AU_BAD_HEADER 5
#define STR_ERR_WAV_READ_ERR 6
#define STR_ERR_WAV_UNSUPPORTED_FORMAT 7
#define STR_ERR_WAV_BAD_HEADER 8
#define STR_ERR_ISO_BAD_HEADER 9
#define STR_ERR_ISO_READ_ERR 10
/*
* Constants for the ISO 9660 standard
*/
#define ISO9660_HEADER_SIZE 34816
#define ISO9660_BOOT_BLOCK_SIZE 32768
#define ISO9660_PRIMARY_DESC_SIZE 2048
#define ISO9660_STD_IDENT_OFFSET 1
bstreamhandle open_stdin_read_stream();
bstreamhandle open_file_read_stream(char *file);
bstreamhandle open_iso_read_stream(char *fname);
bstreamhandle open_au_read_stream(char *fname);
bstreamhandle open_wav_read_stream(char *fname);
bstreamhandle open_aur_read_stream(char *fname);
bstreamhandle open_au_write_stream(char *fname);
bstreamhandle open_wav_write_stream(char *fname);
bstreamhandle open_aur_write_stream(char *fname);
bstreamhandle open_file_write_stream(char *fname);
bstreamhandle open_temp_file_stream(void);
char *str_errno_to_string(int serrno);
int check_avail_temp_space(size_t req_size);
char *get_tmp_name(void);
#ifdef __cplusplus
}
#endif
#endif /* _BSTREAM_H */