Lines Matching defs: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);
306 create_field(struct parser_context *ctx, const char **atts)
315 for (i = 0; atts[i]; i += 2) {
316 if (strcmp(atts[i], "name") == 0)
317 field->name = xstrdup(atts[i + 1]);
318 else if (strcmp(atts[i], "start") == 0) {
319 field->start = strtoul(atts[i + 1], &p, 0);
320 if (is_byte_offset(atts[i + 1]))
322 } else if (strcmp(atts[i], "end") == 0) {
323 field->end = strtoul(atts[i + 1], &p, 0) - 1;
324 if (is_byte_offset(atts[i + 1]))
326 } else if (strcmp(atts[i], "size") == 0) {
327 size = strtoul(atts[i + 1], &p, 0);
328 if (is_byte_offset(atts[i + 1]))
330 } else if (strcmp(atts[i], "type") == 0)
331 field->type = string_to_type(ctx, atts[i + 1]);
332 else if (strcmp(atts[i], "default") == 0) {
334 field->default_value = strtoul(atts[i + 1], &p, 0);
335 } else if (strcmp(atts[i], "minus_one") == 0) {
336 assert(strcmp(atts[i + 1], "true") == 0);
348 create_value(struct parser_context *ctx, const char **atts)
352 for (int i = 0; atts[i]; i += 2) {
353 if (strcmp(atts[i], "name") == 0)
354 value->name = xstrdup(atts[i + 1]);
355 else if (strcmp(atts[i], "value") == 0)
356 value->value = strtoul(atts[i + 1], NULL, 0);
364 const char **atts)
374 ctx->group->fields[ctx->group->nfields++] = create_field(ctx, atts);
378 set_group_opcode(struct v3d_group *group, const char **atts)
383 for (i = 0; atts[i]; i += 2) {
384 if (strcmp(atts[i], "code") == 0)
385 group->opcode = strtoul(atts[i + 1], &p, 0);
410 start_element(void *data, const char *element_name, const char **atts)
421 for (i = 0; atts[i]; i += 2) {
422 if (strcmp(atts[i], "shortname") == 0)
423 name = atts[i + 1];
424 else if (strcmp(atts[i], "name") == 0 && !name)
425 name = atts[i + 1];
426 else if (strcmp(atts[i], "gen") == 0)
427 ver = atts[i + 1];
428 else if (strcmp(atts[i], "min_ver") == 0)
429 min_ver = strtoul(atts[i + 1], NULL, 0);
430 else if (strcmp(atts[i], "max_ver") == 0)
431 max_ver = strtoul(atts[i + 1], NULL, 0);
455 ctx->group = create_group(ctx, name, atts, NULL);
458 set_group_opcode(ctx->group, atts);
460 ctx->group = create_group(ctx, name, atts, NULL);
461 get_register_offset(atts, &ctx->group->register_offset);
467 struct v3d_group *group = create_group(ctx, "", atts,
472 create_and_append_field(ctx, atts);
474 ctx->enoom = create_enum(ctx, name, atts);
476 ctx->values[ctx->nvalues++] = create_value(ctx, atts);