Lines Matching refs:atts

183 get_group_offset_count(const char **atts, uint32_t *offset, uint32_t *count,
189 for (i = 0; atts[i]; i += 2) {
190 if (strcmp(atts[i], "count") == 0) {
191 *count = strtoul(atts[i + 1], &p, 0);
194 } else if (strcmp(atts[i], "start") == 0) {
195 *offset = strtoul(atts[i + 1], &p, 0);
196 } else if (strcmp(atts[i], "size") == 0) {
197 *size = strtoul(atts[i + 1], &p, 0);
206 const char **atts,
222 get_group_offset_count(atts,
233 create_enum(struct parser_context *ctx, const char *name, const char **atts)
247 get_register_offset(const char **atts, uint32_t *offset)
252 for (i = 0; atts[i]; i += 2) {
253 if (strcmp(atts[i], "num") == 0)
254 *offset = strtoul(atts[i + 1], &p, 0);
340 create_field(struct parser_context *ctx, const char **atts)
349 for (i = 0; atts[i]; i += 2) {
350 if (strcmp(atts[i], "name") == 0)
351 field->name = xstrdup(atts[i + 1]);
352 else if (strcmp(atts[i], "start") == 0) {
353 field->start = strtoul(atts[i + 1], &p, 0);
354 if (is_byte_offset(atts[i + 1]))
356 } else if (strcmp(atts[i], "end") == 0) {
357 field->end = strtoul(atts[i + 1], &p, 0) - 1;
358 if (is_byte_offset(atts[i + 1]))
360 } else if (strcmp(atts[i], "size") == 0) {
361 size = strtoul(atts[i + 1], &p, 0);
362 if (is_byte_offset(atts[i + 1]))
364 } else if (strcmp(atts[i], "type") == 0)
365 field->type = string_to_type(ctx, atts[i + 1]);
366 else if (strcmp(atts[i], "default") == 0) {
368 field->default_value = strtoul(atts[i + 1], &p, 0);
369 } else if (strcmp(atts[i], "minus_one") == 0) {
370 assert(strcmp(atts[i + 1], "true") == 0);
382 create_value(struct parser_context *ctx, const char **atts)
386 for (int i = 0; atts[i]; i += 2) {
387 if (strcmp(atts[i], "name") == 0)
388 value->name = xstrdup(atts[i + 1]);
389 else if (strcmp(atts[i], "value") == 0)
390 value->value = strtoul(atts[i + 1], NULL, 0);
398 const char **atts)
408 ctx->group->fields[ctx->group->nfields++] = create_field(ctx, atts);
412 set_group_opcode(struct v3d_group *group, const char **atts)
417 for (i = 0; atts[i]; i += 2) {
418 if (strcmp(atts[i], "code") == 0)
419 group->opcode = strtoul(atts[i + 1], &p, 0);
444 start_element(void *data, const char *element_name, const char **atts)
455 for (i = 0; atts[i]; i += 2) {
456 if (strcmp(atts[i], "shortname") == 0)
457 name = atts[i + 1];
458 else if (strcmp(atts[i], "name") == 0 && !name)
459 name = atts[i + 1];
460 else if (strcmp(atts[i], "gen") == 0)
461 ver = atts[i + 1];
462 else if (strcmp(atts[i], "min_ver") == 0)
463 min_ver = strtoul(atts[i + 1], NULL, 0);
464 else if (strcmp(atts[i], "max_ver") == 0)
465 max_ver = strtoul(atts[i + 1], NULL, 0);
489 ctx->group = create_group(ctx, name, atts, NULL);
492 set_group_opcode(ctx->group, atts);
494 ctx->group = create_group(ctx, name, atts, NULL);
495 get_register_offset(atts, &ctx->group->register_offset);
501 struct v3d_group *group = create_group(ctx, "", atts,
506 create_and_append_field(ctx, atts);
508 ctx->enoom = create_enum(ctx, name, atts);
510 ctx->values[ctx->nvalues++] = create_value(ctx, atts);