Lines Matching refs:attr

81 static char *getcontent (xmlNode *attr) {
82 xmlNode *chain = attr->children;
91 chain = attr->children;
111 static char *getattrib (struct rnndb *db, char *file, int line, xmlAttr *attr) {
112 xmlNode *chain = attr->children;
115 rnn_err(db, "%s:%d: unknown attribute child \"%s\" in attribute \"%s\"\n", file, line, chain->name, attr->name);
124 static int getboolattrib (struct rnndb *db, char *file, int line, xmlAttr *attr) {
125 char *c = getattrib(db, file, line, attr);
130 rnn_err(db, "%s:%d: invalid boolean value \"%s\" in attribute \"%s\"\n", file, line, c, attr->name);
134 static uint64_t getnum(struct rnndb *db, char *file, int line, xmlAttr *attr, char *c)
143 rnn_err(db, "%s:%d: invalid numeric value \"%s\" in attribute \"%s\"\n", file, line, c, attr->name);
148 static uint64_t getnumattrib (struct rnndb *db, char *file, int line, xmlAttr *attr) {
149 char *c = getattrib(db, file, line, attr);
150 return getnum(db, file, line, attr, c);
181 static int trytypeattr (struct rnndb *db, char *file, xmlNode *node, xmlAttr *attr, struct rnntypeinfo *ti) {
182 if (!strcmp(attr->name, "shr")) {
183 ti->shr = getnumattrib(db, file, node->line, attr);
185 } else if (!strcmp(attr->name, "min")) {
186 ti->min = getnumattrib(db, file, node->line, attr);
189 } else if (!strcmp(attr->name, "max")) {
190 ti->max = getnumattrib(db, file, node->line, attr);
193 } else if (!strcmp(attr->name, "align")) {
194 ti->align = getnumattrib(db, file, node->line, attr);
197 } else if (!strcmp(attr->name, "type")) {
198 ti->name = strdup(getattrib(db, file, node->line, attr));;
200 } else if (!strcmp(attr->name, "radix")) {
201 ti->radix = getnumattrib(db, file, node->line, attr);
204 } else if (!strcmp(attr->name, "pos")) {
205 ti->high = ti->low = getnumattrib(db, file, node->line, attr);
207 } else if (!strcmp(attr->name, "low")) {
208 ti->low = getnumattrib(db, file, node->line, attr);
210 } else if (!strcmp(attr->name, "high")) {
211 ti->high = getnumattrib(db, file, node->line, attr);
213 } else if (!strcmp(attr->name, "addvariant")) {
214 ti->addvariant = getboolattrib(db, file, node->line, attr);
223 xmlAttr *attr = node->properties;
224 while (attr) {
225 if (!strcmp(attr->name, "name")) {
226 val->name = strdup(getattrib(db, file, node->line, attr));
227 } else if (!strcmp(attr->name, "value")) {
228 val->value = getnumattrib(db, file, node->line, attr);
230 } else if (!strcmp(attr->name, "varset")) {
231 val->varinfo.varsetstr = strdup(getattrib(db, file, node->line, attr));
232 } else if (!strcmp(attr->name, "variants")) {
233 val->varinfo.variantsstr = strdup(getattrib(db, file, node->line, attr));
235 rnn_err(db, "%s:%d: wrong attribute \"%s\" for value\n", file, node->line, attr->name);
237 attr = attr->next;
258 xmlAttr *attr = node->properties;
260 while (attr) {
261 if (!strcmp(attr->name, "name")) {
262 res->name = strdup(getattrib(db, file, node->line, attr));
263 } else if (!trytypeattr(db, file, node, attr, &res->typeinfo)) {
264 rnn_err(db, "%s:%d: wrong attribute \"%s\" for spectype\n", file, node->line, attr->name);
266 attr = attr->next;
289 xmlAttr *attr = node->properties;
297 while (attr) {
298 if (!strcmp(attr->name, "name")) {
299 name = getattrib(db, file, node->line, attr);
300 } else if (!strcmp(attr->name, "bare")) {
301 bare = getboolattrib(db, file, node->line, attr);
302 } else if (!strcmp(attr->name, "inline")) {
303 isinline = getboolattrib(db, file, node->line, attr);
304 } else if (!strcmp(attr->name, "prefix")) {
305 prefixstr = strdup(getattrib(db, file, node->line, attr));
306 } else if (!strcmp(attr->name, "varset")) {
307 varsetstr = strdup(getattrib(db, file, node->line, attr));
308 } else if (!strcmp(attr->name, "variants")) {
309 variantsstr = strdup(getattrib(db, file, node->line, attr));
311 rnn_err(db, "%s:%d: wrong attribute \"%s\" for enum\n", file, node->line, attr->name);
313 attr = attr->next;
360 xmlAttr *attr = node->properties;
362 while (attr) {
363 if (!strcmp(attr->name, "name")) {
364 bf->name = strdup(getattrib(db, file, node->line, attr));
365 } else if (!strcmp(attr->name, "varset")) {
366 bf->varinfo.varsetstr = strdup(getattrib(db, file, node->line, attr));
367 } else if (!strcmp(attr->name, "variants")) {
368 bf->varinfo.variantsstr = strdup(getattrib(db, file, node->line, attr));
369 } else if (!trytypeattr(db, file, node, attr, &bf->typeinfo)) {
370 rnn_err(db, "%s:%d: wrong attribute \"%s\" for bitfield\n", file, node->line, attr->name);
372 attr = attr->next;
394 xmlAttr *attr = node->properties;
402 while (attr) {
403 if (!strcmp(attr->name, "name")) {
404 name = getattrib(db, file, node->line, attr);
405 } else if (!strcmp(attr->name, "bare")) {
406 bare = getboolattrib(db, file, node->line, attr);
407 } else if (!strcmp(attr->name, "inline")) {
408 isinline = getboolattrib(db, file, node->line, attr);
409 } else if (!strcmp(attr->name, "prefix")) {
410 prefixstr = strdup(getattrib(db, file, node->line, attr));
411 } else if (!strcmp(attr->name, "varset")) {
412 varsetstr = strdup(getattrib(db, file, node->line, attr));
413 } else if (!strcmp(attr->name, "variants")) {
414 variantsstr = strdup(getattrib(db, file, node->line, attr));
416 rnn_err(db, "%s:%d: wrong attribute \"%s\" for bitset\n", file, node->line, attr->name);
418 attr = attr->next;
467 xmlAttr *attr = node->properties;
468 while (attr) {
469 if (!strcmp(attr->name, "ref")) {
470 res->name = strdup(getattrib(db, file, node->line, attr));
472 rnn_err(db, "%s:%d: wrong attribute \"%s\" for %s\n", file, node->line, attr->name, node->name);
474 attr = attr->next;
488 xmlAttr *attr = node->properties;
489 while (attr) {
490 if (!strcmp(attr->name, "name")) {
491 res->name = strdup(getattrib(db, file, node->line, attr));
492 } else if (!strcmp(attr->name, "offset")) {
493 res->offset = getnumattrib(db, file, node->line, attr);
494 } else if (!strcmp(attr->name, "offsets")) {
495 char *str = strdup(getattrib(db, file, node->line, attr));
498 uint64_t offset = getnum(db, file, node->line, attr, tok);
505 } else if (!strcmp(attr->name, "doffset")) {
507 res->doffset = strdup(getattrib(db, file, node->line, attr));
508 } else if (!strcmp(attr->name, "doffsets")) {
510 char *str = strdup(getattrib(db, file, node->line, attr));
520 } else if (!strcmp(attr->name, "length")) {
521 res->length = getnumattrib(db, file, node->line, attr);
522 } else if (!strcmp(attr->name, "stride")) {
523 res->stride = getnumattrib(db, file, node->line, attr);
524 } else if (!strcmp(attr->name, "prefix")) {
525 res->varinfo.prefixstr = strdup(getattrib(db, file, node->line, attr));
526 } else if (!strcmp(attr->name, "varset")) {
527 res->varinfo.varsetstr = strdup(getattrib(db, file, node->line, attr));
528 } else if (!strcmp(attr->name, "variants")) {
529 res->varinfo.variantsstr = strdup(getattrib(db, file, node->line, attr));
530 } else if (!strcmp(attr->name, "index")) {
531 const char *enumname = getattrib(db, file, node->line, attr);
537 rnn_err(db, "%s:%d: wrong attribute \"%s\" for %s\n", file, node->line, attr->name, node->name);
539 attr = attr->next;
578 xmlAttr *attr = node->properties;
581 while (attr) {
582 if (!strcmp(attr->name, "name")) {
583 res->name = strdup(getattrib(db, file, node->line, attr));
584 } else if (!strcmp(attr->name, "offset")) {
585 res->offset = getnumattrib(db, file, node->line, attr);
586 } else if (!strcmp(attr->name, "length")) {
587 res->length = getnumattrib(db, file, node->line, attr);
588 } else if (!strcmp(attr->name, "stride")) {
589 res->stride = getnumattrib(db, file, node->line, attr);
590 } else if (!strcmp(attr->name, "varset")) {
591 res->varinfo.varsetstr = strdup(getattrib(db, file, node->line, attr));
592 } else if (!strcmp(attr->name, "variants")) {
593 res->varinfo.variantsstr = strdup(getattrib(db, file, node->line, attr));
594 } else if (!strcmp(attr->name, "access")) {
595 char *str = getattrib(db, file, node->line, attr);
604 } else if (!trytypeattr(db, file, node, attr, &res->typeinfo)) {
605 rnn_err(db, "%s:%d: wrong attribute \"%s\" for register\n", file, node->line, attr->name);
607 attr = attr->next;
626 xmlAttr *attr = node->properties;
629 while (attr) {
630 if (!strcmp(attr->name, "name")) {
631 name = getattrib(db, file, node->line, attr);
633 rnn_err(db, "%s:%d: wrong attribute \"%s\" for group\n", file, node->line, attr->name);
635 attr = attr->next;
666 xmlAttr *attr = node->properties;
674 while (attr) {
675 if (!strcmp(attr->name, "name")) {
676 name = getattrib(db, file, node->line, attr);
677 } else if (!strcmp(attr->name, "bare")) {
678 bare = getboolattrib(db, file, node->line, attr);
679 } else if (!strcmp(attr->name, "size")) {
680 size = getnumattrib(db, file, node->line, attr);
681 } else if (!strcmp(attr->name, "width")) {
682 width = getnumattrib(db, file, node->line, attr);
683 } else if (!strcmp(attr->name, "prefix")) {
684 prefixstr = strdup(getattrib(db, file, node->line, attr));
685 } else if (!strcmp(attr->name, "varset")) {
686 varsetstr = strdup(getattrib(db, file, node->line, attr));
687 } else if (!strcmp(attr->name, "variants")) {
688 variantsstr = strdup(getattrib(db, file, node->line, attr));
690 rnn_err(db, "%s:%d: wrong attribute \"%s\" for domain\n", file, node->line, attr->name);
692 attr = attr->next;
743 xmlAttr *attr = node->properties;
744 while (attr) {
745 if (!strcmp(attr->name, "year")) {
746 unsigned firstyear = getnumattrib(db, file, node->line, attr);
750 rnn_err(db, "%s:%d: wrong attribute \"%s\" for copyright\n", file, node->line, attr->name);
752 attr = attr->next;
827 xmlAttr *attr = node->properties;
829 while (attr) {
830 if (!strcmp(attr->name, "file")) {
831 subfile = getattrib(db, file, node->line, attr);
833 rnn_err(db, "%s:%d: wrong attribute \"%s\" for import\n", file, node->line, attr->name);
835 attr = attr->next;
871 xmlAttrPtr attr = database->properties;
875 while (attr) {
876 if (!strcmp(attr->name, "schemaLocation")) {
877 xmlNodePtr data = attr->children;