+ n->val = val;
+ n->hits = 1;
+ flist_add_tail(&n->list, l);
+ return n;
+}
+
+static int parse_options(int argc, char *argv[])
+{
+ const char *optstring = "t:g:i:o:b:p:c";
+ int c, dist_val_set = 0;
+
+ while ((c = getopt(argc, argv, optstring)) != -1) {
+ switch (c) {
+ case 'p':
+ percentage = atof(optarg);
+ break;
+ case 'b':
+ block_size = strtoul(optarg, NULL, 10);
+ break;
+ case 't':
+ if (!strncmp(optarg, "zipf", 4))
+ dist_type = TYPE_ZIPF;
+ else if (!strncmp(optarg, "pareto", 6))
+ dist_type = TYPE_PARETO;
+ else {
+ printf("wrong dist type: %s\n", optarg);
+ return 1;
+ }
+ break;
+ case 'g':
+ gb_size = strtoul(optarg, NULL, 10);
+ break;
+ case 'i':
+ dist_val = atof(optarg);
+ dist_val_set = 1;
+ break;
+ case 'o':
+ output_nranges = strtoul(optarg, NULL, 10);
+ break;
+ case 'c':
+ output_csv = 1;
+ break;
+ default:
+ printf("bad option %c\n", c);
+ return 1;
+ }