                            LIBMODEM

Version:       0.99.2 (ALPHA)
Author:        Riccardo Facchetti
e-mail:        riccardo@cdc8g5.cdc.polimi.it
Copyright:     (C) 1994, 1995 Riccardo Facchetti under the terms of the
               GNU Library General Public Licence

WHAT IS THIS ?
libmodem.a is a library that allow you to use your modems transparently with
regard of kind of modem attached to a line. You have just to

int fd;
...
fd = dial("Some-phone-number");
...

and it will return to you a file descriptor of the dialed line.
To hangup just hangup(fd).
Of course, you have to configure all your modem lines in the /etc/modems file to
allow the library know which modem lines it can use to dial.

NOTES:
libmodem is written for Linux, but i think you can easily port this package on
other platforms (that have POSIX_TERMIOS of course :))
This is an ALPHA version of the code, developed as modem library for another
package. The library libmodem is distributed as a package, subjected to the
GNU LIBRARY GENERAL PUBLIC LICENSE
This package permit dialout only (for now). In the future, i think i will write
the routines that manage dialin connections too.

TANKS:
Some parts of the code (mainly termios setup) are based on the work
of Gert Doering (mgetty-0.21):
thanks Gert, without your code i couldn't write down the termios spaghetti.
In no way Gert is responsible for the pieces of code i'd stole from his mgetty.

HISTORY:
I needed a modem library that with a single function call allows me to
dial a remote modem, and returns a file descriptor that i can use,
dupping it to stdin and stdout. This is a part of a project of
communication software: a 2nd level password protection for a Linux box
used as terminal server (here in Italy we still have not enabled the CallerID).

I've searched for such a modem package and i've found a little but promising
package called libmodemcap. It is a package that manage modems with a file
a la termcap. After unpacking and examination of the package i've pointed
out at least two important things that make libmodemcap not the Right Thing for
me:

1)  It have little or nothing at all control over modem talking (here i mean
    write INIT string
        Wait 'OK'
        Check 'OK'
    write CALL string
        Wait 'CONNECT'
        Check 'CONNECT'
    write HANGUP string
        Wait 'OK' ... maybe
        Check 'OK' ... maybe
    )
    It lacks 'Wait <something>' just to be sure the modem have done what you
    just asked it to do; was a little problem, but present (to be truth that was
    a major problem for me: i don't want a modem be hung without a way to know
    that it must be reset!!!).

2)  Look at its copyright. It is not GPL, it is something i don't like too much.

3)  ...

Anyway thanks to John F. Haugh II (the author of libmodemcap) for having made me
write this package (in fact i don't know him, i never heard nothing about him,
and i suppose he's never heard nothing about me :)

JUST ANOTHER WORD:
The decision to write libmodem was not only reached for the above reasons.
I have not found a similar package in the Linux distributions and ftp sites.
So I've written this package for the Linux community.

Guys, enjoy it!
