a1200   NEWS   APPS   DOCS   ABOUT
a1200
----
a1200
----
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

NAME

	PWrite -- internal write to printer port

SYNOPSIS

	error = (*PrinterData->pd_PWrite)(buffer, length);
D0
LONG PWrite(UBYTE *, ULONG);

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 world\n", 12);
CloseDevice(&PReq); /* close the printer device */
}

Comments

Name:
E-mail: Use this if you want a message if you get a response, will not be shown.
Comment:
Select correct short for:

Tristar & Red Sector Inc.

SPB
DJ
ATX
TRSI

Comments:

$VER: d0.se 1.14 Copyright © 2011-2024 Tobias Geijersson support at d0 dot se