aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-01-19 20:02:40 -0800
committerChris Robinson <[email protected]>2008-01-19 20:02:40 -0800
commit543eb9d217fcc4ed09b275fcaa8df11539bb3167 (patch)
tree90dccbccd3b2229c9afb638253ea2b3932cf1add /Alc/ALc.c
parentbc963463f3f089a53375e3783c48340a50f65d09 (diff)
Don't use a multiple lists for extensions
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 83ff7ba4..bca519e2 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
+#include <ctype.h>
#include "alMain.h"
#include "alSource.h"
#include "AL/al.h"
@@ -78,26 +79,12 @@ struct {
///////////////////////////////////////////////////////
// STRING and EXTENSIONS
-typedef struct ALCextension_struct
-{
- ALCchar *extName;
- ALvoid *address;
-} ALCextension;
-
typedef struct ALCfunction_struct
{
ALCchar *funcName;
ALvoid *address;
} ALCfunction;
-static ALCextension alcExtensions[] = {
- { "ALC_ENUMERATE_ALL_EXT", (ALvoid *) NULL },
- { "ALC_ENUMERATION_EXT", (ALvoid *) NULL },
- { "ALC_EXT_CAPTURE", (ALvoid *) NULL },
- { "ALC_EXT_EFX", (ALvoid *) NULL },
- { NULL, (ALvoid *) NULL }
-};
-
static ALCfunction alcFunctions[] = {
{ "alcCreateContext", (ALvoid *) alcCreateContext },
{ "alcMakeContextCurrent", (ALvoid *) alcMakeContextCurrent },
@@ -835,18 +822,31 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize
ALCAPI ALCboolean ALCAPIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extName)
{
ALCboolean bResult = ALC_FALSE;
- ALsizei i = 0;
(void)device;
if (extName)
{
- while(alcExtensions[i].extName &&
- strcasecmp(alcExtensions[i].extName,extName) != 0)
- i++;
+ const char *ptr;
+ size_t len;
- if (alcExtensions[i].extName)
- bResult = ALC_TRUE;
+ len = strlen(extName);
+ ptr = alcExtensionList;
+ while(ptr && *ptr)
+ {
+ if(strncasecmp(ptr, extName, len) == 0 &&
+ (ptr[len] == '\0' || isspace(ptr[len])))
+ {
+ bResult = ALC_TRUE;
+ break;
+ }
+ if((ptr=strchr(ptr, ' ')) != NULL)
+ {
+ do {
+ ++ptr;
+ } while(isspace(*ptr));
+ }
+ }
}
else
SetALCError(ALC_INVALID_VALUE);