Doxygen-ize

This commit is contained in:
marschap
2008-12-22 17:42:19 +00:00
parent 3012f2f4e0
commit 038423a10b
+28 -16
View File
@@ -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 * lcd_sem.c -- semaphore code written for lcdtime and meter to mediate
* access to the parallel port. * access to the parallel port.
@@ -34,7 +38,6 @@
#include "lcd_sem.h" #include "lcd_sem.h"
// according to X/OPEN we have to define it ourselves // according to X/OPEN we have to define it ourselves
//#ifdef _SEM_SEMUN_UNDEFINED
#ifndef HAVE_UNION_SEMUN #ifndef HAVE_UNION_SEMUN
union semun { union semun {
int val; /* value for SETVAL */ 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_wait = { SEM_WAIT };
static struct sembuf semaphore_signal = { SEM_SIGNAL }; static struct sembuf semaphore_signal = { SEM_SIGNAL };
/*
* getkey returns the key for the semaphore
*/
/**
* Return the key for the semaphore.
*/
static key_t static key_t
getkey(register char *p) getkey(register char *p)
{ {
return((key_t) SEMKEY); 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 int
@@ -113,10 +119,12 @@ sem_get (void)
return semid; 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 int
sem_wait(int sid) sem_wait(int sid)
{ {
@@ -128,10 +136,12 @@ sem_wait (int sid)
return 0; 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 int
sem_signal(int sid) sem_signal(int sid)
{ {
@@ -143,10 +153,12 @@ sem_signal (int sid)
return 0; 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 int
sem_remove(int sid) sem_remove(int sid)
{ {