#include "dump2analysis.h" int* GetIDS(char* str){ int i, len; int p = 0; char *tok=NULL; int *d; for (i=0; str[i] != '\0'; i++) if (str[i] == ',') p++; if (i == 0) { d = malloc(sizeof(int) * 1); d[0] = 0; } else{ d = malloc(sizeof(int) * (p+2)); tok = strtok(str, ","); d[0] = p + 2; d[1] = atoi(tok); for (i=2; imode, optarg); break; case 'a': strcpy(Aid, optarg); break; case 'b': strcpy(Bid, optarg); break; case 'c': strcpy(Cid, optarg); break; case 's': arg->Atype = atoi(optarg); break; case 't': arg->Btype = atoi(optarg); break; case 'u': arg->Ctype = atoi(optarg); break; case 'x': strcpy(arg->Aelem, optarg); break; case 'y': strcpy(arg->Belem, optarg); break; case 'z': strcpy(arg->Celem, optarg); break; case 'o': strcpy(arg->outfile, optarg); break; case 'i': strcpy(arg->infile, optarg); break; case '?': Error(); } } arg->Aid = GetIDS(Aid); arg->Bid = GetIDS(Bid); arg->Cid = GetIDS(Cid); ArgCheck(arg); return 1; }