comm: add -Wall
[unleashed.git] / usr / src / cmd / cdrw / bstream.h
blob4ef2f1428eac4e66ccd5e637c965dff72b2d60ca
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 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _BSTREAM_H
27 #define _BSTREAM_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
35 #include <sys/types.h>
37 struct _bstr_hndl {
38 int bstr_fd;
39 int (*bstr_read)(struct _bstr_hndl *h, uchar_t *buf, off_t size);
40 int (*bstr_write)(struct _bstr_hndl *h, uchar_t *buf, off_t size);
41 int (*bstr_close)(struct _bstr_hndl *h);
42 int (*bstr_size)(struct _bstr_hndl *h, off_t *size);
43 void (*bstr_rewind)(struct _bstr_hndl *h);
44 void *bstr_private;
46 typedef struct _bstr_hndl *bstreamhandle;
48 extern int str_errno;
50 * str_errno values
52 #define STR_ERR_NO_ERR 0
53 #define STR_ERR_NO_REG_FILE 1
54 #define STR_ERR_NO_READ_STDIN 2
55 #define STR_ERR_AU_READ_ERR 3
56 #define STR_ERR_AU_UNSUPPORTED_FORMAT 4
57 #define STR_ERR_AU_BAD_HEADER 5
58 #define STR_ERR_WAV_READ_ERR 6
59 #define STR_ERR_WAV_UNSUPPORTED_FORMAT 7
60 #define STR_ERR_WAV_BAD_HEADER 8
61 #define STR_ERR_ISO_BAD_HEADER 9
62 #define STR_ERR_ISO_READ_ERR 10
65 * Constants for the ISO 9660 standard
67 #define ISO9660_HEADER_SIZE 34816
68 #define ISO9660_BOOT_BLOCK_SIZE 32768
69 #define ISO9660_PRIMARY_DESC_SIZE 2048
70 #define ISO9660_STD_IDENT_OFFSET 1
72 bstreamhandle open_stdin_read_stream();
73 bstreamhandle open_file_read_stream(char *file);
74 bstreamhandle open_iso_read_stream(char *fname);
75 bstreamhandle open_au_read_stream(char *fname);
76 bstreamhandle open_wav_read_stream(char *fname);
77 bstreamhandle open_aur_read_stream(char *fname);
78 bstreamhandle open_au_write_stream(char *fname);
79 bstreamhandle open_wav_write_stream(char *fname);
80 bstreamhandle open_aur_write_stream(char *fname);
81 bstreamhandle open_file_write_stream(char *fname);
82 bstreamhandle open_temp_file_stream(void);
84 char *str_errno_to_string(int serrno);
85 int check_avail_temp_space(size_t req_size);
86 char *get_tmp_name(void);
88 #ifdef __cplusplus
90 #endif
92 #endif /* _BSTREAM_H */