Home | History | Annotate | Download | only in tools

Lines Matching refs:atts

174 create_group(struct parser_context *ctx, const char *name, const char **atts)
189 create_enum(struct parser_context *ctx, const char *name, const char **atts)
204 const char **atts, uint32_t *offset, uint32_t *count)
209 for (i = 0; atts[i]; i += 2) {
210 if (strcmp(atts[i], "count") == 0)
211 *count = strtoul(atts[i + 1], &p, 0);
212 else if (strcmp(atts[i], "start") == 0)
213 *offset = strtoul(atts[i + 1], &p, 0);
219 get_register_offset(const char **atts, uint32_t *offset)
224 for (i = 0; atts[i]; i += 2) {
225 if (strcmp(atts[i], "num") == 0)
226 *offset = strtoul(atts[i + 1], &p, 0);
310 create_field(struct parser_context *ctx, const char **atts)
318 for (i = 0; atts[i]; i += 2) {
319 if (strcmp(atts[i], "name") == 0)
320 field->name = xstrdup(atts[i + 1]);
321 else if (strcmp(atts[i], "start") == 0)
322 field->start = ctx->group->group_offset+strtoul(atts[i + 1], &p, 0);
323 else if (strcmp(atts[i], "end") == 0) {
324 field->end = ctx->group->group_offset+strtoul(atts[i + 1], &p, 0);
327 } else if (strcmp(atts[i], "type") == 0)
328 field->type = string_to_type(ctx, atts[i + 1]);
329 else if (strcmp(atts[i], "default") == 0 &&
332 field->default_value = strtoul(atts[i + 1], &p, 0);
340 create_value(struct parser_context *ctx, const char **atts)
344 for (int i = 0; atts[i]; i += 2) {
345 if (strcmp(atts[i], "name") == 0)
346 value->name = xstrdup(atts[i + 1]);
347 else if (strcmp(atts[i], "value") == 0)
348 value->value = strtoul(atts[i + 1], NULL, 0);
355 start_element(void *data, const char *element_name, const char **atts)
364 for (i = 0; atts[i]; i += 2) {
365 if (strcmp(atts[i], "name") == 0)
366 name = atts[i + 1];
367 else if (strcmp(atts[i], "gen") == 0)
368 gen = atts[i + 1];
388 ctx->group = create_group(ctx, name, atts);
390 ctx->group = create_group(ctx, name, atts);
391 get_register_offset(atts, &ctx->group->register_offset);
393 get_group_offset_count(ctx, name, atts, &ctx->group->group_offset,
397 ctx->fields[ctx->nfields++] = create_field(ctx, atts);
402 ctx->enoom = create_enum(ctx, name, atts);
404 ctx->values[ctx->nvalues++] = create_value(ctx, atts);