/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "cr_spu.h"
#include "cr_error.h"
#include "cr_string.h"
#include <stdio.h>
/**
* \mainpage spu_loader
*
* \section Spu_loaderIntroduction Introduction
*
* Chromium consists of all the top-level files in the cr
* directory. The spu_loader module basically takes care of API dispatch,
* and OpenGL state management.
*
*/
{
}
const char *min,
const char *max )
{
return 0;
return 0;
return 0;
return 1;
}
const char *min,
const char *max )
{
return 0;
return 0;
return 0;
return 1;
}
const char *response,
const char *min,
const char *max )
{
case CR_BOOL:
case CR_INT:
case CR_FLOAT:
case CR_ENUM:
/* Make sure response string is present in the min string.
* For enums, the min string is a comma-separated list of valid values.
*/
{
if (!p)
return 0; /* invalid value! */
if (p[-1] != '\'')
return 0; /* right substring */
return 0; /* left substring */
return 1;
}
default:
return 0;
}
}
/**
* Make sure the response matches the opt's parameters (right number
* and type of values, etc.)
* Return 1 if OK, 0 if error.
*/
{
int i = 0;
int retval;
return 1;
/* skip leading [ for multi-value options */
/* multi-valued options must be enclosed in brackets */
if (*response != '[')
return 0;
response++; /* skip [ */
/* make sure min and max are bracketed as well */
if (min) {
min++;
}
if (max) {
max++;
}
}
for (;;)
{
{
retval = 0;
break;
}
{
break;
}
/* advance pointers to next item */
if (min)
{
min++;
while (*min == ' ')
min++;
}
if (max)
{
max++;
while (*max == ' ')
max++;
}
if (response)
{
response++;
while (*response == ' ')
response++;
}
}
return retval;
}
/** Use the default values for all the options:
*/
{
int i;
{
}
}
/**
* Find the index of the given enum value in the SPUOption's list of
* possible enum values.
* Return the enum index, or -1 if not found.
*/
{
/* first, find the right option */
char **values;
int i;
/* break into array of strings */
/* min string should be of form "'enum1', 'enum2', 'enum3', etc" */
/* search the array */
for (i = 0; values[i]; i++) {
/* find leading quote */
CRASSERT(e);
if (e) {
/* test for match */
return i;
}
}
}
/* enum value not found! */
return -1;
}
}
return -1;
}