From 487ca4806cc046076293cf6cc5fbba0db282bac7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 17 Jan 2006 21:41:51 +0000 Subject: texk 1 git-svn-id: svn://tug.org/texlive/trunk@1485 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/ps2pkm/sexpr.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Build/source/texk/ps2pkm/sexpr.c (limited to 'Build/source/texk/ps2pkm/sexpr.c') diff --git a/Build/source/texk/ps2pkm/sexpr.c b/Build/source/texk/ps2pkm/sexpr.c new file mode 100644 index 00000000000..d069cce1c0b --- /dev/null +++ b/Build/source/texk/ps2pkm/sexpr.c @@ -0,0 +1,25 @@ +/* + * File: sexpr.c + * Purpose: evaluate algebraic expression from single argument + * (Derived from expr.c from J.T. Conklin .) + * Version: 1.0 (Nov 1995) + * Author: Piet Tutelaers + */ + +#include +#include "strexpr.h" /* strexpr() */ +#include "basics.h" /* fatal() */ + +int main(int argc, char *argv[]) { + int result; + + if (argc < 2) fatal("Usage: sexpr expression ...\n"); + + while (--argc > 0) { + if (strexpr(&result, *++argv)) + fatal("expression error\n"); + + printf("%s = %d\n", argv[0] , result); + } + exit(0); +} -- cgit v1.2.3