Category : Files from Magazines
Archive   : CUJ9301.ZIP
Filename : 1101056A

Output of file : 1101056A contained in archive : CUJ9301.ZIP
#if !defined SERIAL_H
#define SERIAL_H


class ComBuffer; // forward declaration

// This class represents everything needed for the
// template parameter. It has a default constructor,
// open, close, read, write, seek, and status.
class SerialStream {
// Default constructor. Initialize an unopened stream
: port(-1)
// Destructor. calls close.
// The open function sets up the default serial port
// parameters, and hook up the interrupts. The name
// is check for "COM1" and "COM2". mode and prot are
// ignored.
int open(const char *name, int mode, int prot);
// Read fills buf with len characters from the
// circular buffer. This class and any class that
// cannot seek should be unbuffered, so read typically
// asks for one character at a time.
int read(char *buf, size_t len);
// Write sends the characters in buf to the port.
int write(char *buf, size_t len);
// Seek is a dummy function and always retruns error.
long seek(long, ios::seek_dir) { return -1; }
// close set the port number to -1 for open testing.
int close();
// This function is the status function.
operator const void *() { return port == -1 ? 0 :
this; }
int port;
ComBuffer *buffPtr;


  3 Responses to “Category : Files from Magazines
Archive   : CUJ9301.ZIP
Filename : 1101056A

  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: