Lines Matching refs:atts
131 get_group_offset_count(const char **atts, uint32_t *offset, uint32_t *count,
134 for (int i = 0; atts[i]; i += 2) {
137 if (strcmp(atts[i], "count") == 0) {
138 *count = strtoul(atts[i + 1], &p, 0);
141 } else if (strcmp(atts[i], "start") == 0) {
142 *offset = strtoul(atts[i + 1], &p, 0);
143 } else if (strcmp(atts[i], "size") == 0) {
144 *size = strtoul(atts[i + 1], &p, 0);
153 const char **atts,
173 for (int i = 0; atts[i]; i += 2) {
175 if (strcmp(atts[i], "length") == 0) {
176 group->dw_length = strtoul(atts[i + 1], &p, 0);
177 } else if (strcmp(atts[i], "bias") == 0) {
178 group->bias = strtoul(atts[i + 1], &p, 0);
179 } else if (strcmp(atts[i], "engine") == 0) {
181 char *tmp = ralloc_strdup(mem_ctx, atts[i + 1]);
194 fprintf(stderr, "unknown engine class defined for instruction \"%s\": %s\n", name, atts[i + 1]);
206 get_group_offset_count(atts,
217 create_enum(struct parser_context *ctx, const char *name, const char **atts)
229 get_register_offset(const char **atts, uint32_t *offset)
231 for (int i = 0; atts[i]; i += 2) {
234 if (strcmp(atts[i], "num") == 0)
235 *offset = strtoul(atts[i + 1], &p, 0);
311 create_field(struct parser_context *ctx, const char **atts)
318 for (int i = 0; atts[i]; i += 2) {
321 if (strcmp(atts[i], "name") == 0) {
322 field->name = ralloc_strdup(field, atts[i + 1]);
326 } else if (strcmp(atts[i], "start") == 0) {
327 field->start = strtoul(atts[i + 1], &p, 0);
328 } else if (strcmp(atts[i], "end") == 0) {
329 field->end = strtoul(atts[i + 1], &p, 0);
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 &&
335 field->default_value = strtoul(atts[i + 1], &p, 0);
343 create_value(struct parser_context *ctx, const char **atts)
347 for (int i = 0; atts[i]; i += 2) {
348 if (strcmp(atts[i], "name") == 0)
349 value->name = ralloc_strdup(value, atts[i + 1]);
350 else if (strcmp(atts[i], "value") == 0)
351 value->value = strtoul(atts[i + 1], NULL, 0);
359 const char **atts)
361 struct gen_field *field = create_field(ctx, atts);
379 start_element(void *data, const char *element_name, const char **atts)
387 for (int i = 0; atts[i]; i += 2) {
388 if (strcmp(atts[i], "name") == 0)
389 name = atts[i + 1];
390 else if (strcmp(atts[i], "gen") == 0)
391 gen = atts[i + 1];
409 ctx->group = create_group(ctx, name, atts, NULL, false);
411 ctx->group = create_group(ctx, name, atts, NULL, true);
413 ctx->group = create_group(ctx, name, atts, NULL, true);
414 get_register_offset(atts, &ctx->group->register_offset);
420 struct gen_group *group = create_group(ctx, "", atts, ctx->group, false);
424 ctx->last_field = create_and_append_field(ctx, atts);
426 ctx->enoom = create_enum(ctx, name, atts);
435 ctx->values[ctx->n_values++] = create_value(ctx, atts);