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5=T;KPYfKU5WMQCK?H0c?WME0mLUDD(9#mMU7S-/@%Q@@H@0ak@<?
V?awe
X@:Jz
$ CALL UNPACK [.UUCODE.VAXC]EXES-OBJS.MFTU;1 1292636273
$ create 'f'
X/* uucat.c */
X
X#include <stdio.h>
X#include <string.h>
X
X#define TRUE`091
X#define FALSE`090
X
X#define LENGTH`09150
X
Xextern void uuread();
X
X
X#ifndef VMS
Xvoid`20
X#endif
Xmain(argc, argv)
Xint argc;
Xchar *argv`5B`5D;
X`7B
X  int error, argno;
X  FILE *infile;
X
X#ifdef VMS
X  getredirection(&argc, &argv);
X#endif
X  if (argc < 2)
X    uuread(stdin);
X  else
X  `7B
X    error = FALSE;
X    for (argno = 1; !error && argno < argc; argno++)
X    `7B
X#ifdef VMS
X      if ((infile = fopen(argv`5Bargno`5D, "r","mbc=32","mbf=2")) == NULL)
X#else
X      if ((infile = fopen(argv`5Bargno`5D, "r")) == NULL)
X#endif
X      `7B
X`09error = TRUE;
X`09fprintf(stderr, "uucat: Can't open '%s' for input.\n", argv`5Bargno`5D);
X      `7D
X      else
X      `7B
X`09uuread(infile);
X`09fclose(infile);
X      `7D
X    `7D
X  `7D
X
X  exit(0);
X`7D
X
X
Xvoid uuread(infile)
XFILE *infile;
X`7B
X  char *s2, *s1, *s0, *tmp_s;
X  int length;
X  static char s`5B3 * (LENGTH + 1)`5D;
X  static int echo_on = FALSE, started = FALSE, just_finished = FALSE;
X  static int line_length = 0, lines_to_go = 0;
X
X  s0 = s;
X  s1 = s0 + (LENGTH + 1);
X  s2 = s1 + (LENGTH + 1);
X
X  s0`5B0`5D = s1`5B0`5D = s2`5B0`5D = '\0';  /* Clear strings */
X
X  while (fgets(s0, LENGTH, infile) != NULL)
X  `7B
X    s0`5BLENGTH`5D = '\0';  /* Make sure string is terminated */
X
X    if (just_finished)
X    `7B
X      if (strncmp(s0, "size ", 5) == 0)
X      `7B
X`09fputs(s0, stdout);
X`09s0`5B0`5D = '\0';
X      `7D
X      just_finished = FALSE;
X    `7D
X
X    if (!started)
X    `7B
X      if (strncmp(s0, "begin ", 6) == 0)
X      `7B
X`09started = echo_on = TRUE;
X`09line_length = 0;
X`09lines_to_go = 0;
X      `7D
X    `7D
X    else  /* started */
X    `7B
X      length = strlen(s0);
X      if (line_length == 0)
X`09line_length = length;
X
X      if (echo_on)
X      `7B
X`09lines_to_go = 0;
X`09if (s0`5B0`5D != 'M' `7C`7C length != line_length)
X`09`7B
X`09  echo_on = FALSE;
X`09  lines_to_go = 2;  /* Lines to go before 'end' is expected */
X`09  if (s0`5B0`5D == ' ' `7C`7C s0`5B0`5D == '`60')
X`09    lines_to_go = 1;
X`09`7D
X      `7D
X      else  /* !echo_on */
X      `7B
X`09if (s0`5B0`5D == 'M' && length == line_length)
X`09  echo_on = TRUE;
X`09else if (lines_to_go > 0)
X`09`7B
X`09  if (lines_to_go == 2)
X`09  `7B
X`09    if (s0`5B0`5D == ' ' `7C`7C s0`5B0`5D == '`60')
X`09      lines_to_go = 1;
X`09    else
X`09      lines_to_go = 0;  /* Unexpected line, so break off */
X`09  `7D
X`09  else if (lines_to_go == 1)
X`09  `7B
X`09    if (strcmp(s0, "end\n") == 0)
X`09    `7B
X`09      fputs(s2, stdout);
X`09      fputs(s1, stdout);
X`09      fputs(s0, stdout);
X`09      lines_to_go = 0;  /* Done. Break off */
X`09      just_finished = TRUE;
X`09      started = FALSE;
X`09    `7D
X`09    else
X`09      lines_to_go = 0;  /* Unexpected line, so break off */
X`09  `7D
X`09`7D
X      `7D
X    `7D
X
X    if (echo_on)
X    `7B
X      fputs(s0, stdout);
X      s0`5B0`5D = '\0';
X    `7D
X
X    tmp_s = s2;
X    s2 = s1;
X    s1 = s0;
X    s0 = tmp_s;
X  `7D
X`7D
$ CALL UNPACK [.UUCODE.VAXC]UUCAT.C;1 343351343
$ create 'f'
X#ifndef lint
Xstatic char sccsid`5B`5D = "@(#)uudecode.c`095.3 (Berkeley) 4/10/85";
X#endif
X`20
X/*
X * uudecode `5Binput`5D
X *
X * create the specified file, decoding as you go.
X * used with uuencode.
X */
X#include <stdio.h>
X#ifndef VMS
X#include <pwd.h>
X#endif
X#include <sys/types.h>
X#include <sys/stat.h>
X`20
X/* single character decode */
X#define DEC(c)`09(((c) - ' ') & 077)
X`20
Xmain(argc, argv)
Xchar **argv;
X`7B
X`09FILE *in, *out;
X`09int mode;
X`09char dest`5B128`5D;
X`09char buf`5B80`5D;
X`20
X#ifdef VMS
X`09getredirection(&argc, &argv);
X#endif
X`09/* optional input arg */
X`09if (argc > 1) `7B
X#ifdef VMS
X`09`09if ((in = fopen(argv`5B1`5D, "r", "mbc=32", "mbf=2")) == NULL) `7B
X#else
X`09`09if ((in = fopen(argv`5B1`5D, "r")) == NULL) `7B
X#endif
X`09`09`09perror(argv`5B1`5D);
X`09`09`09exit(1);
X`09`09`7D
X`09`09argv++; argc--;
X`09`7D else
X`09`09in = stdin;
X`20
X`09if (argc != 1) `7B
X`09`09printf("Usage: uudecode `5Binfile`5D\n");
X`09`09exit(2);
X`09`7D
X`20
X`09/* search for header line */
X`09for (;;) `7B
X`09`09if (fgets(buf, sizeof buf, in) == NULL) `7B
X`09`09`09fprintf(stderr, "No begin line\n");
X`09`09`09exit(3);
X`09`09`7D
X`09`09if (strncmp(buf, "begin ", 6) == 0)
X`09`09`09break;
X`09`7D
X`09sscanf(buf, "begin %o %s", &mode, dest);
X`20
X`09/* handle `7Euser/file format */
X`09if (dest`5B0`5D == '`7E') `7B
X#ifdef VMS
X
X`09`09/* Under VMS just strip it off */
X
X`09`09char *sl;
X`09`09char dnbuf`5B100`5D;
X`20
X`09`09sl = strchr(dest, '/');
X`09`09if (sl == NULL) `7B
X`09`09`09fprintf(stderr, "Illegal `7Euser\n");
X`09`09`09exit(3);
X`09`09`7D
X`09`09strcat(dnbuf, sl+1);
X`09`09strcpy(dest, dnbuf);
X#else
X`09`09char *sl;
X`09`09struct passwd *getpwnam();
X`09`09char *index();
X`09`09struct passwd *user;
X`09`09char dnbuf`5B100`5D;
X`20
X`09`09sl = index(dest, '/');
X`09`09if (sl == NULL) `7B
X`09`09`09fprintf(stderr, "Illegal `7Euser\n");
X`09`09`09exit(3);
X`09`09`7D
X`09`09*sl++ = 0;
X`09`09user = getpwnam(dest+1);
X`09`09if (user == NULL) `7B
X`09`09`09fprintf(stderr, "No such user as %s\n", dest);
X`09`09`09exit(4);
X`09`09`7D
X`09`09strcpy(dnbuf, user->pw_dir);
X`09`09strcat(dnbuf, "/");
X`09`09strcat(dnbuf, sl);
X`09`09strcpy(dest, dnbuf);
X#endif
X`09`7D
X`20
X`09/* create output file */
X#ifdef VMS
X`09out = fopen(dest, "w", "mbc=32", "mbf=2");
X#else
X`09out = fopen(dest, "w");
X#endif
X`09if (out == NULL) `7B
X`09`09perror(dest);
X`09`09exit(4);
X`09`7D
X`09chmod(dest, mode);
X`20
X`09decode(in, out);
X`20
X`09if (fgets(buf, sizeof buf, in) == NULL `7C`7C strcmp(buf, "end\n")) `7B
X`09`09fprintf(stderr, "No end line\n");
X`09`09exit(5);
X`09`7D
X`09exit(0);
X`7D
X`20
X/*
X * copy from in to out, decoding as you go along.
X */
Xdecode(in, out)
XFILE *in;
XFILE *out;
X`7B
X`09char buf`5B80`5D;
X`09char *bp;
X`09int n;
X`20
X`09for (;;) `7B
X`09`09/* for each input line */
X`09`09if (fgets(buf, sizeof buf, in) == NULL) `7B
X`09`09`09printf("Short file\n");
X`09`09`09exit(10);
X`09`09`7D
X`09`09n = DEC(buf`5B0`5D);
X`09`09if (n <= 0)
X`09`09`09break;
X`20
X`09`09bp = &buf`5B1`5D;
X`09`09while (n > 0) `7B
X`09`09`09outdec(bp, out, n);
X`09`09`09bp += 4;
X`09`09`09n -= 3;
X`09`09`7D
X`09`7D
X`7D
X`20
X/*
X * output a group of 3 bytes (4 input characters).
X * the input chars are pointed to by p, they are to
X * be output to file f.  n is used to tell us not to
X * output all of them at the end of the file.
X */
Xoutdec(p, f, n)
Xchar *p;
XFILE *f;
X`7B
X`09int c1, c2, c3;
X`20
X`09c1 = DEC(*p) << 2 `7C DEC(p`5B1`5D) >> 4;
X`09c2 = DEC(p`5B1`5D) << 4 `7C DEC(p`5B2`5D) >> 2;
X`09c3 = DEC(p`5B2`5D) << 6 `7C DEC(p`5B3`5D);
X`09if (n >= 1)
X`09`09putc(c1, f);
X`09if (n >= 2)
X`09`09putc(c2, f);
X`09if (n >= 3)
X`09`09putc(c3, f);
X`7D
X`20
X`20
X/* fr: like read but stdio */
Xint
Xfr(fd, buf, cnt)
XFILE *fd;
Xchar *buf;
Xint cnt;
X`7B
X`09int c, i;
X`20
X`09for (i=0; i<cnt; i++) `7B
X`09`09c = getc(fd);
X`09`09if (c == EOF)
X`09`09`09return(i);
X`09`09buf`5Bi`5D = c;
X`09`7D
X`09return (cnt);
X`7D
X`20
X/*
X * Return the ptr in sp at which the character c appears;
X * NULL if not found
X */
X`20
X#define`09NULL`090
X`20
Xchar *
Xindex(sp, c)
Xregister char *sp, c;
X`7B
X`09do `7B
X`09`09if (*sp == c)
X`09`09`09return(sp);
X`09`7D while (*sp++);
X`09return(NULL);
X`7D
X`20
$ CALL UNPACK [.UUCODE.VAXC]UUDECODE.C;1 1970902808
$ create 'f'
X#ifndef lint
Xstatic char sccsid`5B`5D = "@(#)uuencode.c`095.5 (Berkeley) 2/24/88";
X#endif
X`20
X/*
X * uuencode `5Binput`5D output
X *
X * Encode a file so it can be mailed to a remote system.
X */
X#include <stdio.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X`20
X/* ENC is the basic 1 character encoding function to make a char printing */
X#define ENC(c) ((c) ? ((c) & 077) + ' ': '`60')
X`20
Xmain(argc, argv)
Xchar **argv;
X`7B
X`09FILE *in;
X`09struct stat sbuf;
X`09int mode;
X`20
X#ifdef VMS
X`09getredirection(&argc, &argv);
X#endif
X`09/* optional 1st argument */
X`09if (argc > 2) `7B
X#ifdef VMS
X`09`09if ((in = fopen(argv`5B1`5D, "r", "mbc=32", "mbf=2")) == NULL) `7B
X#else
X`09`09if ((in = fopen(argv`5B1`5D, "r")) == NULL) `7B
X#endif
X`09`09`09perror(argv`5B1`5D);
X`09`09`09exit(1);
X`09`09`7D
X`09`09argv++; argc--;
X`09`7D else
X`09`09in = stdin;
X`20
X`09if (argc != 2) `7B
X`09`09fprintf(stderr,"Usage: uuencode `5Binfile`5D remotefile\n");
X`09`09exit(2);
X`09`7D
X`20
X`09/* figure out the input file mode */
X`09if (fstat(fileno(in), &sbuf) < 0 `7C`7C !isatty(fileno(in)))
X`09`09mode = 0666 & `7Eumask(0666);
X`09else
X`09`09mode = sbuf.st_mode & 0777;
X`09printf("begin %o %s\n", mode, argv`5B1`5D);
X`20
X`09encode(in, stdout);
X`20
X`09printf("end\n");
X`09exit(0);
X`7D
X`20
X/*
X * copy from in to out, encoding as you go along.
X */
Xencode(in, out)
Xregister FILE *in;
Xregister FILE *out;
X`7B
X`09char buf`5B80`5D;
X`09register int i, n;
X`20
X`09for (;;) `7B
X`09`09/* 1 (up to) 45 character line */
X`09`09n = fread(buf, 1, 45, in);
X`09`09putc(ENC(n), out);
X`20
X`09`09for (i=0; i<n; i += 3)
X`09`09`09outdec(&buf`5Bi`5D, out);
X`20
X`09`09putc('\n', out);
X`09`09if (n <= 0)
X`09`09`09break;
X`09`7D
X`7D
X`20
X/*
X * output one group of 3 bytes, pointed at by p, on file f.
X */
Xoutdec(p, f)
Xregister char *p;
Xregister FILE *f;
X`7B
X`09register int c1, c2, c3, c4;
X`20
X`09c1 = *p >> 2;
X`09c2 = (*p << 4) & 060 `7C (p`5B1`5D >> 4) & 017;
X`09c3 = (p`5B1`5D << 2) & 074 `7C (p`5B2`5D >> 6) & 03;
X`09c4 = p`5B2`5D & 077;
X`09putc(ENC(c1), f);
X`09putc(ENC(c2), f);
X`09putc(ENC(c3), f);
X`09putc(ENC(c4), f);
X`7D
$ CALL UNPACK [.UUCODE.VAXC]UUENCODE.C;1 843254265
$ create 'f'
X$ def sys sys$library
X$ CC /NOLIST/OBJECT=UUENCODE.OBJ UUENCODE.C
X$ CC /NOLIST/OBJECT=ARGPROC.OBJ ARGPROC.C
X$ LINK /TRACE/NOMAP/EXEC=UUENCODE.EXE uuencode.obj,argproc.obj,crtl.opt/opt
X$ CC /NOLIST/OBJECT=UUDECODE.OBJ UUDECODE.C
X$ LINK /TRACE/NOMAP/EXEC=UUDECODE.EXE uudecode.obj,argproc.obj,crtl.opt/opt
X$ CC /NOLIST/OBJECT=UUCAT.OBJ UUCAT.C
X$ LINK /TRACE/NOMAP/EXEC=UUCAT.EXE uucat.obj,argproc.obj,crtl.opt/opt
X$ ! Done.
$ CALL UNPACK [.UUCODE.VAXC]VMSBUILD.COM;1 423873605
$ v=f$verify(v)
$ EXIT
