POK
blackboard.h
1 /*
2  * POK header
3  *
4  * The following file is a part of the POK project. Any modification should
5  * made according to the POK licence. You CANNOT use this file or a part of
6  * this file is this part of a file for your own project
7  *
8  * For more information on the POK licence, please see our LICENCE FILE
9  *
10  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
11  *
12  * Copyright (c) 2007-2009 POK team
13  *
14  * Created by julien on Thu Jan 15 23:34:13 2009
15  */
16 
17 
18 #ifndef __POK_USER_BLACKBOARD_H__
19 #define __POK_USER_BLACKBOARD_H__
20 
21 #ifdef POK_NEEDS_MIDDLEWARE
22 #ifdef POK_NEEDS_BLACKBOARDS
23 
24 #include <types.h>
25 #include <errno.h>
26 
27 typedef struct
28 {
29  pok_size_t size;
30  pok_bool_t empty;
31  pok_range_t waiting_processes;
32  pok_size_t index;
33  pok_bool_t ready;
34  pok_event_id_t lock;
36 
37 typedef struct
38 {
39  pok_port_size_t msg_size;
40  pok_bool_t empty;
41  pok_range_t waiting_processes;
43 
44 
45 pok_ret_t pok_blackboard_create (char* name,
46  const pok_size_t msg_size,
47  pok_blackboard_id_t* id);
48 
49 pok_ret_t pok_blackboard_read (const pok_blackboard_id_t id,
50  const uint64_t timeout,
51  void* data,
52  pok_port_size_t* len);
53 
54 pok_ret_t pok_blackboard_display (const pok_blackboard_id_t id,
55  const void* message,
56  const pok_port_size_t len);
57 
58 pok_ret_t pok_blackboard_clear (const pok_blackboard_id_t id);
59 
60 pok_ret_t pok_blackboard_id (char* name,
61  pok_blackboard_id_t* id);
62 
63 pok_ret_t pok_blackboard_status (const pok_blackboard_id_t id,
64  pok_blackboard_status_t* status);
65 #endif
66 #endif
67 #endif
68