Mail Archives: djgpp/1999/08/22/10:45:07
On Thu, 19 Aug 1999, David Christensen wrote:
> |> The middle level functions I wrote are;
> |>
> |> comopen() open a serial port
> |> comclose() close serial ports
> |> comsetprm() set transmit parameters of a serial port
> |> comgetprm() get transmit parameters of a serial port
> |> comwrite() write to a serial port
> |> comread() read from a serial port
> |> comsetmcr() set MCR (modem control register) of a serial port
> |> comgetmsr() get MSR (modem status register) of a serial port
> |>
> |> I feel the set of these functions is incomplete. Because
> simple binary level transmfer can be executed by using comwrite()
> and comread(), but text level transmfer requires many cares.
If this is for the DJGPP port of Perl, then I don't think you need to
care about the text/binary nuisance, and possibly not about some of the
details of the functions mentioned above. DJGPP provides the so-called
Filesystem Extension feature, whereby you can install a handler for
low-level I/O operations, such as open, read, write, close, etc. This
handler is called when the library is about to call a DOS or Windows
function to handle the request. The handler gets a chance to recognize
handles and file names that reference the special devices or streams
emulated by the extension, and handle the call instead of DOS/Windows.
This approach relieves the extension from handling the gory details such
as text/binary conversion, buffering, etc., which are done by the library
as usual.
- Raw text -