dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / audio / include / libaudio_impl.h
blob9a8f3774747d172d4384899ca0023c7ed490d69f
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)reallocarray((char *)(ptr), (unsigned)(number), \
70 sizeof (type))
71 #define FREE(ptr) \
72 (void) free((char *)(ptr))
75 * START_C_FUNC - declare this function with C linkage
76 * END_C_FUNC - put at the end of the function
78 #define START_C_FUNC extern "C" {
79 #define END_C_FUNC }
81 #ifdef __cplusplus
83 #endif
85 #endif /* !_MULTIMEDIA_LIBAUDIO_IMPL_H */