Autodocs Devices:
printer.device --background-- CMD_FLUSH CMD_INVALID CMD_RESET CMD_START CMD_STOP CMD_WRITE CallErrHook PBothReady PQuery PRD_DUMPRPORT PRD_DUMPRPORTTAGS PRD_EDITPREFS PRD_PRTCOMMAND PRD_QUERY PRD_RAWWRITE PRD_READPREFS PRD_SETERRHOOK PRD_WRITEPREFS PRead PWrite Include GuruMeditation
|
Docs » Autodocs » printer.device » PWrite
PWrite -- internal write to printer port
error = (*PrinterData->pd_PWrite)(buffer, length); D0 LONG PWrite(UBYTE *, ULONG);
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 world\n", 12); CloseDevice(&PReq); /* close the printer device */ }
|