Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!homxb!mtuxo!mtune!rutgers!psuvax1!vu-vlsi!cbmvax!carolyn From: carolyn@cbmvax.UUCP Newsgroups: comp.sys.amiga Subject: Re: Better Printer Output Message-ID: <2665@cbmvax.UUCP> Date: Fri, 30-Oct-87 10:20:43 EST Article-I.D.: cbmvax.2665 Posted: Fri Oct 30 10:20:43 1987 Date-Received: Sun, 1-Nov-87 09:12:35 EST References: <186@iconsys.UUCP> Reply-To: carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) Organization: Commodore Technology, West Chester, PA Lines: 71 Keywords: printer driver code device In article <186@iconsys.UUCP> danny@iconsys.UUCP (Danny Young) writes: >I would like to be able to look at the information in the >PrinterExtendedData portion of the current Preference-chosen >printer driver. > >My question is: Is there a way I can get to this data (through >several levels of indirection) from the pointer returned to me >by an OpenDevice("printer.device") command? ------------------------------------------------------------------------- Fragment of code for accessing printertag and printer prefs. ... #include exec/ports.h #include exec/io.h #include intuition/intuition.h #include devices/printer.h #include devices/prtbase.h ... union printerIO { struct IOStdReq ios; struct IODRPReq iodrp; struct IOPrtCmdReq iopc; }; union printerIO *request; struct MsgPort *printerPort; struct PrinterData *pdata; struct Preferences *prefs; int error; ... main { ... (libraries, init, etc) printerPort = (struct MsgPort *)CreatePort("myPrtPort",0); ... (error checking) request = (union printerIO *)CreateExtIO(printerPort, sizeof(union printerIO)); error = OpenDevice("printer.device",0,request,0) ... (error checking) pdata = (struct PrinterData *)request->ios.io_Device; prefs = (struct Preferences *)&pdata->pd_Preferences; /* Giving you ptr to PrinterData structure and printer device's copy of Preferences in that structure */ printf("Prefs color0 = %x\n",prefs->color0); printf("NumRows = %x\n",pdata->pd_SegmentData->ps_PED.ped_NumRows); /* Last line prints one of the values from the printertag data */ ... } -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Carolyn Scheppner -- CATS >>Commodore Amiga Technical Support<< UUCP ...{allegra,ihnp4,rutgers}!cbmvax!carolyn PHONE 215-431-9180 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=