/**CFile***********************************************************************

  FileName    [my_semaphore.c]

  Synopsis    [Functions that implement the semaphore management.]

  Description [  ...  ]

  Authors     [ your name ]

******************************************************************************/

#define _FILENAME "my_semaphore.c: "

#include "my_semaphore.h"

/********************************************************************
  Function: 	createSem
  Description:
  Creates a semaphore. The first parameter is a pointer to a strcut
  MySempahore and the second parameter the name of the semaphore.
  
  The return value is semaphore key in case of success
  and -1 in case of error.
********************************************************************/

    int createSem ( MySemaphore *sem, long sem_key ) {

   }

/********************************************************************
  Function: 	waitSem
  Description:
  Changes the value of a semaphore with the operation "-1". Since
  the semaphore alternates between 0 and -1, a call of this
  function leads always to a blocking state.
********************************************************************/
   
    int waitSem ( int sem_id ) {

   }


/********************************************************************
  Function: 	releaseSem
  Description:
  Changes the value of a semaphore with the operation "+1". Since
  the semaphore alternates between 0 and -1, a call of this
  function leads always to a un-blocking state and the waiting 
  process can continue working.
********************************************************************/
	
    int releaseSem ( int sem_id ) {

   }
	

/********************************************************************
  Function: 	closeRemoveSem
  Description:
  The semaphore that is identified by the name is closed and removed 
  from the system. An existing but not accessible semaphore will
  lead to program termination.
  Non-existing semaphores can be "closed and removed" 
  without mistake.
********************************************************************/

    void closeRemoveSem (long sem_key) {

   }
	

/********************************************************************
  Function: 	getSemId
  Description:
  Returns the semaphore identification in case a name of a semaphore
  is passed as the parameter.
  The program execution is terminated in case the semget system
  function is not successful.
********************************************************************/
		
    int getSemId (long key) {

   }


