[Contents] [Index] [Help] [Retrace] [browse <] [Browse >]


NAME
    PWrite -- internal write to printer port

SYNOPSIS
    error = (*PrinterData->pd_PWrite)(buffer, length);
    D0                                  A0      D0

FUNCTION
    PWrite writes 'length' bytes directly to the printer.  This
    function is generally called by printer drivers to send
    their buffer(s) to the printer.

    This function is accessed by referencing off the printerdata (pd)
    structure.  Below is a code fragment to show how to do get access
    to a pointer to the printerdata (pd) structure.

    #include <exec/types.h>
    #include <devices/printer.h>
    #include <devices/prtbase.h>

    struct iodrpreq preq;
    struct printerdata *pd;
    struct printerextendeddata *ped;

    /* open the printer device (any version); if it opened... */
    if (OpenDevice("printer.device", 0, &PReq, 0) == NULL) {

        /* get pointer to printer data structure */
        PD = (struct printerdata *)preq.io_device;

        /* write something directly to the printer */
        (*PD->pd_PWrite)("Hello worldn", 12);

        CloseDevice(&PReq); /* close the printer device */
    }