Logo Search packages:      
Sourcecode: c2n version File versions  Download package

static void p_write ( enum pulse  p  )  [static]

Write a pulse to the serial line or to standard output

Parameters:
p the pulse to be written

Definition at line 606 of file c2n.c.

References Pause.

Referenced by main().

{
  if (p >= sizeof pulses)
    return;
#ifdef HAS_SERIAL
  if (serialfd) {
# if defined __AMIGA__
    actbuf[datain++] = pulses[p];
# else /* !AMIGA */
    buf[datain++] = pulses[p];
# endif /* !AMIGA */
    if (p == Pause || datain == sizeof buf) {
# ifdef WIN32
      unsigned long len;
      WriteFile (serialfd, buf, datain, &len, 0);
# elif defined __AMIGA__
      if (pending)
      flushout ();
      pending = 1;
      ser.IOSer.io_Command = CMD_WRITE;
      ser.IOSer.io_Length = datain;
      ser.IOSer.io_Data = actbuf;
      SendIO ((struct IORequest*) &ser);
      actbuf = actbuf != buf ? buf : buf2;
# else /* !WIN32 && !AMIGA */
      write (serialfd, buf, datain);
# endif /* !WIN32 && !AMIGA */
      datain = 0;
    }
  }
  else
#endif /* HAS_SERIAL */
    putchar (pulses[p]);
}


Generated by  Doxygen 1.6.0   Back to index