2007-11-13 18:02:18 -08:00
|
|
|
/**
|
|
|
|
* OpenAL cross platform audio library
|
|
|
|
* Copyright (C) 1999-2007 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
|
2014-08-18 14:11:03 +02:00
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2007-11-13 18:02:18 -08:00
|
|
|
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
|
|
|
*/
|
|
|
|
|
2008-01-16 14:09:04 -08:00
|
|
|
#include "config.h"
|
|
|
|
|
2019-07-28 21:29:59 -07:00
|
|
|
#include <cctype>
|
2019-01-09 19:42:40 +01:00
|
|
|
#include <cstdlib>
|
|
|
|
#include <cstring>
|
2010-03-24 22:43:08 -07:00
|
|
|
|
2007-11-13 18:02:18 -08:00
|
|
|
#include "AL/al.h"
|
|
|
|
#include "AL/alc.h"
|
|
|
|
|
2019-07-28 21:29:59 -07:00
|
|
|
#include "alcontext.h"
|
2019-04-10 13:05:21 -07:00
|
|
|
#include "alexcpt.h"
|
2019-09-16 13:45:14 -07:00
|
|
|
#include "alstring.h"
|
2019-07-28 21:29:59 -07:00
|
|
|
#include "opthelpers.h"
|
|
|
|
|
2007-11-13 18:02:18 -08:00
|
|
|
|
2010-03-19 14:34:18 -07:00
|
|
|
AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extName)
|
2019-04-10 13:05:21 -07:00
|
|
|
START_API_FUNC
|
2007-11-13 18:02:18 -08:00
|
|
|
{
|
2018-11-16 06:08:25 -08:00
|
|
|
ContextRef context{GetContextRef()};
|
2019-08-04 11:59:14 -07:00
|
|
|
if UNLIKELY(!context) return AL_FALSE;
|
2010-03-16 17:35:51 -07:00
|
|
|
|
2018-01-24 17:07:01 -08:00
|
|
|
if(!extName)
|
2019-07-30 21:32:05 -07:00
|
|
|
SETERR_RETURN(context, AL_INVALID_VALUE, AL_FALSE, "NULL pointer");
|
2012-04-24 03:52:21 -07:00
|
|
|
|
2018-11-16 06:08:25 -08:00
|
|
|
size_t len{strlen(extName)};
|
2019-07-30 09:05:54 -07:00
|
|
|
const char *ptr{context->mExtensionList};
|
2013-10-07 12:05:39 -07:00
|
|
|
while(ptr && *ptr)
|
|
|
|
{
|
2019-09-16 13:45:14 -07:00
|
|
|
if(al::strncasecmp(ptr, extName, len) == 0 && (ptr[len] == '\0' || isspace(ptr[len])))
|
2018-11-16 06:08:25 -08:00
|
|
|
return AL_TRUE;
|
|
|
|
|
2019-01-07 12:37:13 +01:00
|
|
|
if((ptr=strchr(ptr, ' ')) != nullptr)
|
2007-11-13 18:02:18 -08:00
|
|
|
{
|
2013-10-07 12:05:39 -07:00
|
|
|
do {
|
|
|
|
++ptr;
|
|
|
|
} while(isspace(*ptr));
|
2007-11-13 18:02:18 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-16 06:08:25 -08:00
|
|
|
return AL_FALSE;
|
2007-11-13 18:02:18 -08:00
|
|
|
}
|
2019-04-10 13:05:21 -07:00
|
|
|
END_API_FUNC
|
2007-11-13 18:02:18 -08:00
|
|
|
|
|
|
|
|
2010-03-22 15:12:20 -07:00
|
|
|
AL_API ALvoid* AL_APIENTRY alGetProcAddress(const ALchar *funcName)
|
2019-04-10 13:05:21 -07:00
|
|
|
START_API_FUNC
|
2007-11-13 18:02:18 -08:00
|
|
|
{
|
2018-11-16 06:08:25 -08:00
|
|
|
if(!funcName) return nullptr;
|
|
|
|
return alcGetProcAddress(nullptr, funcName);
|
2007-11-13 18:02:18 -08:00
|
|
|
}
|
2019-04-10 13:05:21 -07:00
|
|
|
END_API_FUNC
|
2007-11-13 18:02:18 -08:00
|
|
|
|
2010-03-19 14:34:18 -07:00
|
|
|
AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *enumName)
|
2019-04-10 13:05:21 -07:00
|
|
|
START_API_FUNC
|
2007-11-13 18:02:18 -08:00
|
|
|
{
|
2019-01-08 19:42:44 +01:00
|
|
|
if(!enumName) return static_cast<ALenum>(0);
|
2018-11-16 06:08:25 -08:00
|
|
|
return alcGetEnumValue(nullptr, enumName);
|
2007-11-13 18:02:18 -08:00
|
|
|
}
|
2019-04-10 13:05:21 -07:00
|
|
|
END_API_FUNC
|