Lines Matching refs:atts
194 get_group_offset_count(const char **atts, uint32_t *offset, uint32_t *count,
200 for (i = 0; atts[i]; i += 2) {
201 if (strcmp(atts[i], "count") == 0) {
202 *count = strtoul(atts[i + 1], &p, 0);
205 } else if (strcmp(atts[i], "start") == 0) {
206 *offset = strtoul(atts[i + 1], &p, 0);
207 } else if (strcmp(atts[i], "size") == 0) {
208 *size = strtoul(atts[i + 1], &p, 0);
217 const char **atts,
233 get_group_offset_count(atts,
244 create_enum(struct parser_context *ctx, const char *name, const char **atts)
258 get_register_offset(const char **atts, uint32_t *offset)
263 for (i = 0; atts[i]; i += 2) {
264 if (strcmp(atts[i], "num") == 0)
265 *offset = strtoul(atts[i + 1], &p, 0);
351 create_field(struct parser_context *ctx, const char **atts)
360 for (i = 0; atts[i]; i += 2) {
361 if (strcmp(atts[i], "name") == 0)
362 field->name = xstrdup(atts[i + 1]);
363 else if (strcmp(atts[i], "start") == 0) {
364 field->start = strtoul(atts[i + 1], &p, 0);
365 if (is_byte_offset(atts[i + 1]))
367 } else if (strcmp(atts[i], "end") == 0) {
368 field->end = strtoul(atts[i + 1], &p, 0) - 1;
369 if (is_byte_offset(atts[i + 1]))
371 } else if (strcmp(atts[i], "size") == 0) {
372 size = strtoul(atts[i + 1], &p, 0);
373 if (is_byte_offset(atts[i + 1]))
375 } else if (strcmp(atts[i], "type") == 0)
376 field->type = string_to_type(ctx, atts[i + 1]);
377 else if (strcmp(atts[i], "default") == 0) {
379 field->default_value = strtoul(atts[i + 1], &p, 0);
380 } else if (strcmp(atts[i], "minus_one") == 0) {
381 assert(strcmp(atts[i + 1], "true") == 0);
393 create_value(struct parser_context *ctx, const char **atts)
397 for (int i = 0; atts[i]; i += 2) {
398 if (strcmp(atts[i], "name") == 0)
399 value->name = xstrdup(atts[i + 1]);
400 else if (strcmp(atts[i], "value") == 0)
401 value->value = strtoul(atts[i + 1], NULL, 0);
409 const char **atts)
419 ctx->group->fields[ctx->group->nfields++] = create_field(ctx, atts);
423 set_group_opcode(struct v3d_group *group, const char **atts)
428 for (i = 0; atts[i]; i += 2) {
429 if (strcmp(atts[i], "code") == 0)
430 group->opcode = strtoul(atts[i + 1], &p, 0);
455 start_element(void *data, const char *element_name, const char **atts)
466 for (i = 0; atts[i]; i += 2) {
467 if (strcmp(atts[i], "shortname") == 0)
468 name = atts[i + 1];
469 else if (strcmp(atts[i], "name") == 0 && !name)
470 name = atts[i + 1];
471 else if (strcmp(atts[i], "gen") == 0)
472 ver = atts[i + 1];
473 else if (strcmp(atts[i], "min_ver") == 0)
474 min_ver = strtoul(atts[i + 1], NULL, 0);
475 else if (strcmp(atts[i], "max_ver") == 0)
476 max_ver = strtoul(atts[i + 1], NULL, 0);
500 ctx->group = create_group(ctx, name, atts, NULL);
503 set_group_opcode(ctx->group, atts);
505 ctx->group = create_group(ctx, name, atts, NULL);
506 get_register_offset(atts, &ctx->group->register_offset);
512 struct v3d_group *group = create_group(ctx, "", atts,
517 create_and_append_field(ctx, atts);
519 ctx->enoom = create_enum(ctx, name, atts);
521 ctx->values[ctx->nvalues++] = create_value(ctx, atts);