tac0S
Template Affectional Command Operating System
synchconsole.h
Go to the documentation of this file.
1 
8 #ifndef SYNCHCONSOLE_H
9 #define SYNCHCONSOLE_H
10 
11 #include "copyright.h"
12 #include "utility.h"
13 #include "console.h"
14 
15 class SynchConsole {
16  public:
17  SynchConsole(char *readFile, char *writeFile);
18  // initialize the hardware console device
19  ~SynchConsole(); // clean up console emulation
20  void SynchPutChar(const char ch); // Unix putchar(3S)
21  int SynchGetChar(); // Unix getchar(3S)
22  void SynchPutString(const char *s); // Unix puts(3S)
23  void SynchGetString(char *s, int n); // Unix fgets(3S)
24  bool Feof(); // Unix Feof
25  int fopen(const char* filename, unsigned int tid);
26  int fgets(char* into, int FileDescriptor, int numBytes, unsigned int tid);
27  int fputs(char* from, int fileDescriptor, int numBytes, unsigned int tid);
28  void fseek(int fileDescriptor, int position, unsigned int tid);
29  int fclose(int fileDescriptor, int* threadTableFileDescriptor, unsigned int tid);
30  private:
31 
32  Console *console;
33 };
34 #endif // SYNCHCONSOLE_H
Definition: synchconsole.h:15
int SynchGetChar()
SynchConsole::SynchGetChar Wait for a char to be available and return is int value.
Definition: synchconsole.cc:90
void SynchPutString(const char *s)
SynchConsole::SynchPutString Write a String in the output stream. This is more efficent than multiple...
Definition: synchconsole.cc:108
SynchConsole(char *readFile, char *writeFile)
SynchConsole::SynchConsole Initiate semaphore and Console class.
Definition: synchconsole.cc:51
void SynchPutChar(const char ch)
SynchConsole::SynchPutChar Write a char in the output stream.
Definition: synchconsole.cc:74
~SynchConsole()
SynchConsole::~SynchConsole Clean up the SynchConsole.
Definition: synchconsole.cc:63
The following class defines a hardware console device. Input and output to the device is simulated by...
Definition: console.h:40
Miscellaneous useful definitions, including debugging routines.
void SynchGetString(char *s, int n)
SynchConsole::SynchPutString Get a String from the stream. This is more efficent than multiple GetCha...
Definition: synchconsole.cc:131
Data structures to simulate the behavior of a terminal I/O device.
bool Feof()
SynchConsole::Feof Test wether the output stream have available charactere to read.
Definition: synchconsole.cc:154