date and time created 87/02/15 16:03:38 by lepreau
authorJay Lepreau <lepreau@ucbvax.Berkeley.EDU>
Mon, 16 Feb 1987 08:03:38 +0000 (00:03 -0800)
committerJay Lepreau <lepreau@ucbvax.Berkeley.EDU>
Mon, 16 Feb 1987 08:03:38 +0000 (00:03 -0800)
SCCS-vsn: local/sccscmds/sccscmds.2/util/trnslat.c 1.1
SCCS-vsn: local/sccscmds/sccscmds.ok/util/trnslat.c 1.1

usr/src/local/sccscmds/sccscmds.2/util/trnslat.c [new file with mode: 0644]
usr/src/local/sccscmds/sccscmds.ok/util/trnslat.c [new file with mode: 0644]

diff --git a/usr/src/local/sccscmds/sccscmds.2/util/trnslat.c b/usr/src/local/sccscmds/sccscmds.2/util/trnslat.c
new file mode 100644 (file)
index 0000000..f054301
--- /dev/null
@@ -0,0 +1,21 @@
+static char Sccsid[] "@(#)trnslat      2.2";
+/*
+       Copy `str' to `result' replacing any character found
+       in both `str' and `old' with the corresponding character from `new'.
+       Return `result'.
+*/
+
+char *trnslat(str,old,new,result)
+register char *str;
+char *old, *new, *result;
+{
+       register char *r, *o;
+
+       for (r = result; *r = *str++; r++)
+               for (o = old; *o; )
+                       if (*r == *o++) {
+                               *r = new[o - old -1];
+                               break;
+                       }
+       return(result);
+}
diff --git a/usr/src/local/sccscmds/sccscmds.ok/util/trnslat.c b/usr/src/local/sccscmds/sccscmds.ok/util/trnslat.c
new file mode 100644 (file)
index 0000000..f054301
--- /dev/null
@@ -0,0 +1,21 @@
+static char Sccsid[] "@(#)trnslat      2.2";
+/*
+       Copy `str' to `result' replacing any character found
+       in both `str' and `old' with the corresponding character from `new'.
+       Return `result'.
+*/
+
+char *trnslat(str,old,new,result)
+register char *str;
+char *old, *new, *result;
+{
+       register char *r, *o;
+
+       for (r = result; *r = *str++; r++)
+               for (o = old; *o; )
+                       if (*r == *o++) {
+                               *r = new[o - old -1];
+                               break;
+                       }
+       return(result);
+}