UPDATE: moo-1.2

2006-06-16 Thread Ray Lai
This updates moo to support 64-bit integers.  Blood and sweat by
mbalmer@, credit taken by me.

Okay?

-Ray-

Index: Makefile
===
RCS file: /cvs/ports/math/moo/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- Makefile6 Mar 2006 14:41:56 -   1.2
+++ Makefile16 Jun 2006 16:26:02 -
@@ -2,7 +2,7 @@
 
 COMMENT=   Marco's Object Oriented calculator
 
-DISTNAME=  moo-1.1
+DISTNAME=  moo-1.2
 CATEGORIES=math
 
 MAINTAINER=Raymond Lai [EMAIL PROTECTED]
Index: distinfo
===
RCS file: /cvs/ports/math/moo/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo6 Mar 2006 14:41:56 -   1.2
+++ distinfo16 Jun 2006 16:26:02 -
@@ -1,4 +1,4 @@
-MD5 (moo-1.1.tgz) = 565a355a015a5954b6841aef77fcd603
-RMD160 (moo-1.1.tgz) = 8fef129b5234fbbdb5c057c692afbeed7ac3151a
-SHA1 (moo-1.1.tgz) = 0aba9925cb982fdd186efd5a69bd3f0d42e37bbe
-SIZE (moo-1.1.tgz) = 6963
+MD5 (moo-1.2.tgz) = e28b9a9db7a07dbfdb8180e03d3fc01e
+RMD160 (moo-1.2.tgz) = df690a4d910f2e23a216e86f97c56f9aafcf9f76
+SHA1 (moo-1.2.tgz) = d80f05a05956e7493a9ac2feb8aa1e4336a8b120
+SIZE (moo-1.2.tgz) = 6908



Re: moo-1.2

2006-03-11 Thread Nikolay Sturm
* Stuart Henderson [2006-03-10]:
  The ports tree is not the right place for source code. Host the
  distfile somewhere.
 There are precedents: benchmarks/tcpblast misc/tpwireless
 sysutils/iogen

Just because others did a bad job, doesn't mean more should follow.

Nikolay



moo-1.2

2006-03-10 Thread Ray Lai
Moves source to ports tree, no code change (sorry Marco).  Okay?

-Ray-

Index: Makefile
===
RCS file: /cvs/ports/math/moo/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- Makefile6 Mar 2006 14:41:56 -   1.2
+++ Makefile10 Mar 2006 20:10:41 -
@@ -2,14 +2,13 @@
 
 COMMENT=   Marco's Object Oriented calculator
 
-DISTNAME=  moo-1.1
+PKGNAME=   moo-1.2
 CATEGORIES=math
+DISTFILES=
 
 MAINTAINER=Raymond Lai [EMAIL PROTECTED]
 
 HOMEPAGE=  http://cyth.net/~ray/moo/
-MASTER_SITES=  ${HOMEPAGE}
-EXTRACT_SUFX=  .tgz
 
 # Public domain
 PERMIT_PACKAGE_CDROM=  Yes
@@ -18,5 +17,10 @@ PERMIT_DISTFILES_CDROM=  Yes
 PERMIT_DISTFILES_FTP=  Yes
 
 WANTLIB=   c
+
+NO_CHECKSUM=   Yes
+
+post-extract:
+   @lndir ${.CURDIR}/src ${WRKDIR}
 
 .include bsd.port.mk
Index: distinfo
===
RCS file: distinfo
diff -N distinfo
--- distinfo6 Mar 2006 14:41:56 -   1.2
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,4 +0,0 @@
-MD5 (moo-1.1.tgz) = 565a355a015a5954b6841aef77fcd603
-RMD160 (moo-1.1.tgz) = 8fef129b5234fbbdb5c057c692afbeed7ac3151a
-SHA1 (moo-1.1.tgz) = 0aba9925cb982fdd186efd5a69bd3f0d42e37bbe
-SIZE (moo-1.1.tgz) = 6963
Index: src/Makefile
===
RCS file: src/Makefile
diff -N src/Makefile
--- /dev/null   1 Jan 1970 00:00:00 -
+++ src/Makefile10 Mar 2006 20:10:41 -
@@ -0,0 +1,16 @@
+#  $Id: Makefile,v 1.8 2006/03/06 06:40:59 ray Exp $
+
+PROG=  moo
+SRCS=  moo.c scan.c
+CPPFLAGS+= -I${.CURDIR}
+COPTS+=-Wall -W -Wno-unused -Wshadow -pedantic
+CLEANFILES+=   moo.c y.tab.h scan.c lex.yy.c
+
+LOCALBASE?=/usr/local
+BINDIR=${LOCALBASE}/bin
+MANDIR=${LOCALBASE}/man/cat
+
+regress::
+   cd ${.CURDIR}/regress  ${MAKE} MOO=${.OBJDIR}/moo
+
+.include bsd.prog.mk
Index: src/extern.h
===
RCS file: src/extern.h
diff -N src/extern.h
--- /dev/null   1 Jan 1970 00:00:00 -
+++ src/extern.h10 Mar 2006 20:10:41 -
@@ -0,0 +1,9 @@
+/* $Id: extern.h,v 1.2 2006/03/04 04:39:13 ray Exp $   */
+
+/*
+ * Written by Raymond Lai [EMAIL PROTECTED].
+ * Public domain.
+ */
+
+int getbin(const char *);
+int getnum(const char *);
Index: src/moo.1
===
RCS file: src/moo.1
diff -N src/moo.1
--- /dev/null   1 Jan 1970 00:00:00 -
+++ src/moo.1   10 Mar 2006 20:10:41 -
@@ -0,0 +1,83 @@
+.\$Id: moo.1,v 1.6 2006/03/04 10:02:34 ray Exp $
+.\
+.\ Written by Raymond Lai [EMAIL PROTECTED].
+.\ Public domain.
+.\
+.Dd March 2, 2006
+.Dt MOO 1
+.Os
+.Sh NAME
+.Nm moo
+.Nd Marco's Object Oriented calculator
+.Sh SYNOPSIS
+.Nm
+.Op Fl su
+.Op Fl b Ar base
+.Op Ar expr
+.Op Ar ...
+.Sh DESCRIPTION
+A simple calculator that accepts C-like syntax as input.
+Calculations are done on
+.Ar expr ,
+if given.
+Otherwise, the standard input is used.
+.Pp
+Numbers can be entered in hexadecimal (0xbeef),
+decimal (1984),
+octal (007),
+and binary (0b1001).
+All numerical operators (+, -, *, /, %),
+bit operators (|, ^, , ~, , ),
+and logical operators (==, !=, , , =, =, !, , ||)
+are supported.
+.Pp
+Output will be in the same bases as the input,
+unless a different base was specified
+(see
+.Fl b
+flag below).
+.Pp
+The options are:
+.Bl -tag -width Ds
+.It Fl b Ar base
+Output numbers in
+.Ar base
+format.
+.Ar base
+can be 2, 8, 10, 16, or `all'.
+Multiple bases may be specified by giving the
+.Fl b
+flag multiple times.
+.It Fl s
+Output base 10 numbers as signed.
+.It Fl u
+Output base 10 numbers as unsigned.
+.El
+.Sh ENVIRONMENT
+.Bl -tag -width Ds
+.It Ev TMPDIR
+Specifies a directory for temporary files to be created.
+The default is
+.Pa /tmp .
+.El
+.Sh SEE ALSO
+.Xr bc 1 ,
+.Xr dc 1 ,
+.Xr expr 1
+.Sh AUTHORS
+.Nm
+was written for the public domain by
+.An Ray Lai Aq [EMAIL PROTECTED]
+after much whining by Marco Peereboom.
+.Sh CAVEATS
+Integer overflows are not checked.
+Marco says,
+``I don't think you should call the integer overflows a bug but a feature.
+You can use it to test signed unsigned issues.''
+.Sh BUGS
+Calculations are limited to the size of an integer.
+.Pp
+Like
+.Xr bc 1 ,
+.Nm
+parses ``3--2'' without error.
Index: src/moo.y
===
RCS file: src/moo.y
diff -N src/moo.y
--- /dev/null   1 Jan 1970 00:00:00 -
+++ src/moo.y   10 Mar 2006 20:10:41 -
@@ -0,0 +1,347 @@
+%{
+/* $Id: moo.y,v 1.9 2006/03/05 20:16:27 ray Exp $  */
+
+/*
+ * Written by Raymond Lai [EMAIL PROTECTED].
+ * Public domain.
+ */
+
+#include sys/cdefs.h
+
+#include ctype.h
+#include err.h
+#include errno.h
+#include limits.h
+#include stdio.h
+#include

Re: moo-1.2

2006-03-10 Thread Nikolay Sturm
* Ray Lai [2006-03-10]:
 Moves source to ports tree, no code change (sorry Marco).  Okay?

The ports tree is not the right place for source code. Host the distfile
somewhere.

Nikolay



Re: moo-1.2

2006-03-10 Thread Marc Espie
On Fri, Mar 10, 2006 at 03:18:59PM -0501, Ray Lai wrote:
 Moves source to ports tree, no code change (sorry Marco).  Okay?
 
 -Ray-
 
No.

The ports tree is small, and should stay that way.

Arrange so that the moo code is distributed elsewhere.



Re: moo-1.2

2006-03-10 Thread Stuart Henderson
On 2006/03/10 21:36, Nikolay Sturm wrote:
 * Ray Lai [2006-03-10]:
  Moves source to ports tree, no code change (sorry Marco).  Okay?
 
 The ports tree is not the right place for source code. Host the distfile
 somewhere.

There are precedents: benchmarks/tcpblast misc/tpwireless sysutils/iogen