aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbremner <bremner@09fa754a-f411-0410-976a-da6bfa213b30>2006-06-14 20:27:40 +0000
committerbremner <bremner@09fa754a-f411-0410-976a-da6bfa213b30>2006-06-14 20:27:40 +0000
commit1cc3984653972e9eefeccb4d58483dbc64e82ee9 (patch)
tree3301b6efd9bbbe25b8ae7dcbfdf99dc1b5402f7d
parentab523ed700c642f09bc9c36af9d594003064864f (diff)
git-svn-id: file:///export/data/bremner/svn/trunk/inetools@5406 09fa754a-f411-0410-976a-da6bfa213b30
-rw-r--r--Makefile16
-rw-r--r--README8
-rw-r--r--countrows.c5
-rw-r--r--doc2h.pl6
-rw-r--r--float2rat.c2
-rw-r--r--rat2canon.c4
-rw-r--r--rat2canon.h2
-rw-r--r--rat2float.c2
8 files changed, 21 insertions, 24 deletions
diff --git a/Makefile b/Makefile
index e8829f2..8c7e98d 100644
--- a/Makefile
+++ b/Makefile
@@ -37,27 +37,27 @@ docstrings: ${DOCHEADERS}
rat2float.h: rat2float.doc
-rat2float: rat2float.c rat2float.h $(MPOBJ)
- $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(MPOBJ) $(LDFLAGS) $<
+rat2float: rat2float.c rat2float.h $(MPOBJ) process_args.o
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(MPOBJ) process_args.o $(LDFLAGS) $<
rat2canon.h: rat2canon.doc
-rat2canon: rat2canon.c rat2canon.h $(MPOBJ)
- $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(MPOBJ) $(LDFLAGS) $<
+rat2canon: rat2canon.c rat2canon.h process_args.o $(MPOBJ)
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ process_args.o $(MPOBJ) $(LDFLAGS) $<
countrows.h: countrows.doc
-countrows: countrows.c countrows.h $(MPOBJ)
- $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(MPOBJ) $(LDFLAGS) $<
+countrows: countrows.c countrows.h $(MPOBJ) process_args.o
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(MPOBJ) process_args.o $(LDFLAGS) $<
float2rat.h: float2rat.doc
-float2rat: float2rat.c float2rat.h
- $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(LDFLAGS) $<
+float2rat: float2rat.c float2rat.h process_args.o
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ process_args.o $(LDFLAGS) $<
clean:
$(RM) *.o core ${BIN}
diff --git a/README b/README
index 981508f..05c690c 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
$Id$
-Release 0.6
+Release 0.7
This directory contains some tools for manipulating lrs/cdd ine files.
@@ -30,11 +30,17 @@ At the moment there is
multiprecision support.
+NEW for release 0.7:
+
+ All utilities take optional parameters for input file and
+ output file.
I have more code around for, e.g. centering points around the origin and
other simple tasks that I would be willing to shake the dust off of if
there is interest.
+
+
This code is released under the Gnu GPL. See COPYING.
diff --git a/countrows.c b/countrows.c
index c94e53e..98b0f86 100644
--- a/countrows.c
+++ b/countrows.c
@@ -8,9 +8,6 @@
static char rcsid[]="$Id: rat2float.c 2343 2006-04-04 12:34:35Z bremner $";
-#ifndef LRSMP
-#error This file only compiles with LRSMP
-#endif
#include <stdlib.h>
#include <stdio.h>
@@ -43,7 +40,7 @@ int main(argc,argv)
char *cursor;
- CHECK_HELP;
+ process_args(argc,argv,DOCSTRING);
lrs_mp_init (MP_DIGITS,stdin,stdout);
diff --git a/doc2h.pl b/doc2h.pl
index 9584342..fe27e69 100644
--- a/doc2h.pl
+++ b/doc2h.pl
@@ -8,9 +8,3 @@ while(<>){
}
print '"'."\n";
-
-print "
-int usage(){ fprintf(stderr,\"\\n%s\\n\",rcsid);fprintf(stderr,DOCSTRING); exit(1); }
-#define CHECK_HELP if (argc > 1 && argv[1][0]=='-' && argv[1][1]=='h') usage();\n";
-
-
diff --git a/float2rat.c b/float2rat.c
index af171e1..f6bc999 100644
--- a/float2rat.c
+++ b/float2rat.c
@@ -29,7 +29,7 @@ main(argc,argv)
char buf[BUFSIZ];
- CHECK_HELP;
+ process_args(argc,argv,DOCSTRING);
while ( fgets(buf,BUFSIZ,stdin) !=NULL )
{
diff --git a/rat2canon.c b/rat2canon.c
index 03555c6..bc38132 100644
--- a/rat2canon.c
+++ b/rat2canon.c
@@ -27,6 +27,7 @@ typedef lrs_mp integer_t;
#include "rat2canon.h"
+
static int *rows=NULL;
static long int m,n;
static lrs_mp **An;
@@ -59,7 +60,8 @@ int main(argc,argv)
char *cursor;
- CHECK_HELP;
+ process_args(argc,argv,DOCSTRING);
+
lrs_mp_init (MP_DIGITS,stdin,stdout);
while ( fgets(buf,BUFSIZ,stdin) !=NULL )
diff --git a/rat2canon.h b/rat2canon.h
index 2447acb..cde340b 100644
--- a/rat2canon.h
+++ b/rat2canon.h
@@ -10,5 +10,3 @@ and outputs an equivelent one with normalized right hand side.\n\
\n\
"
-int usage(){ fprintf(stderr,"\n%s\n",rcsid);fprintf(stderr,DOCSTRING); exit(1); }
-#define CHECK_HELP if (argc > 1 && argv[1][0]=='-' && argv[1][1]=='h') usage();
diff --git a/rat2float.c b/rat2float.c
index f14a267..3573247 100644
--- a/rat2float.c
+++ b/rat2float.c
@@ -66,7 +66,7 @@ int main(argc,argv)
char format[BUFSIZ];
char buf[BUFSIZ];
- CHECK_HELP;
+ process_args(argc,argv,DOCSTRING);
#ifdef LRSMP
lrs_mp_init (MP_DIGITS,stdin,stdout);