+ const char *rrtn, *fmtn, *const *domlist;
+ char *show, *cp;
+ int len, i, qc, qi, tc, ti, ch;
+ adns_status r, ri;
+ const adns_rrtype *types;
+ adns_rrtype *types_a;
+
+ if (argv[0] && argv[1] && argv[1][0] == ':') {
+ for (cp= argv[1]+1, tc=1; (ch= *cp); cp++)
+ if (ch==',') tc++;
+ types_a= malloc(sizeof(*types_a)*tc);
+ if (!types_a) { perror("malloc types"); exit(3); }
+ for (cp= argv[1]+1, ti=0; ti<tc; ti++) {
+ types_a[ti]= strtoul(cp,&cp,10);
+ if ((ch= *cp)) {
+ if (ch != ',') {
+ fputs("usage: dtest [:<typenum>,...] [<domain> ...]\n",stderr);
+ exit(4);
+ }
+ cp++;
+ }
+ }
+ types= types_a;
+ argv++;
+ } else {
+ types= defaulttypes;
+ }
+
+ if (argv[0] && argv[1]) domlist= (const char *const*)argv+1;
+ else domlist= defaultargv;
+
+ for (qc=0; qc[domlist]; qc++);
+ for (tc=0; types[tc] != adns_r_none; tc++);
+ qus= malloc(sizeof(qus)*qc*tc);
+ if (!qus) { perror("malloc qus"); exit(3); }