void NHX_debug_print(struct NHXnode *v) { if (v) { struct NHXannotation *l = v->l; if (l) { if (annotation_isa(l, "ID")) { fprintf(stderr, "ID:\t%d\n", l->arg.i); } else if (annotation_isa(l, "S")) { fprintf(stderr, "S: \t%s\n", l->arg.str); } else if (annotation_isa(l, "BW")) { fprintf(stderr, "BW:\t%f\n", l->arg.t); } } } }
/* Given a NHX node, see if it contains an annotation with the given tag. Returns 0, if not present, or if v is 0. */ struct NHXannotation* find_annotation(const struct NHXnode *v, const char *tag) { struct NHXannotation *a; if (v == 0) { return 0; } a = v->l; while (a != 0) { if (annotation_isa(a, tag) == 0) { return a; } a = a->next; } return 0; }