28#include "../utility/PError.h"
30#if defined (PEBL_LINUX)
35#if defined (PEBL_WIN32)
42 typedef short (_stdcall *inpfuncPtr)(
short portaddr);
43 typedef void (_stdcall *oupfuncPtr)(
short portaddr,
short datum);
58int Out32(
int i,
int x ){
return 1;};
88 int out = ioperm(
mPort, 3, 1);
91 std::cerr <<
"Initiating parallel port. Return value :["<<out<<
"]\n";
101#elif defined(PEBL_WIN32)
105 hLib = LoadLibrary(
"inpout32.dll");
113 inp32fp = (inpfuncPtr) GetProcAddress(hLib,
"Inp32");
121 oup32fp = (oupfuncPtr) GetProcAddress(hLib,
"Out32");
123 if (oup32fp ==
NULL) {
155 std::cerr <<
"Cannot set port to ["<<v<<
"]. Setting to LPT1.\n";
164 int out =ioperm(
mPort,3,0);
165#elif defined (PEBL_WIN32)
185#if defined(PEBL_LINUX)
187#elif defined (PEBL_WIN32)
199#if defined(PEBL_LINUX)
202#elif defined (PEBL_WIN32)
213#if defined(PEBL_LINUX)
215#elif defined (PEBL_WIN32)
235#if defined(PEBL_LINUX)
238 outb(x & ~0x20,
mPort+2);
239#elif defined (PEBL_WIN32)
254#if defined(PEBL_LINUX)
255 unsigned char x = inb(
mPort+2);
257 outb( x | 0x20,
mPort+2);
258#elif defined (PEBL_WIN32)
268 out <<
"<Generic Parallel Port Object>" << flush;
virtual void SetDataState(char x)
virtual void SetOutputMode()
virtual void SetPort(Variant v)
virtual char GetStatusState()
virtual void SetInputMode()
virtual void EmulateStandardPort()
PParallelPort()
The Standard constructor.
virtual char GetDataState()
virtual int GetState(int iface)
virtual std::ostream & SendToStream(std::ostream &out) const
virtual ~PParallelPort()
The Standard destructor.
void SignalFatalError(const std::string &message)