Hi there,

this is a new version of the lpr and its belonging tools for use with MiNT.
The olny lpd I could find for the Atari was bad in handling printjobs,
because:
1)   the lpd prints the files via bconout routine, which cause that it
     not olny need much processing time, but also hog the system until
     the character is written. That means if you turn off the printer
     while lpd is printing a file, your system will be halted until you
     will turn on the printer again. (try it!)

2)   the lpd permantly reads from disk. This is bad in some ways I think.
     First it needs cpu time. Second it blocks the disk. I don't like
     both for instance if I want to compile, so I have to kill and restart
     the lpd everytime I don't need to print, but I need the cpu.
     Third it prevent my harddrive from going sleep after a special time.
     (nice option, but so it'll never be used :-( )

3)   all tools use a lock-file semaphore. That means extra effort to create
     the file and extra loops with sleep() to wait for the semaphore. A large
     sleeptime means little cpu-load, but often unnecessary waiting, and the
     other way is even worse. Furthermore it seems this way doesn't work on
     the /pipe/ filesystem, because the lock-file is removed when the
     get_semaphore() procedure do fclose(). So there isn't a real locking.

4)   lprm crashes while removing a job with a bus-error.
     (olny a little error in handling the arguments)

5)   the lpr copies the files byte per byte to eventually translate them.
     But, if you olny want to print a file how it is, it's better (faster)
     to use "cat file > /dev/lp &". I my eyes that's stupid, I want to have
     a homogen use of the printer.

That's all I remember, what I didn't like on the old lpd. So I tried to
improve it.

First of all I wanted the lpd to print via the /dev/lp device. This is a
device-driver for the centronics port from T. Bousch and U. Kuehn, that is
interrupt-driven and therfore doesn't hog the system. But you can also
write to /dev/prn or even /dev/console (by rename the devices; or change
the DEVNAME in lpr.h and recompile lpd). The new printroutine is now in
print.c, that is olny for a faster remake of the lpd while developing the
printroutine. (An 8MHz 4MB Atari isn't that fast :-))

Next I rewrite lpd.c to make the lpd a real deamon, which puts itself in
the backround, give up its tty and change its homedirectory and so on.

Then I rewrite the sema.c file to use real Semaphores offerd by MiNT. It
looks a little bit stupid now, because it's olny one procedure call, but
it make it easyer to change it again, e.g. for another OS.

Next I rewrite lpd.c and lpr.c in that way, that now the lpd doesn't
read from disk permanently, but will be activated by the HUP signal.
lpr now send the SIGHUP to the running daemon after creating the printjobs,
to cause the daemon to print these jobs.

Finally I rewrite lpr.c to make the lpr copy the printfiles much faster
(like cat), if there aren't any translation options. Now you can use
"lpr <file> ..." to print the file in the backround instead of the "cat"
command. The copy routines are now in write.c (same reason like print.c).

The bug in lprm is also removed, so it won't crash anymore.
olny in the lpd-net version:
I had some trouble with writing to the log-file, that's why I changed the
file handling of the log-file.

Moreover I cleaned the source files (e.g. there were some unused vars)
and changed the Makefile.

Last but not least, I've now also rewritten the LPRMESSAGE routines.
That means, the daemon and lprm don't write their logmessages direkt to the
lpd.log file any longer. They now use syslog-messages and you can choose
where the output should go, by changing the syslog.conf in /etc/.
Example for a line in syslog.conf wich controls the output of the
lpr-messages (see syslog man for more information):
lpr.debug;lpr.err;lpr.notice                            /var/adm/lpd.log
Note: lpr.debug isn't used yet by the programs.

Problem:
If you have a network running and want to print any printjob via the network
then you can't use these versions of lpd, lpr, lprm and lpstat.
See README.net in lpd-net.

Ok, that's all. This package includes the new source files, the binaries
I compiled and the doc file and translation.tab from the old distribution.
I hope the author of the original lpd distribution isn't angry, that I used
his source code, but it is public and I think anyone can and should use it
to develop more nice tools for the Atari.
Anyhow, thanx to hsg for his lpr package.

For any errors, which appears while using these tools, I can't assume
the responsibility, so use the programs at your own risk.

Enjoy,

Raiko Nitzsche
e-mail: raiko@informatik.uni-rostock.de
