#include "prv.h" #include "arg.h" #include "parse.h" #include "triplet/prv.h" #include #include const char *triplet(const struct prv *p) { const struct args *args = p->ast->args; return args->triplet; } static const struct type *find(const char *s, const struct type (*v)[12]) { for (size_t i = 0; i < sizeof *v / sizeof **v; i++) if (!strcmp(s, (*v)[i].u.b.name)) return &(*v)[i]; return NULL; } const struct type *triplet_type(const char *tr, const char *s) { static const struct { const char *s; const struct type (*v)[12]; } m[] = { {"x86_64-linux-gnu", &x86_64_linux_gnu} }; for (size_t i = 0; i < sizeof m / sizeof *m; i++) if (!strcmp(tr, m[i].s)) return find(s, m[i].v); return NULL; }