home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 563.lha / QPrint_v1.0 / QPrint.c < prev    next >
C/C++ Source or Header  |  1991-04-23  |  893b  |  39 lines

  1. /*
  2. This program sets the FASTMODE bit in Kick2.0 parallel.device
  3. */
  4.  
  5.  
  6. void __stdargs fprintf(BPTR, const char *, ...);
  7.  
  8. void print(char *s)
  9. {
  10.  fprintf(Output(), "%s", s);
  11. }
  12.  
  13. void __saveds __stdargs main(void)
  14. {
  15.  struct MsgPort  *QPrintPort;
  16.  struct IOExtPar *QPrintReq;
  17.  
  18.  if (QPrintPort = CreatePort("QPrintPort", 0))
  19.  {
  20.   if (QPrintReq = (struct IOExtPar *)CreateExtIO(QPrintPort, sizeof(struct IOExtPar)))
  21.   {
  22.    if (!OpenDevice(PARALLELNAME, 0, (struct IORequest *)QPrintReq, 0))
  23.    {
  24.     QPrintReq->io_ParFlags |= PARF_FASTMODE;
  25.     QPrintReq->IOPar.io_Command = PDCMD_SETPARAMS;
  26.     
  27.     DoIO((struct IORequest *)QPrintReq);
  28.     
  29.     CloseDevice((struct IORequest *)QPrintReq);
  30.    }
  31.    else print("Can't open "PARALLELNAME);
  32.    DeleteExtIO((struct IORequest *)QPrintReq);
  33.   }
  34.   else print("Can't create QPrintReq");
  35.   DeletePort(QPrintPort);
  36.  }
  37.  else print("Can't create QPrintPort");
  38. }
  39.