zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
helpers.c File Reference
#include "config.h"
#include <stdlib.h>
#include <time.h>
#include <errno.h>
#include <stdarg.h>
#include "alMain.h"
#include <pthread.h>
#include <sched.h>

Go to the source code of this file.

Functions

voidal_calloc (size_t alignment, size_t size)
 
void al_free (void *ptr)
 
voidal_malloc (size_t alignment, size_t size)
 
void al_print (const char *type, const char *func, const char *fmt,...)
 
void DeleteCriticalSection (CRITICAL_SECTION *cs)
 
void EnterCriticalSection (CRITICAL_SECTION *cs)
 
void FillCPUCaps (ALuint capfilter)
 
void InitializeCriticalSection (CRITICAL_SECTION *cs)
 
void InitUIntMap (UIntMap *map, ALsizei limit)
 
ALenum InsertUIntMapEntry (UIntMap *map, ALuint key, ALvoid *value)
 
void LeaveCriticalSection (CRITICAL_SECTION *cs)
 
static void Lock (volatile ALenum *l)
 
ALvoidLookupUIntMapKey (UIntMap *map, ALuint key)
 
void ReadLock (RWLock *lock)
 
void ReadUnlock (RWLock *lock)
 
ALvoidRemoveUIntMapKey (UIntMap *map, ALuint key)
 
void ResetUIntMap (UIntMap *map)
 
void RestoreFPUMode (const FPUCtl *ctl)
 
void RWLockInit (RWLock *lock)
 
void SetMixerFPUMode (FPUCtl *ctl)
 
void SetRTPriority (void)
 
void Sleep (ALuint t)
 
ALuint timeGetTime (void)
 
static void Unlock (volatile ALenum *l)
 
void WriteLock (RWLock *lock)
 
void WriteUnlock (RWLock *lock)
 

Variables

ALuint CPUCapFlags = 0
 

Function Documentation

void* al_calloc ( size_t  alignment,
size_t  size 
)
void* al_malloc ( size_t  alignment,
size_t  size 
)

Definition at line 137 of file helpers.c.

References malloc, NULL, and ret.

Referenced by al_calloc().

void al_print ( const char *  type,
const char *  func,
const char *  fmt,
  ... 
)

Definition at line 450 of file helpers.c.

References i, LogFile, and str.

void DeleteCriticalSection ( CRITICAL_SECTION cs)

Definition at line 353 of file helpers.c.

References assert, and ret.

Referenced by alc_deinit_safe(), alcCaptureOpenDevice(), alcOpenDevice(), DestroyRingBuffer(), and FreeDevice().

void EnterCriticalSection ( CRITICAL_SECTION cs)

Definition at line 359 of file helpers.c.

References assert, and ret.

Referenced by ALCdevice_LockDefault(), LockLists(), ReadRingBuffer(), RingBufferSize(), and WriteRingBuffer().

void FillCPUCaps ( ALuint  capfilter)

Definition at line 73 of file helpers.c.

References BOOL(), CPU_CAP_NEON, CPU_CAP_SSE, CPUCapFlags, DWORD(), ERR, str, and TRACE.

Referenced by alc_initconfig().

void InitializeCriticalSection ( CRITICAL_SECTION cs)

Definition at line 334 of file helpers.c.

References assert, and ret.

Referenced by alc_init(), alcCaptureOpenDevice(), alcLoopbackOpenDeviceSOFT(), alcOpenDevice(), and CreateRingBuffer().

void LeaveCriticalSection ( CRITICAL_SECTION cs)

Definition at line 365 of file helpers.c.

References assert, and ret.

Referenced by ALCdevice_UnlockDefault(), ReadRingBuffer(), RingBufferSize(), UnlockLists(), and WriteRingBuffer().

static void Lock ( volatile ALenum l)
static

Definition at line 495 of file helpers.c.

References AL_TRUE.

Referenced by DECLARE_INTERFACE_(), ReadLock(), WriteLock(), and SDL_BWin::~SDL_BWin().

ALvoid* LookupUIntMapKey ( UIntMap map,
ALuint  key 
)
ALvoid* RemoveUIntMapKey ( UIntMap map,
ALuint  key 
)
void ResetUIntMap ( UIntMap map)

Definition at line 555 of file helpers.c.

References UIntMap::array, free, UIntMap::lock, UIntMap::maxsize, NULL, UIntMap::size, WriteLock(), and WriteUnlock().

Referenced by FreeContext(), and FreeDevice().

void RestoreFPUMode ( const FPUCtl ctl)
void SetMixerFPUMode ( FPUCtl ctl)
void Sleep ( ALuint  t)

Definition at line 406 of file helpers.c.

ALuint timeGetTime ( void  )

Definition at line 376 of file helpers.c.

References assert, NULL, and ret.

Referenced by NullProc(), and WaveProc().

static void Unlock ( volatile ALenum l)
static

Definition at line 501 of file helpers.c.

References AL_FALSE.

Referenced by DECLARE_INTERFACE_(), ReadLock(), ReadUnlock(), WriteUnlock(), and SDL_BWin::~SDL_BWin().

Variable Documentation

ALuint CPUCapFlags = 0

OpenAL cross platform audio library Copyright (C) 2011 by authors. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Or go to http://www.gnu.org/copyleft/lgpl.html

Definition at line 70 of file helpers.c.

Referenced by alcOpenDevice(), FillCPUCaps(), RestoreFPUMode(), SelectDirectMixer(), SelectHrtfMixer(), SelectSendMixer(), SetMixerFPUMode(), and UpdateDeviceParams().