4 #include <barvinok/util.h>
5 #include <barvinok/barvinok.h>
8 #define PRINT_STATS (BV_OPT_LAST+1)
10 struct argp_option argp_options
[] = {
11 { "print-stats", PRINT_STATS
, 0, 0 },
16 struct barvinok_options
*options
;
20 error_t
parse_opt(int key
, char *arg
, struct argp_state
*state
)
22 struct arguments
*arguments
= state
->input
;
26 state
->child_inputs
[0] = arguments
->options
;
29 arguments
->print_stats
= 1;
32 return ARGP_ERR_UNKNOWN
;
37 int main(int argc
, char **argv
)
41 struct arguments arguments
;
42 static struct argp_child argp_children
[] = {
43 { &barvinok_argp
, 0, 0, 0 },
46 static struct argp argp
= { argp_options
, parse_opt
, 0, 0, argp_children
};
47 struct barvinok_options
*options
= barvinok_options_new_with_defaults();
49 arguments
.print_stats
= 0;
50 arguments
.options
= options
;
52 argp_parse(&argp
, argc
, argv
, 0, 0, &arguments
);
54 A
= Polyhedron_Read(options
->MaxRays
);
56 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
57 barvinok_count_with_options(A
, &cb
, options
);
58 value_print(stdout
, P_VALUE_FMT
, cb
);
60 if (arguments
.print_stats
)
61 barvinok_stats_print(options
->stats
, stdout
);
64 barvinok_options_free(options
);