Lines Matching defs:info

275       if (cache->info[hash].name == NULL)
277 else if (!strcmp(name, cache->info[hash].name))
294 /** \brief Check if a value is in info->range. */
296 checkValue(const driOptionValue *v, const driOptionInfo *info)
298 switch (info->type) {
301 return (info->range.start._int == info->range.end._int ||
302 (v->_int >= info->range.start._int &&
303 v->_int <= info->range.end._int));
306 return (info->range.start._float == info->range.end._float ||
307 (v->_float >= info->range.start._float &&
308 v->_float <= info->range.end._float));
316 driParseOptionInfo(driOptionCache *info,
323 info->tableSize = 7;
324 info->info = calloc((size_t)1 << info->tableSize, sizeof(driOptionInfo));
325 info->values = calloc((size_t)1 << info->tableSize, sizeof(driOptionValue));
326 if (info->info == NULL || info->values == NULL) {
335 if (opt->info.type == DRI_SECTION) {
345 const char *name = opt->info.name;
346 int i = findOption(info, name);
347 driOptionInfo *optinfo = &info->info[i];
348 driOptionValue *optval = &info->values[i];
352 optinfo->type = opt->info.type;
353 optinfo->range = opt->info.range;
356 switch (opt->info.type) {
388 if (parseValue(&v, opt->info.type, envVal) &&
431 const char *name = opt->info.name;
440 if (opt->info.type == DRI_SECTION) {
456 types[opt->info.type]);
458 switch (opt->info.type) {
483 switch (opt->info.type) {
486 if (opt->info.range.start._int < opt->info.range.end._int) {
488 opt->info.range.start._int,
489 opt->info.range.end._int);
494 if (opt->info.range.start._float < opt->info.range.end._float) {
496 opt->info.range.start._float,
497 opt->info.range.end._float);
509 opt->desc, opt->info.type != DRI_ENUM ? "/" : "");
511 if (opt->info.type == DRI_ENUM) {
557 /* We don't have real line/column # info in static-config case: */
611 /** \brief Parse a list of ranges of type info->type. */
613 parseRange(driOptionInfo *info, const char *string)
627 if (!parseValue(&info->range.start, info->type, cp) ||
628 !parseValue(&info->range.end, info->type, sep+1)) {
632 if (info->type == DRI_INT &&
633 info->range.start._int >= info->range.end._int) {
637 if (info->type == DRI_FLOAT &&
638 info->range.start._float >= info->range.end._float) {
812 if (cache->info[opt].name == NULL)
816 else if (getenv(cache->info[opt].name)) {
821 cache->info[opt].name);
823 } else if (!parseValue(&cache->values[opt], cache->info[opt].type, value))
1143 /** \brief Initialize an option cache based on info */
1145 initOptionCache(driOptionCache *cache, const driOptionCache *info)
1147 unsigned i, size = 1 << info->tableSize;
1148 cache->info = info->info;
1149 cache->tableSize = info->tableSize;
1150 cache->values = malloc(((size_t)1 << info->tableSize) * sizeof(driOptionValue));
1155 memcpy(cache->values, info->values,
1156 ((size_t)1 << info->tableSize) * sizeof(driOptionValue));
1158 if (cache->info[i].type == DRI_STRING)
1159 XSTRDUP(cache->values[i]._string, info->values[i]._string);
1187 driParseConfigFiles(driOptionCache *cache, const driOptionCache *info,
1194 initOptionCache(cache, info);
1226 driDestroyOptionInfo(driOptionCache *info)
1228 driDestroyOptionCache(info);
1229 if (info->info) {
1230 uint32_t i, size = 1 << info->tableSize;
1232 if (info->info[i].name) {
1233 free(info->info[i].name);
1236 free(info->info);
1243 if (cache->info) {
1246 if (cache->info[i].type == DRI_STRING)
1258 return cache->info[i].name != NULL && cache->info[i].type == type;
1266 assert(cache->info[i].name != NULL);
1267 assert(cache->info[i].type == DRI_BOOL);
1276 assert(cache->info[i].name != NULL);
1277 assert(cache->info[i].type == DRI_INT || cache->info[i].type == DRI_ENUM);
1286 assert(cache->info[i].name != NULL);
1287 assert(cache->info[i].type == DRI_FLOAT);
1296 assert(cache->info[i].name != NULL);
1297 assert(cache->info[i].type == DRI_STRING);