doc: typos
[barvinok.git] / barvinok_count.c
blobcaff8a7474f06f6f0cc9701656d2e99294c4bfff
1 #include <unistd.h>
2 #include <stdlib.h>
3 #include <strings.h>
4 #include <polylib/polylibgmp.h>
5 #include <barvinok/util.h>
6 #include <barvinok/barvinok.h>
7 #include "config.h"
9 #ifndef HAVE_GETOPT_H
10 #define getopt_long(a,b,c,d,e) getopt(a,b,c)
11 #else
12 #include <getopt.h>
13 struct option options[] = {
14 { "version", no_argument, 0, 'V' },
15 { 0, 0, 0, 0 }
17 #endif
19 int main(int argc, char **argv)
21 Value cb;
22 Polyhedron *A;
23 int c, ind = 0;
24 struct barvinok_options *bv_options = barvinok_options_new_with_defaults();
26 while ((c = getopt_long(argc, argv, "V", options, &ind)) != -1) {
27 switch (c) {
28 case 'V':
29 printf(barvinok_version());
30 exit(0);
31 break;
35 A = Polyhedron_Read(bv_options->MaxRays);
36 value_init(cb);
37 Polyhedron_Print(stdout, P_VALUE_FMT, A);
38 barvinok_count_with_options(A, &cb, bv_options);
39 value_print(stdout, P_VALUE_FMT, cb);
40 puts("");
41 value_clear(cb);
42 Polyhedron_Free(A);
43 free(bv_options);
44 return 0;