Austin Schuh | 405fa6c | 2015-09-06 18:13:55 -0700 | [diff] [blame] | 1 | /* lcdd.c: Main test program to call the cdd library cddlib |
| 2 | written by Komei Fukuda, fukuda@ifor.math.ethz.ch |
| 3 | and David Avis, avis@mutt.cs.mcgill.ca |
| 4 | Version 0.94, August 4, 2005 |
| 5 | Standard ftp site: ftp.ifor.math.ethz.ch, Directory: pub/fukuda/cdd |
| 6 | */ |
| 7 | |
| 8 | /* This program is free software; you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation; either version 2 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with this program; if not, write to the Free Software |
| 20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 21 | */ |
| 22 | |
| 23 | /* This program behaves like lrs by David Avis. |
| 24 | Usage: lcdd filein fileout |
| 25 | lcdd filein output to stdout |
| 26 | lcdd input stdin, output stdout |
| 27 | |
| 28 | This allows things like |
| 29 | lcdd file | lcdd (should give a minimal rep of the input file on stdout) |
| 30 | lcdd file | lrs |
| 31 | lcdd < filein |
| 32 | */ |
| 33 | |
| 34 | #include "setoper.h" |
| 35 | #include "cdd.h" |
| 36 | #include <stdio.h> |
| 37 | #include <stdlib.h> |
| 38 | #include <time.h> |
| 39 | #include <math.h> |
| 40 | #include <string.h> |
| 41 | |
| 42 | |
| 43 | int main(int argc, char *argv[]) |
| 44 | { |
| 45 | dd_ErrorType err; |
| 46 | |
| 47 | dd_set_global_constants(); /* First, this must be called. */ |
| 48 | dd_log=dd_TRUE; /* Output log */ |
| 49 | |
| 50 | if (argc > 2) |
| 51 | dd_DDFile2File(argv[1],argv[2],&err); |
| 52 | |
| 53 | else if (argc > 1) |
| 54 | dd_DDFile2File(argv[1],"**stdout",&err); |
| 55 | else |
| 56 | dd_DDFile2File("**stdin","**stdout",&err); |
| 57 | return 0; |
| 58 | } |
| 59 | |
| 60 | /* end of lcdd.c */ |