summaryrefslogtreecommitdiffstats
path: root/bcd
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1995-03-21 15:03:38 +0000
committercgd <cgd@NetBSD.org>1995-03-21 15:03:38 +0000
commit5ff78ede5ea1a80c654d3f0684cd5f36d5253ae1 (patch)
tree81a19a5b24b0353e8cbac8b1f0ad82be1cf16323 /bcd
parent45171656c266fc63f08d074d856b5ae99ac29211 (diff)
downloadbsdgames-darwin-5ff78ede5ea1a80c654d3f0684cd5f36d5253ae1.tar.gz
bsdgames-darwin-5ff78ede5ea1a80c654d3f0684cd5f36d5253ae1.tar.zst
bsdgames-darwin-5ff78ede5ea1a80c654d3f0684cd5f36d5253ae1.zip
clean up import
Diffstat (limited to 'bcd')
-rw-r--r--bcd/Makefile4
-rw-r--r--bcd/bcd.637
-rw-r--r--bcd/bcd.c31
3 files changed, 47 insertions, 25 deletions
diff --git a/bcd/Makefile b/bcd/Makefile
index 0c88ca46..5b3237f2 100644
--- a/bcd/Makefile
+++ b/bcd/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.3 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.3 1994/12/22 09:33:11 cgd Exp $
+# $NetBSD: Makefile,v 1.4 1995/03/21 15:08:10 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= bcd
MAN= bcd.6
diff --git a/bcd/bcd.6 b/bcd/bcd.6
index c8b785d5..57efb7a5 100644
--- a/bcd/bcd.6
+++ b/bcd/bcd.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1988 Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: bcd.6,v 1.6 1995/03/21 15:08:14 cgd Exp $
+.\"
+.\" Copyright (c) 1988, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,16 +31,15 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)bcd.6 6.7 (Berkeley) 6/23/90
-.\" $Id: bcd.6,v 1.5 1994/03/24 01:27:24 jtc Exp $
+.\" @(#)bcd.6 8.1 (Berkeley) 5/31/93
.\"
-.Dd June 23, 1990
-.Dt BCD 6
+.Dd May 31, 1993
+.Dt "BCD" 6
.Os
.Sh NAME
.Nm bcd ,
.Nm ppt ,
-.Nm morse
+.Nm morse
.Nd "reformat input as punch cards, paper tape or morse code"
.Sh SYNOPSIS
.Nm bcd
@@ -46,17 +47,23 @@
.Nm ppt
.Op Ar string ...
.Nm morse
-.Op Fl s
-.Op Ar string ...
+.Op Fl s Ar string ...
.Sh DESCRIPTION
-.Nm Bcd ,
+The
+.Nm bcd ,
.Nm ppt
and
.Nm morse
-convert command line arguments, if provided, or standard input into a form
-familiar to old-timers.
+commands read the given input and reformats it in the form of
+punched cards, paper tape or morse code respectively.
+Acceptable input are command line arguments or the standard input.
+.Pp
+Available option:
+.Bl -tag -width flag
+.It Fl s
The
.Fl s
-option for
-.Nm morse
-produces dots and dashes rather than words.
+option for morse produces dots and dashes rather than words.
+.El
+.Sh FILES
+.SH HISTORY
diff --git a/bcd/bcd.c b/bcd/bcd.c
index ef50737a..ea554a34 100644
--- a/bcd/bcd.c
+++ b/bcd/bcd.c
@@ -1,9 +1,11 @@
+/* $NetBSD: bcd.c,v 1.5 1995/03/21 15:08:15 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
- * Steve Hayman of the Indiana University Computer Science Dept..
+ * Steve Hayman of the Indiana University Computer Science Dept.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,14 +37,13 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1989, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)bcd.c 4.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: bcd.c,v 1.4 1993/11/05 20:22:35 jtc Exp $";
+static char sccsid[] = "@(#)bcd.c 8.2 (Berkeley) 3/20/94";
#endif /* not lint */
/*
@@ -61,9 +62,22 @@ static char rcsid[] = "$Id: bcd.c,v 1.4 1993/11/05 20:22:35 jtc Exp $";
* Steve Hayman
* sahayman@iuvax.cs.indiana.edu
* 1989 11 30
+ *
+ *
+ * I found an error in the table. The same error is found in the SunOS 4.1.1
+ * version of bcd. It has apparently been around a long time. The error caused
+ * 'Q' and 'R' to have the same punch code. I only noticed the error due to
+ * someone pointing it out to me when the program was used to print a cover
+ * for an APA! The table was wrong in 4 places. The other error was masked
+ * by the fact that the input is converted to upper case before lookup.
+ *
+ * Dyane Bruce
+ * db@diana.ocunix.on.ca
+ * Nov 5, 1993
*/
#include <sys/types.h>
+
#include <stdio.h>
#include <ctype.h>
@@ -107,6 +121,7 @@ u_short holes[256] = {
*/
#define bit(w,i) ((w)&(1<<(i)))
+int
main(argc, argv)
int argc;
char **argv;