3 # Created by shar, version 0.5 - 04/10/91
5 # This is a shell archive, meaning:
6 # 1. Remove everything about the #! /bin/sh line.
7 # 2. Save the resulting text in a file.
8 # 3. Execute the file with /bin/sh to create:
11 # ------ -------------------------------------
12 # 128 uucomp-1.1/Compress
13 # 264 uucomp-1.1/Copyright
14 # 410 uucomp-1.1/INTERNALS
15 # 1069 uucomp-1.1/Makefile
16 # 3528 uucomp-1.1/README
17 # 632 uucomp-1.1/crmail.c
18 # 632 uucomp-1.1/crnews.c
20 # 3506 uucomp-1.1/uucomp.c
21 # 383 uucomp-1.1/uucomp.h
24 if test ! -d uucomp-1.1 ; then
29 # This archive created Tue Sep 28 20:21:14 1993
32 echo "shar: extracting uucomp-1.1/Compress - (128 characters)"
33 if test -f 'uucomp-1.1/Compress' ; then
34 echo shar: will not over-write existing file uucomp-1.1/Compress
36 sed 's/^X//' << \SHAR_EOF > 'uucomp-1.1/Compress'
39 X if [ -d /usr/spool/uucp/$i ]
42 X cd /usr/spool/uucp/$i
47 if test 128 -ne "`wc -c < 'uucomp-1.1/Compress'`" ; then
48 echo "shar: ***** error transmitting file uucomp-1.1/Compress (should have been 128 characters, but was "`wc -c < 'uucomp-1.1/Compress'`" characters) *****"
52 touch 0715110393 uucomp-1.1/Compress
53 chmod 0700 uucomp-1.1/Compress
55 echo "shar: extracting uucomp-1.1/Copyright - (264 characters)"
56 if test -f 'uucomp-1.1/Copyright' ; then
57 echo shar: will not over-write existing file uucomp-1.1/Copyright
59 sed 's/^X//' << \SHAR_EOF > 'uucomp-1.1/Copyright'
63 X * Copyright 1993 by Ed Carp (erc@apple.com) All rights reserved.
65 X * Permission is hereby granted for any non-commercial use of this
66 X * program, as long as this copyright notice remains intact. Commercial
67 X * users may contact me - I'm easy.
72 if test 264 -ne "`wc -c < 'uucomp-1.1/Copyright'`" ; then
73 echo "shar: ***** error transmitting file uucomp-1.1/Copyright (should have been 264 characters, but was "`wc -c < 'uucomp-1.1/Copyright'`" characters) *****"
77 touch 0715174993 uucomp-1.1/Copyright
78 chmod 0600 uucomp-1.1/Copyright
80 echo "shar: extracting uucomp-1.1/INTERNALS - (410 characters)"
81 if test -f 'uucomp-1.1/INTERNALS' ; then
82 echo shar: will not over-write existing file uucomp-1.1/INTERNALS
84 sed 's/^X//' << \SHAR_EOF > 'uucomp-1.1/INTERNALS'
85 XThis is the basic workflow for uucomp:
89 X if not "C." file skip
91 X read 1 line from C. file
92 X grab second and 10th field (second is data file name,
93 X 10th is command name)
94 X if open fail on second field, skip
95 X if 10th field isn't "rmail" or "rnews", skip
96 X execute "gzip -9" on second field
97 X change "rmail" and "rnews" to "crmail" and "crnews", respectively
101 if test 410 -ne "`wc -c < 'uucomp-1.1/INTERNALS'`" ; then
102 echo "shar: ***** error transmitting file uucomp-1.1/INTERNALS (should have been 410 characters, but was "`wc -c < 'uucomp-1.1/INTERNALS'`" characters) *****"
106 touch 0715174693 uucomp-1.1/INTERNALS
107 chmod 0600 uucomp-1.1/INTERNALS
109 echo "shar: extracting uucomp-1.1/Makefile - (1069 characters)"
110 if test -f 'uucomp-1.1/Makefile' ; then
111 echo shar: will not over-write existing file uucomp-1.1/Makefile
113 sed 's/^X//' << \SHAR_EOF > 'uucomp-1.1/Makefile'
115 X# Makefile generated with genmake - version 1.1 08/22/92
117 X# genmake is Copyright 1991 by Edwin R. Carp
119 X# GENMAKE -B/usr/bin -tsp [files]
124 XSOURCES = crmail.c crnews.c uucomp.c
125 XOBJECTS = crmail.o crnews.o uucomp.o
126 XPROGRAMS = /usr/bin/crmail /usr/bin/crnews /usr/bin/uucomp
128 Xall: $(PROGRAMS) tags
130 X/usr/bin/crmail: crmail.o
131 X $(CC) $(CFLAGS) -o crmail crmail.o $(LDFLAGS) -O
136 X/usr/bin/crnews: crnews.o
137 X $(CC) $(CFLAGS) -o crnews crnews.o $(LDFLAGS) -O
142 X/usr/bin/uucomp: uucomp.o
143 X $(CC) $(CFLAGS) -o uucomp uucomp.o $(LDFLAGS) -O
149 X /bin/rm -f $(OBJECTS) MAKELOG eddep makedep
152 X /bin/rm -f $(OBJECTS) $(PROGRAMS) MAKELOG eddep makedep *~ *.bak *.BAK
156 X echo "make all > MAKELOG 2>&1 &"|/bin/sh
159 X genmake -B/usr/bin -tsp $(SOURCES) &
162 X genmake -B/usr/bin -tsp *.c &
165 X ctags $(SOURCES) > tags
168 if test 1069 -ne "`wc -c < 'uucomp-1.1/Makefile'`" ; then
169 echo "shar: ***** error transmitting file uucomp-1.1/Makefile (should have been 1069 characters, but was "`wc -c < 'uucomp-1.1/Makefile'`" characters) *****"
173 touch 0714235093 uucomp-1.1/Makefile
174 chmod 0600 uucomp-1.1/Makefile
176 echo "shar: extracting uucomp-1.1/README - (3528 characters)"
177 if test -f 'uucomp-1.1/README' ; then
178 echo shar: will not over-write existing file uucomp-1.1/README
180 sed 's/^X//' << \SHAR_EOF > 'uucomp-1.1/README'
181 XLike most people these days, I'm looking for ways to make my computing
182 Xenvironment more efficient. This environment consists of a 486, a 386,
183 Xand a 386SL laptop, all of which run Taylor uucp under Linux. The 386
184 Xlaptop gets used a lot, since it goes wherever I go and I answer a lot
185 Xof news and email every day. Often, I must use other people's facilities
186 X(phone lines and such) to send out replies and post news if I'm not at home.
187 XSince it's not fair to the client for them to pay for my zone calls back
188 Xto my home in Fremont, I place the calls on my phone card. Unfortunately,
189 XPacBell is very proud of the services they offer, especially in regards
190 Xto this convenience of automatically charging calls to my house wherever I
191 Xmay be. Considering that this can be very expensive to do, I searched for
192 Xa way to cut my phone bill down to something I could afford to pay each
193 Xmonth without fainting every time I saw the bill.
195 XThe first thing I did was to go out and plunk $195 for a 14.4KB modem.
196 XThat helped, but C-News is very slow on my laptop, and batching articles
197 Xis even slower, and email (of course) isn't batched at all. Even with
198 XMNP5 compression turned on, this doesn't make for a very efficient setup,
199 Xeven at high speeds.
201 XPlaying around with uucp told me that the line turnaround wasn't that much
202 Xoverhead, nor was sending the C./X. files (the execute files) - the real
203 Xoverhead was sending out uncompressed news and especially email, since
204 XI subscribe to several mailing lists and digests can run quite large.
206 XI looked at uubatch, but the most current version I could find (1.05) was
207 Xnot compatible with Taylor uucp (and I had no other alternative), so I
208 Xdecided to write my own. Experiments with "gzip -9" convinced me that
209 Xthat was the way to go, since gzip gives email and news 60 to 75 percent
210 Xcompression, which would tend to cut one's phone bill significantly.
212 XYou hold in your mailbox (or news reader) the end result of that effort.
213 XBear in mind that (1) this is a "first cut" and while it is unlikely that
214 Xthere are very many bugs, there are certainly places where the programs could
215 Xbe improved and tuned. Suggestions and comments are welcome!
219 X 1. Feed this to shar.
220 X 2. Look at the Makefile. Make sure that the paths for
221 X things are set up correctly.
222 X 3. Look at uucomp.h and make sure that the path and
223 X options for COMPRESS/UNCOMPRESS are set up properly.
224 X 3. Type "make". This will make uucomp, crmail, and crnews
225 X and will place them in /usr/bin. Move Compress into
227 X 4. Make an entry in crontab to do
228 X /usr/lib/uucp/Compress site1 site2 site3...
229 X occasionally. It is suggested that this be done fairly
230 X frequently. Alternately, you could set up a login shell
231 X for selected sites to run uucomp every time that site
233 X 5. Don't forget to add /usr/bin/crmail and /usr/bin/crnews
234 X to the list of programs allowed to be executed in your
235 X Permissions file (if running HDB UUCP), or whatever is
236 X appropriate for your version of uucp.
238 XEnjoy! Any questions or comments can be sent to erc@apple.com.
240 XNote: This is tuned for Taylor uucp, but would not be particularly
241 Xdifficult to adapt to other version of uucp. See the file INTERNALS for
242 Xdetails of how this works.
247 X------------------------------------------------------------------------------
250 X Version Date Description
252 X 1.1 08/04/93 Added sanity check in C. file (check that
253 X 'E' is first char in file, otherwise skip)
255 if test 3528 -ne "`wc -c < 'uucomp-1.1/README'`" ; then
256 echo "shar: ***** error transmitting file uucomp-1.1/README (should have been 3528 characters, but was "`wc -c < 'uucomp-1.1/README'`" characters) *****"
260 touch 0804224993 uucomp-1.1/README
261 chmod 0600 uucomp-1.1/README
263 echo "shar: extracting uucomp-1.1/crmail.c - (632 characters)"
264 if test -f 'uucomp-1.1/crmail.c' ; then
265 echo shar: will not over-write existing file uucomp-1.1/crmail.c
267 sed 's/^X//' << \SHAR_EOF > 'uucomp-1.1/crmail.c'
269 X * crmail - get compressed mail from host, uncompress
270 X * WARNING: This may be insecure!
275 X * Copyright 1993 by Ed Carp (erc@apple.com) All rights reserved.
277 X * Permission is hereby granted for any non-commercial use of this
278 X * program, as long as this copyright notice remains intact. Commercial
279 X * users may contact me - I'm easy.
292 X sprintf (cmd, "%s|%s ", UNCOMPRESS, RMAIL);
293 X for (i = 1; i < argc; i++)
295 X strcat (cmd, argv[i]);
302 if test 632 -ne "`wc -c < 'uucomp-1.1/crmail.c'`" ; then
303 echo "shar: ***** error transmitting file uucomp-1.1/crmail.c (should have been 632 characters, but was "`wc -c < 'uucomp-1.1/crmail.c'`" characters) *****"
307 touch 0715195493 uucomp-1.1/crmail.c
308 chmod 0600 uucomp-1.1/crmail.c
310 echo "shar: extracting uucomp-1.1/crnews.c - (632 characters)"
311 if test -f 'uucomp-1.1/crnews.c' ; then
312 echo shar: will not over-write existing file uucomp-1.1/crnews.c
314 sed 's/^X//' << \SHAR_EOF > 'uucomp-1.1/crnews.c'
316 X * crnews - get compressed news from host, uncompress
317 X * WARNING: This may be insecure!
322 X * Copyright 1993 by Ed Carp (erc@apple.com) All rights reserved.
324 X * Permission is hereby granted for any non-commercial use of this
325 X * program, as long as this copyright notice remains intact. Commercial
326 X * users may contact me - I'm easy.
339 X sprintf (cmd, "%s|%s ", UNCOMPRESS, RNEWS);
340 X for (i = 1; i < argc; i++)
342 X strcat (cmd, argv[i]);
349 if test 632 -ne "`wc -c < 'uucomp-1.1/crnews.c'`" ; then
350 echo "shar: ***** error transmitting file uucomp-1.1/crnews.c (should have been 632 characters, but was "`wc -c < 'uucomp-1.1/crnews.c'`" characters) *****"
354 touch 0715195593 uucomp-1.1/crnews.c
355 chmod 0600 uucomp-1.1/crnews.c
357 echo "shar: extracting uucomp-1.1/tags - (108 characters)"
358 if test -f 'uucomp-1.1/tags' ; then
359 echo shar: will not over-write existing file uucomp-1.1/tags
361 sed 's/^X//' << \SHAR_EOF > 'uucomp-1.1/tags'
362 Xmain crmail.c /^main (argc, argv)$/
363 Xmain crnews.c /^main (argc, argv)$/
364 Xmain uucomp.c /^main (argc, argv)$/
366 if test 108 -ne "`wc -c < 'uucomp-1.1/tags'`" ; then
367 echo "shar: ***** error transmitting file uucomp-1.1/tags (should have been 108 characters, but was "`wc -c < 'uucomp-1.1/tags'`" characters) *****"
371 touch 0804224993 uucomp-1.1/tags
372 chmod 0600 uucomp-1.1/tags
374 echo "shar: extracting uucomp-1.1/uucomp.c - (3506 characters)"
375 if test -f 'uucomp-1.1/uucomp.c' ; then
376 echo shar: will not over-write existing file uucomp-1.1/uucomp.c
378 sed 's/^X//' << \SHAR_EOF > 'uucomp-1.1/uucomp.c'
380 X * uucomp - compress outgoing news/mail
382 X * usage: uucomp C.*
384 X * This works for Taylor uucp (available from prep.ai.mit.edu:/pub/gnu/uucp*),
385 X * but I don't promise it works for anyone else's uucp package. Basically, this
386 X * is a quick-n-dirty hack to get compressed mail and news to a uucp site. This
387 X * becomes important when you're on the other end of a 1200 baud packet radio
388 X * link, where the throughput can be 60 CPS (or lower). It also tends to hide
389 X * any nasties that people might want to say to you, since the packets *are*
390 X * public readable. Yes, I looked at uubatch, but it was too complicated for
391 X * me to figure out <grin>, and it didn't work with Taylor-uucp. This is almost
392 X * too simple to work...
394 X * To use this little guy, do something like this in the .bashrc or .profile
395 X * or .cshrc of the uucp's login shell:
397 X * cd /usr/spool/uucp/<wherever the C. and D. files are kept>
398 X * /usr/bin/uucomp C.*
399 X * exec /usr/lib/uucp/uucico
401 X * This program was written by Ed Carp (erc@apple.com). It can be used for any
402 X * non-commercial purpose. This software is freely redistributable.
407 X * Copyright 1993 by Ed Carp (erc@apple.com) All rights reserved.
409 X * Permission is hereby granted for any non-commercial use of this
410 X * program, as long as this copyright notice remains intact. Commercial
411 X * users may contact me - I'm easy.
423 X int i, j, sw, ctr = 0, errflag = 0, mctr = 0, nctr = 0, skipctr = 0;
424 X char scr[64], rcmd[10], line[1024], lineout[1024];
425 X char *strtok (), *ptr, *lineptr, compfile[32];
428 X printf ("uucomp 1.1 08/04/93 ... by erc@apple.com\nscanning %d files.", argc - 1);
429 X for (i = 1; i < argc; i++)
431 X if (strncmp (argv[i], "C.", 2) != 0)
436 X if ((in = fopen (argv[i], "r+")) == (FILE *) NULL)
441 X fgets (line, 1022, in);
447 X line[strlen (line) - 1] = NULL;
456 X ptr = strtok (lineptr, " ");
462 X if (access (ptr, 4) == EOF)
465 X printf ("skip: file '%s' doesn't exist\n", ptr);
469 X * skip it if the data file isn't
473 X strcpy (compfile, ptr);
477 X if (strcmp (ptr, "rmail") != 0 && strcmp (ptr, "rnews") != 0)
480 X printf ("skip: '%s' wrong command\n", ptr);
485 X if (strcmp (ptr, "rmail") == 0)
487 X if (strcmp (ptr, "rnews") == 0)
490 X strcat (lineout, "c");
492 X strcat (lineout, ptr);
493 X strcat (lineout, " ");
501 X fprintf (in, "%s\n", lineout);
504 X "%s -fc > /tmp/uucomp.%d < %s;cp /tmp/uucomp.%d %s",
505 X COMPRESS, getpid (), compfile, getpid (), compfile);
509 X sprintf (line, "/tmp/uucomp.%d", getpid ());
511 X printf ("\n%d skipped, %d compressed (%d mail, %d news).\n",
512 X skipctr, ctr, mctr, nctr);
516 if test 3506 -ne "`wc -c < 'uucomp-1.1/uucomp.c'`" ; then
517 echo "shar: ***** error transmitting file uucomp-1.1/uucomp.c (should have been 3506 characters, but was "`wc -c < 'uucomp-1.1/uucomp.c'`" characters) *****"
521 touch 0804224693 uucomp-1.1/uucomp.c
522 chmod 0600 uucomp-1.1/uucomp.c
524 echo "shar: extracting uucomp-1.1/uucomp.h - (383 characters)"
525 if test -f 'uucomp-1.1/uucomp.h' ; then
526 echo shar: will not over-write existing file uucomp-1.1/uucomp.h
528 sed 's/^X//' << \SHAR_EOF > 'uucomp-1.1/uucomp.h'
531 X * Copyright 1993 by Ed Carp (erc@apple.com) All rights reserved.
533 X * Permission is hereby granted for any non-commercial use of this
534 X * program, as long as this copyright notice remains intact. Commercial
535 X * users may contact me - I'm easy.
539 X#define COMPRESS "/usr/bin/gzip -9c"
540 X#define UNCOMPRESS "/usr/bin/gzip -dc"
541 X#define RMAIL "rmail"
542 X#define RNEWS "rnews"
544 if test 383 -ne "`wc -c < 'uucomp-1.1/uucomp.h'`" ; then
545 echo "shar: ***** error transmitting file uucomp-1.1/uucomp.h (should have been 383 characters, but was "`wc -c < 'uucomp-1.1/uucomp.h'`" characters) *****"
549 touch 0715190293 uucomp-1.1/uucomp.h
550 chmod 0600 uucomp-1.1/uucomp.h
551 echo End of all shell archives