xref: /titanic_52/usr/src/cmd/audio/include/AudioUnixfile_inline.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1990-2001 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef _MULTIMEDIA_AUDIOUNIXFILE_INLINE_H
28 #define	_MULTIMEDIA_AUDIOUNIXFILE_INLINE_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 // Inline routines for class AudioUnixfile
37 
38 // Return the file descriptor
39 inline int AudioUnixfile::
40 getfd() const {
41 	return (fd);
42 }
43 
44 // Set the file descriptor
45 inline void AudioUnixfile::
46 setfd(
47 	int newfd)				// new file descriptor
48 {
49 	fd = newfd;
50 }
51 
52 
53 // Return TRUE if fd is valid
54 inline Boolean AudioUnixfile::
55 isfdset() const {
56 
57 	return (fd >= 0);
58 }
59 
60 // Return TRUE if file hdr read/written
61 inline Boolean AudioUnixfile::
62 isfilehdrset() const {
63 
64 	return (filehdrset);
65 }
66 
67 // Return TRUE if stream is open
68 inline Boolean AudioUnixfile::
69 opened() const {
70 
71 	return (isfdset() && isfilehdrset());
72 }
73 
74 // Return the access mode
75 inline FileAccess AudioUnixfile::
76 GetAccess() const {
77 	return (mode);
78 }
79 
80 // Return the blocking i/o mode
81 inline Boolean AudioUnixfile::
82 GetBlocking() const {
83 	return (block);
84 }
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif /* !_MULTIMEDIA_AUDIOUNIXFILE_INLINE_H */
91