Category : Printer + Display Graphics
Archive   : AVRIL11.ZIP
Filename : PACKET.C

Output of file : PACKET.C contained in archive : AVRIL11.ZIP
/* Device packet support for PC version of AVRIL */

/* Written by Bernie Roehl, June 1994 */

/* Copyright 1994 by Bernie Roehl */

/* You may use this code for your own non-commercial projects without
paying any fees or royalties. "Non-commercial", in this context,
means that the software you write is given away for free to anyone
who wants it.

Commercial use, including shareware, requires a licensing
fee and a specific written agreement with the author.

All programs created using this software (both commercial and
non-commercial) must acknowledge the use of the AVRIL library,
both in the documentation and in a banner screen at the start or
end of the program.

For more information, contact Bernie Roehl ([email protected]).



#include "avril.h"

vrl_DevicePacketBuffer *vrl_DeviceCreatePacketBuffer(int buffsize)
vrl_DevicePacketBuffer *p;
p = malloc(sizeof(vrl_DevicePacketBuffer));
if (p == NULL) return NULL;
p->buffer = malloc(buffsize);
if (p->buffer == NULL)
return NULL;
p->ind = 0; p->buffsize = buffsize;
return p;

void vrl_DeviceDestroyPacketBuffer(vrl_DevicePacketBuffer *buff)
if (buff->buffer) free(buff->buffer);

vrl_Boolean vrl_DeviceGetPacket(vrl_SerialPort *port, vrl_DevicePacketBuffer *buff)
while (vrl_SerialCheck(port))
int c = vrl_SerialGetc(port);
if (c & 0x80) /* framing bit set */
buff->ind = 0;
if (buff->ind < buff->buffsize)
buff->buffer[buff->ind++] = c;
if (buff->ind == buff->buffsize)
++buff->ind; /* make sure we only return it once */
return 1; /* complete packet received */
return 0; /* no data waiting, packet not yet complete */

  3 Responses to “Category : Printer + Display Graphics
Archive   : AVRIL11.ZIP
Filename : PACKET.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: