Doxygen-ize
This commit is contained in:
+28
-16
@@ -1,3 +1,7 @@
|
||||
/** \file server/drivers/lcd_sem.c
|
||||
* semaphore code to mediate access to the parallel port.
|
||||
*/
|
||||
|
||||
/*
|
||||
* lcd_sem.c -- semaphore code written for lcdtime and meter to mediate
|
||||
* access to the parallel port.
|
||||
@@ -34,7 +38,6 @@
|
||||
#include "lcd_sem.h"
|
||||
|
||||
// according to X/OPEN we have to define it ourselves
|
||||
//#ifdef _SEM_SEMUN_UNDEFINED
|
||||
#ifndef HAVE_UNION_SEMUN
|
||||
union semun {
|
||||
int val; /* value for SETVAL */
|
||||
@@ -59,19 +62,22 @@ static key_t getkey (register char *p);
|
||||
static struct sembuf semaphore_wait = { SEM_WAIT };
|
||||
static struct sembuf semaphore_signal = { SEM_SIGNAL };
|
||||
|
||||
/*
|
||||
* getkey returns the key for the semaphore
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return the key for the semaphore.
|
||||
*/
|
||||
static key_t
|
||||
getkey(register char *p)
|
||||
{
|
||||
return((key_t) SEMKEY);
|
||||
}
|
||||
|
||||
/*
|
||||
* create the semaphore if one doesn't exist and initialise it to 1, else
|
||||
* return the semaphore set id
|
||||
|
||||
/**
|
||||
* Get semaphore.
|
||||
* If the semaphore does not exist, create it and initialise it to 1,
|
||||
* otherwise simply return the semaphore ID.
|
||||
* \return Semaphore ID on success; terminate program with code \c 1 on error.
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -113,10 +119,12 @@ sem_get (void)
|
||||
return semid;
|
||||
}
|
||||
|
||||
/*
|
||||
* wait on the semaphore
|
||||
*/
|
||||
|
||||
/**
|
||||
* Wait on the semaphore.
|
||||
* \param sid Semaphore ID.
|
||||
* \return \c 0 on success; terminate program with code \c 1 on error.
|
||||
*/
|
||||
int
|
||||
sem_wait(int sid)
|
||||
{
|
||||
@@ -128,10 +136,12 @@ sem_wait (int sid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* signal on the semaphore
|
||||
*/
|
||||
|
||||
/**
|
||||
* Signal on the semaphore.
|
||||
* \param sid Semaphore ID.
|
||||
* \return \c 0 on success; terminate program with code \c 1 on error.
|
||||
*/
|
||||
int
|
||||
sem_signal(int sid)
|
||||
{
|
||||
@@ -143,10 +153,12 @@ sem_signal (int sid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* remove the semaphore
|
||||
*/
|
||||
|
||||
/**
|
||||
* Remove the semaphore
|
||||
* \param sid Semaphore ID.
|
||||
* \return \c 0 on success; terminate program with code \c 1 on error.
|
||||
*/
|
||||
int
|
||||
sem_remove(int sid)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user