00001 #ifndef PA_UTIL_H 00002 #define PA_UTIL_H 00003 /* 00004 * $Id: pa_util.h 1083 2006-08-23 07:30:49Z rossb $ 00005 * Portable Audio I/O Library implementation utilities header 00006 * common implementation utilities and interfaces 00007 * 00008 * Based on the Open Source API proposed by Ross Bencina 00009 * Copyright (c) 1999-2002 Ross Bencina, Phil Burk 00010 * 00011 * Permission is hereby granted, free of charge, to any person obtaining 00012 * a copy of this software and associated documentation files 00013 * (the "Software"), to deal in the Software without restriction, 00014 * including without limitation the rights to use, copy, modify, merge, 00015 * publish, distribute, sublicense, and/or sell copies of the Software, 00016 * and to permit persons to whom the Software is furnished to do so, 00017 * subject to the following conditions: 00018 * 00019 * The above copyright notice and this permission notice shall be 00020 * included in all copies or substantial portions of the Software. 00021 * 00022 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00023 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00024 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00025 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 00026 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 00027 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 00028 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00029 */ 00030 00031 /* 00032 * The text above constitutes the entire PortAudio license; however, 00033 * the PortAudio community also makes the following non-binding requests: 00034 * 00035 * Any person wishing to distribute modifications to the Software is 00036 * requested to send the modifications to the original developer so that 00037 * they can be incorporated into the canonical version. It is also 00038 * requested that these non-binding requests be included along with the 00039 * license above. 00040 */ 00041 00050 #include "portaudio.h" 00051 00052 #ifdef __cplusplus 00053 extern "C" 00054 { 00055 #endif /* __cplusplus */ 00056 00057 00058 struct PaUtilHostApiRepresentation; 00059 00060 00075 PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **hostApi, 00076 PaHostApiTypeId type ); 00077 00078 00088 PaError PaUtil_DeviceIndexToHostApiDeviceIndex( 00089 PaDeviceIndex *hostApiDevice, PaDeviceIndex device, 00090 struct PaUtilHostApiRepresentation *hostApi ); 00091 00092 00109 void PaUtil_SetLastHostErrorInfo( PaHostApiTypeId hostApiType, long errorCode, 00110 const char *errorText ); 00111 00112 00113 00122 void PaUtil_DebugPrint( const char *format, ... ); 00123 00124 #ifdef PA_ENABLE_DEBUG_OUTPUT 00125 #define PA_DEBUG(x) PaUtil_DebugPrint x ; 00126 #else 00127 #define PA_DEBUG(x) 00128 #endif 00129 00130 00131 /* the following functions are implemented in a platform platform specific 00132 .c file 00133 */ 00134 00136 void *PaUtil_AllocateMemory( long size ); 00137 00138 00140 void PaUtil_FreeMemory( void *block ); 00141 00142 00149 int PaUtil_CountCurrentlyAllocatedBlocks( void ); 00150 00151 00157 void PaUtil_InitializeClock( void ); 00158 00159 00164 double PaUtil_GetTime( void ); 00165 00166 00167 /* void Pa_Sleep( long msec ); must also be implemented in per-platform .c file */ 00168 00169 00170 00171 #ifdef __cplusplus 00172 } 00173 #endif /* __cplusplus */ 00174 #endif /* PA_UTIL_H */