the Fink project is an effort to port
popular Unix programs to Mac OS X
Package: hc
Version: 1.1
Revision: 2
Source: http://www.geocities.com/connorbd/software/%n.tgz
SourceDirectory: hcdist
BuildDepends: fink (>= 0.24.12-1)
PatchFile: %n.patch
PatchFile-MD5: 26652344badc31556bc890ef70b14f48
CompileScript: make YACC=/usr/bin/yacc
InstallScript: <<
mkdir -p %i/bin
install -m 755 hc %i/bin
mkdir -p %i/share/man/man1
install -m 644 hc.1 %i/share/man/man1
<<
DocFiles: README
Description: The Hacker's Calculator
DescDetail: <<
From Brian Connors (the author) :
"So one day in 1998 I picked up my (currently missing) copy of
Kernighan and Pike (The Unix Programming Environment, for those of you who
don't know one white computer book with an AT&T copyright from another) with
the thought that there didn't seem to be a whole lot of calculator programs
out there that specialized in hacker-type calculations, i.e. things like hex
and octal bases and bitwise operations. So I took the book's hoc code and
hacked it up here and there, stripped out unnecessary features, and hc was
born."
<<
DescPackaging: <<
Previous versions by Sylvain Cuaz.
- no configure script
- no make install
<<
DescPort: <<
Patch to make it compile also with Leopard's yacc (=bison).
<<
Homepage: http://www.geocities.com/connorbd/software/hc.html
Maintainer: None
License: GPL
Source-MD5: e3617acf144c711cbacf847d4a1016c5
--- hcdist/hc.y_ori 2008-04-21 15:10:37.000000000 +0200
+++ hcdist/hc.y 2008-12-07 01:56:16.000000000 +0100
@@ -1,4 +1,30 @@
%{
+#include
+#include
+#include
+#include
+#include
+
+typedef enum {
+ kDec,
+ kHex,
+ kOct,
+ kBin
+} outmode;
+
+/*char progname[];*/
+jmp_buf begin;
+int lineno = 1;
+outmode mode;
+
+void output(int);
+void aboutbox();
+void help();
+void execerror(char*, char*);
+void yyerror(char*);
+%}
+
+%{
#define YYSTYPE int
%}
@@ -46,22 +67,6 @@
| 'v' { vrs(); }
;
%%
-#include
-#include
-#include
-#include
-
-typedef enum {
- kDec,
- kHex,
- kOct,
- kBin
-} outmode;
-
-/*char progname[];*/
-jmp_buf begin;
-int lineno = 1;
-outmode mode;
void output(int i) {
switch (mode) {