games: Bring in ching(6) -- The Book of Changes -- from NetBSD

Operating Systems / DragonFlyBSD - Aaron LI [aaronly.me] - 19 February 2021 15:21 UTC

The ching(6) game/utility was nuked from FreeBSD in 1994 ... (see revision 2563)

It has been added back to NetBSD in June 30, 2005:

ching(6) -- The Book of Changes, not seen in BSD since 4.4BSD.

The C code is a complete rewrite done by Guy Harris for 4.4BSD and is not the original from v7 at all. Unfortunately, the data file itself, without which the rest isn't useful, was not freed until Caldera released all of 32v a few years ago, so it was not in 4.4lite.

The data file, the ching nroff macros, and the driver script are under Caldera or Caldera+Berkeley copyright.

I've partially redone the driver script from 4.4 (there was no point in using a temporary file for the hexagram), which was already partially redone from 32v. (As an aside, it is nutty that the script needs a copyright so many times longer than the code.)

I've renamed "cno" to "castching", "phx" to "printching", (the traditional names were opaque), and put them in /usr/libexec/ching instead of the v7 /usr/games/ching.d. The data file and nroff macros are in /usr/share/games/ching

(see https: //github.com/NetBSD/src/commit/5175ead765ed41e9db0f9f59d83ddf8966f6568a)

d808242906 games: Bring in ching(6) -- The Book of Changes -- from NetBSD
etc/mtree/BSD.usr.dist | 4 +
games/Makefile | 1 +
games/ching/Makefile | 5 +
games/ching/Makefile.inc | 1 +
games/ching/castching/Makefile | 9 +
games/ching/castching/castching.c | 122 ++
games/ching/ching/Makefile | 11 +
games/ching/ching/ching.6 | 154 +++
games/ching/ching/ching.sh | 81 ++
games/ching/ching/hexagrams | 2337 +++++++++++++++++++++++++++++++++++
games/ching/ching/macros | 126 ++
games/ching/include/ching.h | 44 +
games/ching/printching/Makefile | 9 +
games/ching/printching/pathnames.h | 38 +
games/ching/printching/printching.c | 313 +++++
15 files changed, 3255 insertions(+)

Upstream: gitweb.dragonflybsd.org


  • Share