8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / audio / include / libaudio_impl.h
blobe83b6c53f1bd0f8f1d85657bcb553869288f3d97
1 /*
2 * CDDL HEADER START
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.
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.
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]
20 * CDDL HEADER END
23 * Copyright (c) 1992-2001 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #ifndef _MULTIMEDIA_LIBAUDIO_IMPL_H
28 #define _MULTIMEDIA_LIBAUDIO_IMPL_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <malloc.h>
33 #include <unistd.h>
34 #include <stdlib.h>
35 #include <sys/types.h>
36 #include <libaudio.h>
37 #include <archdep.h>
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
44 * Useful defines
46 * CALLOC - allocate memory and clear it
47 * foo = CALLOC(15, char *); -- alloc 15 ptrs
49 * MALLOC - allocate memory
50 * foo = MALLOC(struct foobar); -- alloc 1 foobar
52 * REALLOC - re-allocate a larger amount of memory
53 * foo = REALLOC(foo, 10, struct foo); -- extend to 10 foos
55 * FREE - de-allocate memory
57 * NOTE: These routines all operate on objects they can take the size of,
58 * rather than byte counts.
61 * XXX - the (long) in the following defines is used to make
62 * XXX lint shut up about pointer alignment problems.
64 #define MALLOC(type) \
65 (type *)(long)malloc(sizeof (type))
66 #define CALLOC(number, type) \
67 (type *)(long)calloc((unsigned)(number), sizeof (type))
68 #define REALLOC(ptr, number, type) \
69 (type *)(long)realloc((char *)(ptr), (unsigned)(number) * sizeof (type))
70 #define FREE(ptr) \
71 (void) free((char *)(ptr))
74 * START_C_FUNC - declare this function with C linkage
75 * END_C_FUNC - put at the end of the function
77 #define START_C_FUNC extern "C" {
78 #define END_C_FUNC }
80 #ifdef __cplusplus
82 #endif
84 #endif /* !_MULTIMEDIA_LIBAUDIO_IMPL_H */