]> rtime.felk.cvut.cz Git - frescor/fna.git/blob - src_frescan/frescan_reply_objs.h
07bcdcd88e4d102aea1dbf18433e9f09c6200515
[frescor/fna.git] / src_frescan / frescan_reply_objs.h
1 /*!
2  * @file frescan_reply_objs.h
3  *
4  * @brief FRESCAN reply objects
5  *
6  * This module contains the definition of the data object and operations to
7  * create a pool of objects, obtain the id of an unused object, wait upon it,
8  * signal it, and finish using it.
9  *
10  * @version 0.01
11  *
12  * @date 1-Apr-2008
13  *
14  * @author Daniel Sangorrin <daniel.sangorrin@unican.es>
15  *
16  */
17
18 #ifndef _FRESCAN_REPLY_OBJECTS_H_
19 #define _FRESCAN_REPLY_OBJECTS_H_
20
21 #include <time.h> /* for timespec */
22 #include "fosa_opaque_types.h" /* for FOSA_ETIMEDOUT */
23
24 typedef unsigned int frescan_robj_id_t; /* 0 .. MX_REPLY_OBJECTS-1 */
25 #define FRESCAN_ETIMEDOUT FOSA_ETIMEDOUT
26
27 extern int frescan_replyobjects_init(int max_ceiling);
28 extern int frescan_replyobject_alloc(frescan_robj_id_t *id, int ceiling);
29 extern int frescan_replyobject_free(frescan_robj_id_t id);
30 extern int frescan_replyobject_signal(frescan_robj_id_t id);
31 extern int frescan_replyobject_wait(frescan_robj_id_t id);
32 extern int frescan_replyobject_timedwait(frescan_robj_id_t id,
33                                          const struct timespec *abstime);
34
35 #endif // _FRESCAN_REPLY_OBJECTS_H_