tac0S
Template Affectional Command Operating System
Public Member Functions | List of all members
SynchConsole Class Reference

Public Member Functions

 SynchConsole (char *readFile, char *writeFile)
 SynchConsole::SynchConsole Initiate semaphore and Console class. More...
 
 ~SynchConsole ()
 SynchConsole::~SynchConsole Clean up the SynchConsole.
 
void SynchPutChar (const char ch)
 SynchConsole::SynchPutChar Write a char in the output stream. More...
 
int SynchGetChar ()
 SynchConsole::SynchGetChar Wait for a char to be available and return is int value. More...
 
void SynchPutString (const char *s)
 SynchConsole::SynchPutString Write a String in the output stream. This is more efficent than multiple PutChar beacause. More...
 
void SynchGetString (char *s, int n)
 SynchConsole::SynchPutString Get a String from the stream. This is more efficent than multiple GetChar beacause. More...
 
bool Feof ()
 SynchConsole::Feof Test wether the output stream have available charactere to read. More...
 
int fopen (const char *filename, unsigned int tid)
 
int fgets (char *into, int FileDescriptor, int numBytes, unsigned int tid)
 
int fputs (char *from, int fileDescriptor, int numBytes, unsigned int tid)
 
void fseek (int fileDescriptor, int position, unsigned int tid)
 
int fclose (int fileDescriptor, int *threadTableFileDescriptor, unsigned int tid)
 

Constructor & Destructor Documentation

SynchConsole::SynchConsole ( char *  readFile,
char *  writeFile 
)

SynchConsole::SynchConsole Initiate semaphore and Console class.

Parameters
readFile: – UNIX file simulating the keyboard (NULL -> use stdin)
"writeFile"– UNIX file simulating the display (NULL -> use stdout)

Member Function Documentation

bool SynchConsole::Feof ( )

SynchConsole::Feof Test wether the output stream have available charactere to read.

Returns
Bool, true if the file doesn't have any charactere to be readed
int SynchConsole::SynchGetChar ( )

SynchConsole::SynchGetChar Wait for a char to be available and return is int value.

Returns
int : The int value of the char readed
void SynchConsole::SynchGetString ( char *  s,
int  n 
)

SynchConsole::SynchPutString Get a String from the stream. This is more efficent than multiple GetChar beacause.

Parameters
*s: is the adress where the string will be writed
n: The max size of the string. The string is ended if one char is wether '
' or EOF
void SynchConsole::SynchPutChar ( const char  ch)

SynchConsole::SynchPutChar Write a char in the output stream.

Parameters
ch: the caracter that will be written
void SynchConsole::SynchPutString ( const char *  s)

SynchConsole::SynchPutString Write a String in the output stream. This is more efficent than multiple PutChar beacause.

Parameters
s: the char * that will by written (Care of the '' end)

The documentation for this class was generated from the following files: